Skip to content

Stop running after done generating #39

@fakerybakery

Description

@fakerybakery

Hi,
I'm using this code:

with open(f'{x}.wav', 'wb') as f:
    for chunk in client.tts("Can you tell me your account email or, ah your phone number?", options):
        if not chunk:
            break
        print(type(chunk))
        f.write(chunk)

However it does not terminate the script after the audio has finished generating, how can I detect when the audio is done generating and stop?
Thank you!

cc @NCarrollPlay @mahmoudfelfel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions