Created
August 16, 2019 02:23
-
-
Save kbridbur/4ee919348be86df87caf82d61d4379fd to your computer and use it in GitHub Desktop.
Rev.ai Python Streaming Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rev_ai.models import MediaConfig | |
from rev_ai.streamingclient import RevAiStreamingClient | |
import io | |
config = MediaConfig(YOUR MEDIA CONTENT TYPE) | |
streamclient = RevAiStreamingClient(YOUR ACCESS TOKEN, config) | |
with io.open(YOUR FILE, 'rb') as stream: | |
MEDIA_GENERATOR = [stream.read()] | |
response_generator = streamclient.start(MEDIA_GENERATOR) | |
for response in response_generator: | |
print(response) | |
streamclient.end() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment