0
0

Hi,
I am using fmodce 3.74 version library to develope recorder on PocketPC. Two of my application’s buttons are Dictate and Delete. I create a thread in dictate button pressed and the recorder records fine and creates a wav file. In thread class constructor I initialize FSOUND library by calling FSOUND_Init and allocate memory using FSOUND_Sample_Alloc API.
When delete button pressed, in the thread class destructor I call FSOUND_Sample_Free(samp);
FSOUND_Close();

APIs to free FSOUND memory since I am using FSOUND_UNMANAGED in Alloc. and Shutdown FSOUND system.

Again if I click on Dictate button, I create a new thread and the control goes through same thread class constructor to initialize and allocate memory. But this time when I call FSOUND_Record_GetPosition API, it returns record position value same as my last record position in earlier thread execution. I debugged and logged all the record positions in my first thread execution and the second thread execution. I am seeing record position = 0 before call to FSOUND_Record_GetPosition, so my thread constructor is reinitializing all values correctly to 0 as expected, but FSOUND_Record_GetPosition API returns value from last thread execution even if I am freeing and closing FSOUND system in destructor.

Due to this when I listen to the second recording, it gives me blank recording in the beginning for recording length = the buffer length I defined. Say if I defined buffer size = 15 sec. I get 15 sec of blank recording and then my actual recording.

Please give inputs if you came across this before or suggest. Why FSOUND_Record_GetPosition API remembers and returns the last thread execution’s value even after closing FSOUND system in thread destructor?

Thanks & Regards,
Mangesh

  • You must to post comments
0
0

Hi Brett,
We spin off a worker thread and the foreground thread and the worker thread should not conflict as they do not call things simultaneously. About the only thing the foreground thread does
is FSOUND_Init() and FSOUND_Stop(). So we have only one thread calling fmod.

Thanks,
Mangesh

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.