generated from deepgram/oss-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Affected page or section
readme.md
What is unclear or wrong?
AttributeError: 'generator' object has no attribute 'stream' in
from deepgram import DeepgramClient
client = DeepgramClient(api_key = "my key")
response = client.speak.v1.audio.generate(
text="Hello, this is a sample text to speech conversion."
)
# Save the audio file
with open("output.mp3", "wb") as audio_file:
audio_file.write(response.stream.getvalue())
^^^^^^
Suggested change
from deepgram import DeepgramClient
client = DeepgramClient(api_key = "secret stuff")
response = client.speak.v1.audio.generate(
text="Hello, this is a sample text to speech conversion."
)
# Save the audio file
with open("output.mp3", "wb") as audio_file:
for a in response:
audio_file.write(a)Example code (if any)
SDK parity (if relevant)
- This change may need updates in other SDKs
Session ID (optional)
No response
Project ID (optional)
No response
Request ID (optional)
No response
alpsilvacoderabbitai
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation