Closed shahinesi closed 4 years ago
I don't know, please, contact Wit
So how does your program work? If you use API?
@shahinesi same as anyone's
@shahinesi same as anyone's
Amazing!
import requests
import json
from Recorder import record_audio, read_audio
# Wit speech API endpoint
API_ENDPOINT = 'https://api.wit.ai/speech?v=20191105'
# Wit.ai api access token
wit_access_token = 'E64XTTGVVCFWL4HGGEOU3I4TJ7CHFIHL'
def RecognizeSpeech(AUDIO_FILENAME, num_seconds = 5):
# reading audio
audio = read_audio(AUDIO_FILENAME)
# defining headers for HTTP request
headers = {'authorization': 'Bearer ' + wit_access_token,
'Content-Type': 'audio/raw;encoding=signed-integer;bits=16;rate=16000;endian=little'}
# making an HTTP post request
resp = requests.post(API_ENDPOINT, headers = headers,
data = audio)
# converting response content to JSON format
data = json.loads(resp.content)
# get text from data
#text = data['_text']
# return the text
return data
This is my code for python!
hi i'm used wit.ai for recognition language persian but error peech recognition is not supported for language: Persian how do you used wai.ai for recognation for persian? tnx