Last active
October 21, 2024 11:38
-
-
Save monirehbastami/d28430496d504b1a9fb032968608e073 to your computer and use it in GitHub Desktop.
SoundStripper: a simple python code for extracting audio from video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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