Microphone Audio Input?

Edit: I was able to read data through IVoiceCapture and play it back through a USoundWaveStreaming correctly, but I do not recognize the data format. Any ideas on what it is?

I am trying to run FFT analyses on live microphone samples but I am having trouble setting up audio input. I’ve found a few other questions on here but their answers weren’t very helpful.

The documentation for the OnlineSubsystem module is incomplete. Is there anywhere else to look for better information?

Also I have been looking for TestVoice.cpp as mentioned in another similar question here, but apparently it has been renamed. The information on this has been vague.

Actually it has not been renamed, you can find it here in 4.5 (the slashes were eaten out, I replaced them):

Engine - Source - Runtime - Online - OnlineSubsystemUtils - Private - Tests -

This is a good start but it probably needs a lot of work.

Thanks! I didn’t think to check the source code - it wasn’t in my current install. I’m looking into it now.

I was able to read data through IVoiceCapture and play it back through a USoundWaveStreaming correctly, but I do not recognize the data format. Any ideas on what it is?

I think it might be PCM data, but I’m not sure. I can’t tell what the resolution is, if it is.

I’m pretty sure it’s 16 bit PCM. Could you please post a dump of the audio you extracted?

Sure, here’s the dump. audio_dump

Oh, never mind I got it now. It is 16 bit PCM at 16khz, single channel. Thanks!

Hey there, I’m trying to do the same thing but running into troubles. Do you think you could provide a tutorial or some in-depth explanation about how you were able to get microphone input? I’m trying to detect blowing on the microphone for a project of mine, and there don’t seem to be any resources on how I could do this. Thanks!

Hello there,
i’m working on a similar project and i’ve faced your same issue: basically i cannot understand how to provide a “working” soundwave to the spectrum or amplitude analyzer. I can hear my voice from the microphone.

Is there any advices/hints about it?

The testvoice.cpp and testvoice.h are here:
testvoice.cpp
testvoice.h

Due to the way these analyzers work, you cannot feed them with the audio you’ve captured.

There are currently no easy way to obtain a read access to any audio data, even a simple vu-meter couldn’t be coded.

I guess the only (and really not obvious) way to do so would involve adding an extra layer in the audio stack, say an additional FAudioDevice between the actual platform audio device and the engine. This would require heavy engine changes.

Sorry for the delay on this post. Here’s a small blurb on how we figured out our problem. http://quoteunquotestudio.com/2015/02/22/microphone-input-in-ue4/ Hope it’s still relevant.

Huge delay. But in case it’s still relevant to you. http://quoteunquotestudio.com/2015/02/22/microphone-input-in-ue4/

Thank you a lot for this!

Did you find out a way to redirect this captured data to an audio output?

Yeah one of the things we’re doing is using the USoundWaveStreaming class.

You can call USoundWaveStreaming::QueueAudio to queue up samples.

Any chance you could provide a quick tutorial on this? I found your snippet of code, but I’ve been having trouble actually getting it to work.

This link is awesome McQuiggle. I just wish there was more documentation on how to play what it just recorded or even save the audio as a file. If you’re still working with this, we could use your thoughts.

Thanks!

Is it possible to get information like the pitch of the voice from this system?

Aaron McLaren is doing heavy engine audio changes. Maybe he can slip in some audio data reader functions?