John Salerno wrote:
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
On Sun, 15 Jun 2008 22:53:19 -0400, John Salerno
<[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
Even the simplest format -> WAV, which is normally uncompressed
audio samples, is wrapped in layers of informational packets.

snip other stuff!!!

Yikes! Then what I'm reading from your post (and others) is no, I can't do it my way. ;) It *did* seem a little too easy, after all!


I can't speak for video (and I'd imagine it's a factor more difficult) but it's really not that hard to concatenate audio in python. What you need to do...

Import the right modules for the audio formats you want to read.
Decide on a master output format, say CD quality - PCM 16bit 44.1Khz Stereo.
Open a file for appending
Read through each of your source files loading them into memory
  Get the sample rate and format
Run the sample data through a function to convert it to the master output format*
  Squirt it to disk

Finally take the resulting file, calculate a new header and munge the two together. Voila :)


*I'm sure several modules have functions/methods for this but it wouldn't be very hard to roll your own either.


Roger Heathcote

http://www.technicalbloke.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to