RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

[enhancement]: Fixed the background audio and audio volume

Open ayoub648 opened this issue 3 years ago • 1 comments

Summary

Fixed the background audio and audio volume

Is your feature request related to a problem?

yes, the code is commented in final_video.py line 136

Describe the solution you'd like

You need to do 3 steps: Step1: go to .config.template.toml and remove # infront of both background_audio and background_audio_volume

step2: go to config.toml if it's already generated for you and add background_audio = true and background_audio_volume = 0.1 under background_choice

step3: go to final_video.py in the top code add from moviepy.audio.fx.all import volumex and then go to line 136 and add this code:

   if settings.config["settings"]['background']["background_audio"] and exists(f"assets/backgrounds/background.mp3"):

         audioclip = AudioFileClip(f"assets/backgrounds/background.mp3").set_duration(final.duration)
         audio_volume = settings.config["settings"]['background']["background_audio_volume"]
         final.audio = CompositeAudioClip([volumex(audioclip,audio_volume),final.audio])

Describe alternatives you've considered

No response

Additional Context

No response

ayoub648 avatar Aug 25 '22 15:08 ayoub648

I think you should make a pull request of this, then it can be implementet more easily in a new version of the bot.

CJthisis avatar Aug 26 '22 06:08 CJthisis