Hey, first I want to thanks for a great sound system.
I am developing a voice chat. This is what I need to acheive:
* Regulary recording from microphone
* Examine if the sound currently getting record is above a certain level
* If it is, send the latest miliseconds of recorded data over network.
I have read a lot of threads here and I have a basic I idea of how to proceed. Is still have some questions/problems.
I modified the record example so I have circular buffer available. But when I try to shorten the record length down towards 25 ms it crashes. Is this time to small? Enough and not too clumsy for network with a buffer of 1 second?
Then when it comes to examine if the sound volume is above a certain level I have another problem. I’ve read that FSOUND_GetCurrentLevels and FSOUND_INIT_ACCURATEVULEVELS might be usable, but requires a playback of the recorded sample. Then I suppose I need to mute this sample, but all methods I have tried (disabling copypaste DSP, own DSP callback settings buffers to 0) ALSO mutes other sounds played by FMOD, in for instance other threads.. In a voice chat you would like to hear others , but not yourself at the same time.
Any help would be appreciated!
- Ymer asked 13 years ago
I think I have managed to get the recorded data regulary into a buffer.
How do I analyze the raw data (ie determine if the volume is high enough for sending) without functions like FSOUND_GetCurrentLevels()?
Help me out Brett or anyone! 😕
Thanks for your reply.
[quote:21vkj85j]You should call FSOUND_Record_GetCurrentPosition and then lock/unlock the sample and read the raw data yourself using the chunk that it just wrote (ie poll regularly and then copy out the data that was just recorded, you can keep and old/new position and use some sort of chunk size, ie 1024 samples for example). [/quote:21vkj85j]
Is this procedure called a circular buffer? Having a void* buffer of some size, and regulary poll the record sample and copy to our own buffer. And also check so it hasn’t wrapped around etc..
Ok, but how do I analyze the raw data (ie determine if the volume is high enough for sending) without functions like FSOUND_GetCurrentLevels()?
Please login first to submit.