Re: Combining sound files

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

 



At 5:28 PM -0600 2/27/07, Richard Lynch wrote:
On Sun, February 25, 2007 9:22 am, tedd wrote:

 > However, I can't do the same with .WAV files. Does anyone know a way
 to combine .WAV files similar to the way shown above?

The first 256 bytes of a .WAV file contains magic numbers indicating
the bit-size (16-bit, 8-bit, whatever) and sampling rate (44.1 kHz,
22.05 kHz, 96kHz, etc) and imaging (stereo, mono, and I think maybe
others) as well as the total number of samples (I.e., file length).

There are also some slots for things like copyright, comments etc, as
I recall.

You're going to have to find specs on that header info, read the first
256 bytes of each file, compute new numbers to put into the .wav
header, and write out the new 256 bytes and then the remainders of the
two files.

If the two files are NOT both the same bit/sample rate, then you'd
have some REAL fun trying to scale/re-sample the actual audio... :-)

You may find it easier/faster to just locate a .wav splicer command
line tool and run exec with it.  Though perhaps not nearly as fun,
depending on your definition of fun.

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.

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)?

Thanks for your help.

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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