Answered
0
0

I used the following method to write butter to a file, but the file is corrupt. How can I solve it?
sound ->readData(&irData[1], irdatalength-sizeof (short), &irDataRead);
Fwrite (& irData [1], irDataLength, sizeof (short), FPW);

  • yourks

    Do you need to set system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER)?
    But if you set up the FMOD_OUTPUTTYPE_WAVWRITER, you will not be able to run.

  • yourks

    How does the FMOD_OUTPUTTYPE_OPENSL mode output sound to a file?

  • You must to post comments
Best Answer
0
0

To access the data from a recorded sound, you are best off using Sound::lock & Sound::unlock.
https://fmod.com/resources/documentation-api?page=content/generated/FMOD_Sound_Lock.html#/

The data from FMOD should not corrupt the file, it would be more likely to do with the writing of the file. eg. Make sure the file is being closed after writing to it.

  • yourks

    Is there a simple learning example?

  • Cameron Baron

    At the moment we don’t have any examples using lock/unlock, although we are planning on adding some.

    It just needs to be used in place of system->readData().
    ReadData will attempt to decode the data, store it in memory and internally call system->lock() to get the data buffer. If you are trying to access the recorded data, before it is written to file, it does not need to be decoded.

  • yourks

    Thank you for your help. Now I still don’t understand the specific process. Could you please write the main steps?

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.