My objective is to record from microphone, hear the recording as it’s being take, and write it to disk as it’s being taken. I have searched the Delphi forum but I can’t find an example of how to record from the microphone to a disk file. I was able to get a program working using FSOUND_RECORD_StartSample so that I can hear the recording as it is being taken, but I can’t figure out how to write it to disk. The recording could be very long, perhaps a few hours or more. Looking at the fmod “record” example in C, it seems that I would need to do something like this (Outfile is a TFileStream):

[code:23u519ut]if FSOUND_sample_lock(sample1,0,FSOUND_sample_getLength(sample1)*4,ptr1,ptr2,len1,len2) then
Outfile.Write(ptr1^, len1); // this causes an access violation


“Outfile.Write” causes an access violation. Since there is no callback for FSOUND_Record_StartSample where does the code that locks and unlocks the sample go in the program and how do I write the buffer to disk? Because the recording could be very large, I need to write to disk as I record.


  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.