Reputation: 1
I am new to houndify,i have been creating STT(Speech To Text) process.i have an idea to create it using python.I choosed houndify python 2.7 SDK.I have got the client id and client key of houndify service.So how can i proceed to Speech To Text conversion?.Please solve it in step by step process?
Upvotes: 0
Views: 2493
Reputation: 21
The Python SDK contains two sample scripts that show how to send voice queries to Houndify: sample_stdin.py and sample_wave.py. Regardless of the source of audio, the steps are following:
houndify.StreamingHoundClient
object with clientID, clientKey and some userID (can be "test_user" during development, but ideally should correspond to your enduser)houndify.HoundListener
classstart()
methodclient.fill(samples)
client.finish()
after streaming is doneYou can find more details about the SDK (including information about setting request info fields) here: https://docs.houndify.com/sdks/docs/python .
Here's a simple script that reads audio from stdin and just prints partial transcripts, final response or error message:
import sys
import houndify
class MyListener(houndify.HoundListener):
def onPartialTranscript(self, transcript):
print "Partial transcript: " + transcript
def onFinalResponse(self, response):
print "Final response: " + str(response)
def onError(self, err):
print "Error: " + str(err)
client = houndify.StreamingHoundClient(<CLIENT_ID>, <CLIENT_KEY>, "test_user", sampleRate = 8000)
BUFFER_SIZE = 512
client.start(MyListener())
while True:
samples = sys.stdin.read(BUFFER_SIZE)
if len(samples) == 0: break
finished = client.fill(samples)
if finished: break
client.finish()
Upvotes: 2