File tree Expand file tree Collapse file tree 13 files changed +52
-22
lines changed
appengine/flexible/django_cloudsql Expand file tree Collapse file tree 13 files changed +52
-22
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,3 @@ beta_settings:
99runtime_config :
1010 python_version : 3
1111# [END runtime]
12-
Original file line number Diff line number Diff line change 8181# [START dbconfig]
8282DATABASES = {
8383 'default' : {
84- 'ENGINE' : 'django.db.backends.mysql' ,
84+ # If you are using Cloud SQL for MySQL rather than PostgreSQL, set
85+ # 'ENGINE': 'django.db.backends.mysql' instead of the following.
86+ 'ENGINE' : 'django.db.backends.postgresql' ,
8587 'NAME' : 'polls' ,
8688 'USER' : '<your-database-user>' ,
8789 'PASSWORD' : '<your-database-password>' ,
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ Django==1.11
22mysqlclient == 1.3.10
33wheel == 0.29.0
44gunicorn == 19.7.1
5+ psycopg2 == 2.7.1
Original file line number Diff line number Diff line change 1- google-cloud-language == 0.24.0
1+ google-cloud-language == 0.24.1
Original file line number Diff line number Diff line change 1- google-cloud-language == 0.24.0
1+ google-cloud-language == 0.24.1
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ To run this sample:
127127
128128 Example usage:
129129 python transcribe_async.py resources/audio.raw
130- python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.flac
130+ python transcribe_async.py gs://cloud-samples-tests/speech/brooklyn.raw
131131
132132 positional arguments:
133133 path File or GCS path for audio file to be recognized
@@ -136,6 +136,31 @@ To run this sample:
136136 -h, --help show this help message and exit
137137
138138
139+ Transcribe Streaming
140+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
141+
142+
143+
144+ To run this sample:
145+
146+ .. code-block :: bash
147+
148+ $ python transcribe_streaming.py
149+
150+ usage: transcribe_streaming.py [-h] stream
151+
152+ Google Cloud Speech API sample application using the streaming API.
153+
154+ Example usage:
155+ python transcribe_streaming.py resources/audio.raw
156+
157+ positional arguments:
158+ stream File to stream to the API
159+
160+ optional arguments:
161+ -h, --help show this help message and exit
162+
163+
139164
140165
141166 The client library
Original file line number Diff line number Diff line change @@ -22,5 +22,8 @@ samples:
2222- name: Transcribe async
2323 file: transcribe_async.py
2424 show_help: true
25+ - name: Transcribe Streaming
26+ file: transcribe_streaming.py
27+ show_help: true
2528
2629cloud_client_library: true
Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ def run_quickstart():
3535 # Loads the audio into memory
3636 with io .open (file_name , 'rb' ) as audio_file :
3737 content = audio_file .read ()
38- audio_sample = speech_client .sample (
38+ sample = speech_client .sample (
3939 content ,
4040 source_uri = None ,
4141 encoding = 'LINEAR16' ,
42- sample_rate = 16000 )
42+ sample_rate_hertz = 16000 )
4343
4444 # Detects speech in the audio file
45- alternatives = speech_client . speech_api . sync_recognize ( audio_sample )
45+ alternatives = sample . recognize ( 'en-US' )
4646
4747 for alternative in alternatives :
4848 print ('Transcript: {}' .format (alternative .transcript ))
Original file line number Diff line number Diff line change 1- google-cloud-speech == 0.23 .0
1+ google-cloud-speech == 0.25 .0
Original file line number Diff line number Diff line change @@ -39,9 +39,9 @@ def transcribe_file(speech_file):
3939 content = content ,
4040 source_uri = None ,
4141 encoding = 'LINEAR16' ,
42- sample_rate = 16000 )
42+ sample_rate_hertz = 16000 )
4343
44- alternatives = speech_client . speech_api . sync_recognize ( audio_sample )
44+ alternatives = audio_sample . recognize ( 'en-US' )
4545 for alternative in alternatives :
4646 print ('Transcript: {}' .format (alternative .transcript ))
4747
@@ -55,9 +55,9 @@ def transcribe_gcs(gcs_uri):
5555 content = None ,
5656 source_uri = gcs_uri ,
5757 encoding = 'FLAC' ,
58- sample_rate = 16000 )
58+ sample_rate_hertz = 16000 )
5959
60- alternatives = speech_client . speech_api . sync_recognize ( audio_sample )
60+ alternatives = audio_sample . recognize ( 'en-US' )
6161 for alternative in alternatives :
6262 print ('Transcript: {}' .format (alternative .transcript ))
6363
You can’t perform that action at this time.
0 commit comments