Cow
Joined: 23 Jun 2007 Posts: 2
|
Posted: Sat Jun 23, 2007 3:55 pm Post subject: Reading a WAV/MP3 file in order to draw an oscilloscope ? |
|
|
Hi guys,
I'm actually trying to update my Flash jukebox script and I'd like to have a very simple 'oscilloscope' of the playing mp3 file... I discovered yesterday how to read a wave file but I haven't really understood how to draw an oscillope (I read the file with PHP... not really as fast as Wavosaur, but it works ).
First, I'd like to know if I'm reading it correcty, if anyone could help me :
- I read the header (works fine)
- Then each 2 octets of the data chunk (assuming I'm working on a 16bit mono file): 0x[O1][O2] => correct value is : 0x[O2][O1]
- I finally convert my hex value to dec, which gives me a number between 0 and 65 535.
Well, I read it should be a signed integer but in that case I always get negative values...
Am I correctly analyzing it ?
Finally, since my jukebox only plays mp3 files, could you give me a hint to read directly mp3 files ? I actually have to use your (wonderful) program to convert my mp3 files in wave in order to analyze them with my script... Tooks me quite a lot of time, yes :p
By the way, thanks a lot for your audio editor... quite nice, fast and above all, it's free :>
P.S. : I'm from Switzerland (french, not german if you were wondering), sorry about my english mistakes |
|
Cow
Joined: 23 Jun 2007 Posts: 2
|
Posted: Sat Jun 23, 2007 4:09 pm Post subject: |
|
|
Rex wrote: | Hi cow ! welcome to the forum.
If you know french you can post in the french section of the forum |
Thanks, it just seems that the english section is more populated
Quote: | when the main developer will connect i'l sure he'll find some hints for you about the wav header ! |
Er, rather about the data chunk, I got no problem with the wav header |
|