Advertisement
Guest User

Untitled

a guest
Apr 24th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import wave
  2. import subprocess
  3. import os
  4. import signal
  5.  
  6. filename = "/home/icarus/git/MusicaLight/ACDC_-_Back_In_Black-sample.ogg"
  7. #filename = "/home/icarus/git/MusicaLight/Example.ogg"
  8. command = ["ffmpeg", "-hide_banner", "-loglevel", "panic", "-i", filename, "-f", "wav", "-"]
  9. converter = subprocess.Popen(command, stdout=subprocess.PIPE, preexec_fn=os.setsid)
  10. wav = wave.open(converter.stdout, 'r')
  11.  
  12. wav.getparams() # outs (nchannels, sampwidth, framerate, nframes, comptype, compname)
  13.  
  14.  
  15. This little script outputs this:(2, 2, 44100, 1073741823, 'NONE', 'not compressed')
  16.  
  17. 1073741823 = over 6 hours of "data". for a 25 second clip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement