Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quickstart sample for the Cloud Speech API. #658

Merged
merged 2 commits into from
Nov 15, 2016
Merged

Conversation

jmdobry
Copy link
Member

@jmdobry jmdobry commented Nov 15, 2016

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 15, 2016
speech_client = speech.Client()

# The name of the audio file to transcribe
file_name = os.path.join(os.path.dirname(__file__), 'resources/audio.raw')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use / in join, just pass more arguments:

os.path.join(os.path.dirname(__file__), 'resources', 'audio.raw')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

with io.open(file_name, 'rb') as audio_file:
content = audio_file.read()
audio_sample = speech_client.sample(
content, None, 'LINEAR16', 16000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use keyword arguments for every argument other than content?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@theacodes theacodes merged commit 0b6510f into master Nov 15, 2016
@theacodes theacodes deleted the quickstart-speech branch November 15, 2016 22:32
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 6, 2023
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 6, 2023
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 18, 2023
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants