0
0

Hi,
I have my app recording from the mic on iPhone. The user can record a max of 30 seconds of audio, which i have set in the "sound exit info". But, if the user only records, say 10 seconds of audio and presses the "stop recording" button, the sound is still really 30 seconds.

I have tried setting the exit info length to zero, but i receive this error: "FMOD error! (37) An invalid parameter was passed to this function." I am recording to the disk, like in the recordtodisk example.

Is there a way to record a sound without a specified length? Alternatively, is there a way to crop/trim a sound to a specified time range after recording? Thanks in advance.

  • You must to post comments
0
0

When you specify the size of the FMOD::Sound via FMOD_CREATESOUNDEXINFO you are telling FMOD how much memory to allocate. So if it’s 30 seconds, then a buffer with 30 seconds of silence is allocated. If you don’t fill the entire buffer during your recording you will have silence at the end, as you have noticed. If you wanted to crop the sound you can access the data via Sound::lock, at this point you could save the data to disk (if you wish), do processing on the bits or even copy it to a smaller FMOD::Sound object.

  • You must to post comments
0
0

Oh yeah, I see exactly what you are talking about. In the "recordtodisk" example it shaves off the extra length when writing the wav. I can then just load that back in for playback and it will be cropped. Thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.