Skip to content

docs: iterate audio chunks in text-to-speech snippets - #749

Open
AlvaroBalbin wants to merge 1 commit into
deepgram:mainfrom
AlvaroBalbin:issue-638-docs-attributeerror-generator-objec
Open

docs: iterate audio chunks in text-to-speech snippets#749
AlvaroBalbin wants to merge 1 commit into
deepgram:mainfrom
AlvaroBalbin:issue-638-docs-attributeerror-generator-objec

Conversation

@AlvaroBalbin

Copy link
Copy Markdown

The text-to-speech snippet in the README called response.stream.getvalue(), but client.speak.v1.audio.generate() returns an Iterator[bytes], so running it as written raises AttributeError: 'generator' object has no attribute 'stream'. I changed the snippet to iterate the response and write each chunk, and applied the same correction to the identical snippet in the v3 to v5 migration guide. Fixes #638.

I pushed this to my fork first and the project's own CI workflows pass on the commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs]: AttributeError: 'generator' object has no attribute 'stream' in readme snippet

1 participant