StreamListener is a low-level object used by Scanner and SpeechData.
As the audio input is decoded, a StreamListener listens to the Stream‘s real-time decoded results and calls the specified callback function with new data for each newly decoded Utterance.
To store the decoding results, use SpeechData.
Listens to stream’s real-time decoded results and calls callback with new data.
The constructor creates a StreamListener object that listens to the results of the given Stream‘s decoding as they happen. You must call client.server.Server.decodestreams() on stream before constructing a StreamListener for it.
callback will be called with (Stream, Utterance) when decoded data is received. callback will be called with Utterance = None when Stream is done. start and/or end can be set to datetimes to limit the date range of results listened to.