Skip to content

Commit

Permalink
import style
Browse files Browse the repository at this point in the history
  • Loading branch information
dizcology committed Jul 6, 2017
1 parent 79c6089 commit 3dfd982
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions speech/cloud-client/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def run_quickstart():
import os

# Imports the Google Cloud client library
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types

# Instantiates a client
client = SpeechClient()
client = speech.SpeechClient()

# The name of the audio file to transcribe
file_name = os.path.join(
Expand Down
9 changes: 5 additions & 4 deletions speech/cloud-client/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

def transcribe_file(speech_file):
"""Transcribe the given audio file."""
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types
client = SpeechClient()
client = speech.SpeechClient()

with io.open(speech_file, 'rb') as audio_file:
content = audio_file.read()
Expand All @@ -52,9 +52,10 @@ def transcribe_file(speech_file):

def transcribe_gcs(gcs_uri):
"""Transcribes the audio file specified by the gcs_uri."""
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types
client = SpeechClient()
client = speech.SpeechClient()

audio = types.RecognitionAudio(uri=gcs_uri)

config = types.RecognitionConfig(
Expand Down
9 changes: 5 additions & 4 deletions speech/cloud-client/transcribe_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

def transcribe_file(speech_file):
"""Transcribe the given audio file asynchronously."""
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types
client = SpeechClient()
client = speech.SpeechClient()

with io.open(speech_file, 'rb') as audio_file:
content = audio_file.read()
Expand Down Expand Up @@ -61,9 +61,10 @@ def transcribe_file(speech_file):

def transcribe_gcs(gcs_uri):
"""Asynchronously transcribes the audio file specified by the gcs_uri."""
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types
client = SpeechClient()
client = speech.SpeechClient()

audio = types.RecognitionAudio(uri=gcs_uri)

config = types.RecognitionConfig(
Expand Down
4 changes: 2 additions & 2 deletions speech/cloud-client/transcribe_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

def transcribe_streaming(stream_file):
"""Streams transcription of the given audio file."""
from google.cloud.speech import SpeechClient
from google.cloud import speech
from google.cloud.speech import types
client = SpeechClient()
client = speech.SpeechClient()

with io.open(stream_file, 'rb') as audio_file:
content = audio_file.read()
Expand Down

0 comments on commit 3dfd982

Please sign in to comment.