Skip to content

Instantly share code, notes, and snippets.

@monirehbastami
Last active October 21, 2024 11:38
Show Gist options
  • Select an option

  • Save monirehbastami/d28430496d504b1a9fb032968608e073 to your computer and use it in GitHub Desktop.

Select an option

Save monirehbastami/d28430496d504b1a9fb032968608e073 to your computer and use it in GitHub Desktop.
SoundStripper: a simple python code for extracting audio from video
import subprocess
def sound_stripper(video_file):
audio_file = "audio.wav"
ffmpeg_path = r'C:\FFmpeg\bin\ffmpeg.exe'
command = [
ffmpeg_path,
'-i', video_file,
'-ar', '16000',
'-ac', '1',
'-b:a', '256k',
audio_file
]
subprocess.run(command)
video_file_path = "E:\\Python Projects\\Stripper\\DarkWeb.mp4"
sound_stripper(video_file_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment