Open inoftrobinson opened 3 years ago
audio_block_1 = AudioBlock()
track_voice = audio_block_1.create_track(primary=True, loop=False)
voice_sound = track_voice.create_sound(local_filepath=PollyClient().synthesize(
text="Je suis un test d'audio dynamique ?",
voice_id=VOICES.French_France_Female_CELINE.id,
filepath_to_save_to="F:/Sons utiles/test_synthesised_dialogue.mp3"
), custom_key="voice", player_start=track_voice.start_time)
rifle_shots = track_voice.create_sound(
local_filepath="F:/Sons utiles/Sound Effects/Guns/Automatic/238916__qubodup__rifle-shooting.flac",
player_start=voice_sound.player_end_time + 20, player_end_time=voice_sound.player_end_time + 40
)
background_music_track = audio_block_1.create_track(primary=True)
background_music = background_music_track.create_sound(
local_filepath="F:/Sons utiles/Musics/Vintage (1940s) French Music/CHANSON FRANCAISE 1930-1940 (192 kbps).mp3",
player_start=background_music_track.start_time
)
background_music.change_volume(-1.0)
self.user_data.load(['player_name'])
audio_block_1 = AudioBlock()
track_1 = audio_block_1.create_track()
track_1.create_speech("Hello my dear friend, how are you ?", voice=VOICES.Joanna)
# Basic speech
track_1.create_speech(f"Do not let her disturb you {self.user_data.get('player_name')}, let's make cookies", voice=VOICES.Mathieu)
# Dynamic speech with user data preload (will raise if player_name not found, because no default value has been precised
Deprecate the self.say function, and turn the speech to a simple Speech to text json response, if there is no particular audio modiifications or displacement, and if the requested voice/voices are available to use natively on the target platform (Google Assistant, Alexa, etc)