0

The output of the file is unchanged from the source.

I expect the following to mute the audio for a length of one second at two seconds into the audio file.

Python version: 3.7

from pydub import AudioSegment

audio_file = "input_audio.mp3"

# Load audio file into pydub
audio = AudioSegment.from_mp3(audio_file)

# place one second of silence two seconds in to mute that portion
audio = audio.overlay(AudioSegment.silent(duration=1000, frame_rate=audio.frame_rate), position=2000)

# Save audio with word muted to new file
audio.export("output audio.mp3", format="mp3")```
ballade4op52
  • 2,142
  • 5
  • 27
  • 42

0 Answers0