I’m trying to capture streams by IAudioClient(in Windows Core Audio APIs), and play them concurrently through Fmod in order to get a mixed result.
Brief Steps as follows:
allocate 2 stream buffers, one for Microphone(Recording Device), one for Speakers(Playback Device).
create a Fmod::Sound object for each buffer.(Paused, and FMOD_2D | FMOD_SOFTWARE | FMOD_OPENMEMORY | FMOD_OPENRAW | FMOD_LOOP_NORMAL)
get IAudioClients of Microphone and Speakers, and call IAudioClient::Start().
copy the stream data from IAudioCaptureClient to buffer for a period(for example 100ms).
play Fmod::Sound objects.
do step in loop mode, data capture->copy->play, buffer front->back->front.
Each stream works fine when it’s played individually.But the Speaker stream will lose voice if two streams are playing at the same time.I’ve tried to save each of these two streams as a .wav file,while they are playing At The Same Time, but both of the 2 .wav files played by MediaPlayer sounds fine.
Extra Info: If I don’t call IAudioClient::Start() of Microphone Device, I can hear the voice of Speaker stream.(Is it possible that, this manipulation will affect Fmod in some way?)
I feel so sorry for my poor English, but I was really stuck by this problem for a long time.
Anyone can help? 😉
- larnya asked 7 years ago
- You must login to post comments