sitcom_simulator.speech.speech_generator¶
Functions
|
Given a script, returns the same script but with the audio paths filled in. |
|
Generates and returns a list of voice clip paths for the given script using the given engine. |
- sitcom_simulator.speech.speech_generator.generate_voices(script, engine='fakeyou', on_voice_downloaded=None, fakeyou_on_voice_url_generated=None, fakeyou_job_delay=30, fakeyou_poll_delay=10)¶
Generates and returns a list of voice clip paths for the given script using the given engine.
More procedural in nature than add_voices. This function is typically not used directly, since add_voices is more pleasant to work with.
- Parameters:
script (
Script
) – The script to generate voice clips forengine (
Literal
['fakeyou'
,'gtts'
]) – The engine to use for generating voice clipson_voice_downloaded (
Optional
[Callable
[[int
,str
],None
]]) – A callback to call after each voice clip is downloaded which takes the clip index and path to the downloaded audiofakeyou_on_voice_url_generated (
Optional
[Callable
[[int
,str
],None
]]) – A callback to call after each FakeYou voice clip is generated which takes the clip index and url of the generated audiofakeyou_job_delay (
int
) – The number of seconds to wait between starting audio generation jobs. Lower values render faster but are more likely to get rate limitedfakeyou_poll_delay (
int
) – The number of seconds to wait between polling for audio generation job completion
- sitcom_simulator.speech.speech_generator.add_voices(script, engine='fakeyou', on_voice_generated=None, fakeyou_job_delay=30, fakeyou_poll_delay=10)¶
Given a script, returns the same script but with the audio paths filled in.
More functional in nature than generate_voices.
- Parameters:
script (
Script
) – The script to add voices toengine (
Literal
['fakeyou'
,'gtts'
]) – The engine to use for generating voice clipson_voice_generated (
Optional
[Callable
[[int
,str
],None
]]) – A callback to call after each voice clip is generated which takes the clip index and path to the generated audiofakeyou_job_delay (
int
) – The number of seconds to wait between starting audio generation jobs. Lower values render faster but are more likely to get rate limited. (FakeYou only)fakeyou_poll_delay (
int
) – The number of seconds to wait between polling for audio generation job completion. (FakeYou only)