Re: Combining sound files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tedd wrote:
> I'm not sure I can or need to run exec, nor do I actually know how. I'll
> deal with that later in my life.

Go on, it's easy!

http://uk2.php.net/manual/en/function.exec.php

That said, depending on your hosting, you may be banned from exec.


> For the moment, I can use a HEX Editor and inspect the first 256 bytes
> of a wav file and find out all the goodies therein, but do you know if I
> strip out the first 256 bytes can I then combine the files so they will
> work (providing the sample rates, frequencies, and such as the same)?

No need for a hex editor...

1) Take all your .wav files and use sox on command line (or another tool
if you prefer) to convert them all to RAW PCM files (e.g. no header).

2) Take the filesize of the WAV and subtract the filesize of the RAW
PCM. The value you have left is the size of the WAV header, so take the
first n bytes of one of your WAVs and save it to e.g. "wav.hdr". Double
check with your hex editor as I'm not 100% sure about this (OK, you do
need it after all :p)

3) In theory to create the full wav you just concatenate the wav.hdr +
the correct combination of your letters/numbers RAW PCM files.

4) You should be left with a proper, valid .wav file (I think).

Not really sure of the above but I think it's all true!!

Take care.

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux