Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wave
- import subprocess
- import os
- import signal
- filename = "/home/icarus/git/MusicaLight/ACDC_-_Back_In_Black-sample.ogg"
- #filename = "/home/icarus/git/MusicaLight/Example.ogg"
- command = ["ffmpeg", "-hide_banner", "-loglevel", "panic", "-i", filename, "-f", "wav", "-"]
- converter = subprocess.Popen(command, stdout=subprocess.PIPE, preexec_fn=os.setsid)
- wav = wave.open(converter.stdout, 'r')
- wav.getparams() # outs (nchannels, sampwidth, framerate, nframes, comptype, compname)
- This little script outputs this:(2, 2, 44100, 1073741823, 'NONE', 'not compressed')
- 1073741823 = over 6 hours of "data". for a 25 second clip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement