HiVoicy English ASR API can convert any English voice to text.You can try our speech recognition with your mobile voice recorder or uploading a file easily on our website.
-Supported file types: mp3, Ogg, Wav, m4a and WMA.
-Max length can be 1 minute.
-HiVoicy English Speech Recognition can convert any English voice to text.
-Supported file types: mp3, Ogg, Wav, m4a and WMA.
-Max length can be 1 minute.
import requests
api_url = 'https://speech-recognition-english.p.rapidapi.com/api/asr'
api_key = 'Your API Key'
sound_path = 'Sound directory path'
sound_name = 'Sound file name'
files = {'sound': (sound_name, open(sound_path + sound_name, 'rb'), 'multipart/form-data')}
header = {
"x-rapidapi-host": "speech-recognition-english.p.rapidapi.com",
"x-rapidapi-key": api_key
}
response = requests.post(api_url, files=files, headers=header)
####JSON output
{
"statusCode": 200,
"statusMessage": "OK",
"hasError": false,
"request": {
"conversationID": "558ac9e361474095b3932766e12271d5",
"linkFile": "",
"packetID": "13e814954f804c74a1c652813013650e",
"timeStamp": 132492249210298480,
"userID": "b12ee63a8ae74ca990449a17e8e71fac"
},
"data": {
"phonetic": "Phonetic of text",
"text": "Your text of voice ",
"duration": 2
}
}