deepgram-python-sdk icon indicating copy to clipboard operation
deepgram-python-sdk copied to clipboard

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

Open AlvaroBalbin opened this issue 4 months ago • 0 comments

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.

AlvaroBalbin avatar Jul 29 '26 00:07 AlvaroBalbin