Menu

#4 std::cin error with AUDIO_OUTPUT_RETRIEVAL

v1.0 (example)
open
None
1
2013-06-25
2013-06-24
No

Hello I am have a strange behaviour with my code.
After calling espeak_Synth with a SynthCallback the program crashes while attempting to use std:cin.
I am attaching my code, the output and the debugger output.

I hope some one can help me.
Regards
Mario

1 Attachments

Discussion

  • Jonathan Duddington

    Sorry, I have no idea.

    The line:

    cin >> i;

    isn't anything to do with eSpeak directly. Perhaps something has corrupted the stack or overwritten some memory in error?

    Your attachment doesn't include the contents of the files rovioSpeak.cpp and rovioSpeak.h (they are only links), so I don't know what they do.

     
  • Mario Chirinos

    Mario Chirinos - 2013-06-24

    Sorry I am attaching now the h and cpp file. Please take a look at is is very important, the code is part of larger class which is crashing in an other std stream, I am trying to fin the cause of the crash and I find this strange behaviour with cin.
    I have commented all the code inside the call back to isolate the problem. I would really appreciate if you can take a look at my code.

    Regards
    Mario

     
  • Mario Chirinos

    Mario Chirinos - 2013-06-25

    I hope you will be able yo help me.

     
  • Jonathan Duddington

    I think the problem is your variable:

    unsigned int* unique_identifier;

    in rovioSpeak::speak()

    is a pointer which is not initialized. It doesn't point to an integer variable.

    You could change it to:

    unsigned int unique_identifier;
    espeak_Synth(,,,,,, &unique_identifier, );

    or alternatively, if you don't need it you can use:

    espeak_Synth(,,,,,, NULL, );

    I'll change to comment in speak_lib.h to better explain the use of this parameter.

     
  • Mario Chirinos

    Mario Chirinos - 2013-06-25

    Thank you very much that solves all the problems. It was a silly mistake.

    Regards
    Mario

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.