[linux-audio-user] AIFF files batch-slicing

Frank Barknecht fbar at footils.org
Sat Jul 3 19:17:19 EDT 2004


Hallo,
Christian Frisson hat gesagt: // Christian Frisson wrote:

> I need to automate a process for slicing audio files in AIFF format on multiple
> files everytime perfect silences are met (zero-amplitude). This should be
> multiplatform (Linux/Mac/Win) and minimal (no GUI, only command-lines: one
> should just have to launch the script / program). 
... 
> Any idea?

Puh, the cross-platform part is hard. 

I'd suggest "pydoc wave" here, if you're into Python. 

  $ python
  Python 2.3.3 (#2, Feb 24 2004, 09:29:20) 
  [GCC 3.3.3 (Debian)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import wave
  >>> file="/tmp/hmmbaby.wav"
  >>> f = wave.open(file, 'r')
  >>> f.getnchannels()
  2
  >>> f.getframerate()
  44100
  >>> f.readframes(2)
  '\xdd\xe9\xe8\xe2$\xeb"\xe4'
  >>> f.readframes(1)
  '\x00\x00\x00\x00'
  >>> f.close()
 
The last frame read was silence.

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__



More information about the Linux-audio-user mailing list