sitcom_simulator.music.music_generator

Functions

add_music(script[, engine, music_url, ...])

Given a script, returns the same script but with the music path filled in.

generate_music(category[, engine, music_url])

Generates and returns a path to a music file using the given engine.

sitcom_simulator.music.music_generator.generate_music(category, engine='freepd', music_url=None)

Generates and returns a path to a music file using the given engine.

More procedural in nature than add_music.

Parameters:
  • category (str | None) – The category of music to generate

  • engine (Literal['freepd']) – The engine to use for generating music

  • music_url (str | None) – The URL of the music to use. If provided, category is ignored.

Return type:

tuple[str, str]

Returns:

The path to the generated music file and the url of the music to use

sitcom_simulator.music.music_generator.add_music(script, engine='freepd', music_url=None, on_music_generated=None)

Given a script, returns the same script but with the music path filled in.

More functional in nature than generate_music.

Parameters:
  • script (Script) – The script to add music to

  • engine (Literal['freepd']) – The engine to use for generating music

  • music_url (str | None) – The URL of the music to use. If provided, category is ignored.

  • on_music_generated (Optional[Callable[[str], None]]) – A callback to call after the music is generated which takes the path to the generated music