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?
Asked
Active
Viewed 2,435 times
1 Answers
2
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:
- initialize
houndify.StreamingHoundClient
object with clientID, clientKey and some userID (can be "test_user" during development, but ideally should correspond to your enduser) - extend
houndify.HoundListener
class - pass the instance of your listener to StreamingHoundClient object's
start()
method - read audio chunks (8/16 kHz mono 16-bit little-endian PCM samples) in a loop and feed it into client:
client.fill(samples)
- call
client.finish()
after streaming is done
You 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()

aisfo
- 21
- 1