File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 55# passed in the request. When the service responds with the synthesized
66# audio, the pyaudio would play it in a blocking mode
77
8+ from __future__ import print_function
89from watson_developer_cloud import TextToSpeechV1
910from watson_developer_cloud .websocket import SynthesizeCallback
1011import pyaudio
@@ -66,20 +67,20 @@ def __init__(self):
6667 self .play = Play ()
6768
6869 def on_connected (self ):
69- print 'Opening stream to play'
70+ print ( 'Opening stream to play' )
7071 self .play .start_streaming ()
7172
7273 def on_error (self , error ):
73- print 'Error received: {}' .format (error )
74+ print ( 'Error received: {}' .format (error ) )
7475
7576 def on_timing_information (self , timing_information ):
76- print timing_information
77+ print ( timing_information )
7778
7879 def on_audio_stream (self , audio_stream ):
7980 self .play .write_stream (audio_stream )
8081
8182 def on_close (self ):
82- print 'Completed synthesizing'
83+ print ( 'Completed synthesizing' )
8384 self .play .complete_playing ()
8485
8586test_callback = MySynthesizeCallback ()
You can’t perform that action at this time.
0 commit comments