0

Use case: I have put my phone on speaker, dialled customer care ,recorded automated voice message on my laptop , now I want convert that into text.

What I did until now ?

I tried with speech recognition library in python

import speech_recognition as sr 
import time 
r=sr.Recognizer()

#This block will help in recognising audio file harvard = sr.AudioFile('voice1.wav') with harvard as source:
    r.adjust_for_ambient_noise(source)
    audio = r.record(source,offset=0, duration=5)

print r.recognize_google(audio, show_all=True)

However, no text is returned.

pankaj mishra
  • 2,555
  • 2
  • 17
  • 31

1 Answers1

0

Sorry for the late reply. I created a virtual assistant using the google speech API. It turns out the main problem is with the microphone threshold. Try playing with its threshold. Because when you record a stream in real-time try saving it and listening to it locally. There is a parameter in microphone function which is a threshold, try changing that because by default tunning its pretty bad if the microphone is builtin.

The Google speech API might be block (but its working for me even though I am not using any token). Although the preferred option is to use Tokens in Google API (speech to text) While the text is returned in a perfect form. Check the documentation of speech recognition. There are tons of other APIs as well.

Shafay
  • 187
  • 2
  • 7