Sarthak Ghosh
Sarthak Ghosh

Reputation: 1

How can I access the microphone data while running dictation recognizer at the same time in Unity?

Hi I am using the DictationRecognizer Class to add speech input capabilities in my project. I followed this https://learn.microsoft.com/en-us/windows/mixed-reality/voice-input-in-unity to implement the Dictation Recognizer and it works.

However, in my app, i want to include an animation based on the volume of the live microphone data. Whenever the microphone starts getting speech data, I want to run a small animation inside unity to indicate that the microphone is recording. Is it doable while the dictation recognizer is running? Any help is appreciated!

Upvotes: 0

Views: 546

Answers (1)

Dimitri
Dimitri

Reputation: 119

Well yes you can record like 1 second each time without using the DictationRecognizer. You can store the recording inside a audio clip and use the samples to calculate the average volume.

check this for recording audio from the microphone. https://docs.unity3d.com/ScriptReference/Microphone.Start.html

Once you have the recorded clip you can use this to get average volume: http://answers.unity.com/answers/1178679/view.html

Upvotes: 0

Related Questions