This project has moved and is read-only. For the latest updates, please go here.

WinRT playback recorded microphone audio

Jul 17, 2015 at 11:54 AM
Edited Jul 17, 2015 at 12:10 PM
Hi!

My problem is (hopefully) not big, but I managed to get stuck with it now for a long time... I'd be very thankful if anybody could help me with it.
So the situation is: I have to record microphone input in my app, then play it back through the audio output.
Actually I am writing a Tox client and I am trying to play back the received audio frames, but you can see that the two things are almost identical. In case of Tox, I just receive the frames from the network, not from my mic. https://github.com/uruk/WinTox/blob/audio/WinTox/ViewModel/CallViewModel.cs

So I made a simplified application to demonstrate my solution for the mic-to-output problem so far:
https://github.com/uruk/NAudioTest/blob/master/NAudioTest/MainPage.xaml.cs

It works (after you give permission to the app to use your mic manually through the settings charm), but the audio played back is nowhere near my normal voice. What am I doing wrong?

Thanks for help in advance,
Peter
Aug 4, 2015 at 2:47 PM
sounds like a format issue. Can you recognize your voice at all? What happens if you just record at the default WasapiCapture wave format (i.e. don't set it explicitly)?
Oct 28, 2015 at 3:27 PM
Sorry for not replying for so long! I managed to solve my problem with audio graphs since then. (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/mt203787.aspx)
Still many thanks for your response!