Does anyone know if there is a simple wrapper for FMOD in VB that can record an audio file from a sound card by just giving it a file name and telling it to GO? Then tell it “stop”? Maybe select sound card input, sample rate, mono-stereo, a VU meter… something killer simple… I don’t have time to wade through the samples and forums to put all the pieces together… recording to a file seems to be the only thing I haven’t seen a complete code sample on… just a few bits here and there – is it a secret? I want to be able to record any length file as a WAV. – can someone please help me, point me in the right direction?
I understand the C demo that records for 5 seconds, up to the point where I need to lock the buffer, write it out to a file, then unlock it. But how does this work if data is being written to the buffer from the capture stream at the same time? Obviuously, this would be done in a loop opposed to a “one shot” as in the demo. Is there a running counter of how many bytes have been captured so I can write it to the datachunk len after I’m done? Isn’t the buffer size configured in milliseconds? If I knew how many bytes it was, I could calculate this by counting how many times I went through the loop… If I can figure these two things out, I think I have the rest of the puzzle and can do it myself.
- Anonymous asked 14 years ago
To add to this, I found the following in the General Topics Forum:
I am a rookie when it comes to using the FMOD soundsystem, but I am in the process of studying it for a decision if we can use it for our software.
I’ve seen the record example that records a sample of 5 seconds using FSOUND_Record_StartSample.
That’s not that difficult to understand, but what if i want to record a sound of an undetermined length? In other words, when I push a button, the recording starts, when I push the button again, the recording stops.
How can I implement this, or is there a useful example somewhere?
Thanks in advance!
use FSOUND_Record_StartSample with the loop flag set to TRUE.
The sample you create will be a certain size, lets say 1000ms large.
You dont need to play it back if you dont want to.
Use FSOUND_Record_GetCurrentPosition to find out where the record cursor is, then just copy out the data in chunks using a polling loop.
Use FSOUND_Sample_Lock and FSOUND_Sample_Unlock to grab the data out.
This seems to ba another peice to my puzzle, but… can you just read part of the buffer with this? Does the save routine have to be far enough away from anyplace in the buffer the stream process is likely to write so the two processes don’t collide and produce corrupt data?
Thanks in advance for any help…I’m a newbie, of course
OK, it seems like I’m answering my own questions… I found everything I needed here:
maybe this will help someone else figure this out…
Please login first to submit.