I've been working with the Kinect and Voice Recognition, and I'm noticing that I can't get the AudioLevel
member to change from my SpeechRecognitionEngine
object.
I am successful in getting the commands to be recognized, so I know that the kinect is presenting my application with sound. I've tried subscribing to the AudioLevelUpdated
event and reading the AudioLevel
directly, but the event doesn't fire and the AudioLevel
is always 0.
Is there anything special I need to do activate the AudioLevel
?
I remember having the same problem in the past. In my search for a solution I found that it could have several reasons but I haven't really been able (have not had the time) to pinpoint the problem for my case yet. I will still list some reasons I have found.
AudioStatus.dwAudioLevel
which may return 0 for a reason.A workaround which has been suggested on MSDN(by IanPeters) and worked ok for me was to extract the sample audio from the Recognized audio, use RecognizedAudio.WriteToWaveStream()
and then take the average of the absolute value of the audio. This will give you an estimate and could be sufficient for your situation.
The original post of IanPeters is located on msdn (SpeechRecognitionEngine.AudioLevel)