def add_background_audio(audio_clip):
    """
    :param audio_clip: 최종 영상 오디오 클립
    :return: 배경음 삽입된 오디오 클립
    """

    # Access audio file
    back_audio = AudioFileClip(settings.BASE_DIR + '/core/back_audios/' + get_selected_music() + '.wav')

    # New audio file
    new_audio_clip = CompositeAudioClip([audio_clip.fx(volumex, 7), back_audio.fx(volumex, 1)])

    return new_audio_clip
Exemple #2
0
def fade(wav_url):
    audio = AudioFileClip(wav_url)

    new_audio = audio.fx(afx.audio_fadein, 0.1).fx(afx.audio_fadeout, 0.1)
    new_audio.write_audiofile(wav_url + "_faded_0.1.wav")