2

My project is to do speaker recognition using a microphone.

I'm using the speeh_recognition library to extract my microphone audio, but the object's class is 'speech_recognition.AudioData' and i don't know how to convert it into a wav file (in order to use librosa for example to then get audio features and maybe recognize the speaker).

Could someone please help me on that ? I have been learning Python for not so long so there might also be easier ways to do speaker recognition using a mic :) Many thanks !

0

1 Answer 1

5

write audio to a WAV file:

with open("microphone-results.wav", "wb") as f:
    f.write(audio.get_wav_data())

Quoting the doc:

Returns a byte string representing the contents of a WAV file containing the audio represented by the AudioData instance.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.