Page 1 of 1
Graph Audio Waveform
Posted: Thu Jul 01, 2004 2:53 am
by Xombie
Howdy,
First time poster here. I've played around a little with the demo and am considering purchasing PureBasic. I'm a VB 6 developer (probably like a few people here).
My question is this - is there any libraries/codes/whatever to read in compressed/uncompressed wavs, mp3s and/or oggs, graph the waveform and then allow for zooming, scaling, scrolling & selection on the waveform? I'm using a control from NCT in a vb app currently but wondered if there was a PB equivalent.
Thanks!
Posted: Thu Jul 01, 2004 10:04 am
by Froggerprogger
I never heard of such a library, so I think you have to do it on your own:
1. To get uncompressed WAV-Data you might use the following functions:
viewtopic.php?p=61922#61922
2. For Mp3/Ogg, etc. I would use fmod (could be a bit tricky). Or perhaps the Lame-encoder can decode, too ?
Using this would decode the material into uncompressed data (normally 16 Bit, 44.1kHz stereo)
3. The uncompressed material is easy to read. For 16 Bit stereo e.g. it is one signed Word for left, followed by one for right and so on. (44100 Samples on each channel per second)
More information on the Wav-format here:
http://www.sonicspot.com/guide/wavefiles.html
4. The displaying shouldn't be soooo hard. Just read in the needed samplevalues (in range -32768 upto 32767 at 16 bit) and display them.
For Big zoomfactor you can easily stretch the values, for small zoomfactors you might use the average of 10-100 samples around the exact position as value.
Posted: Fri Jul 02, 2004 12:43 am
by TIGER
I think very few languages have this bulid in function.
You have to know the file format. And must know
hot to work with waveforms.
The easier file format is a WAV (desame as BMP for images)
You can get the format description on
http://www.wotsit.org/default.asp
Posted: Sat Jul 03, 2004 9:55 pm
by KarLKoX
I suggest you the Froggerpropper's answer + read
this
Re: Graph Audio Waveform
Posted: Sun Jul 04, 2004 12:25 am
by ricardo
Xombie wrote:I'm using a control from NCT in a vb app currently but wondered if there was a PB equivalent.
No equivalent.
Could be 2 solutions:
1.- Try to call NCT from PureBasic
2.- Do all the functions by yourself
Posted: Mon Jul 05, 2004 9:39 pm
by Flype
Posted: Tue Jul 06, 2004 12:36 am
by zapman*
Here is a complete program for editing and zooming sounds :
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip
Posted: Tue Jul 06, 2004 2:02 am
by KarLKoX
Click on the "this" word from my post, you ll surely like it

Posted: Thu Jul 08, 2004 8:52 pm
by Xombie
Oh wow! Great stuff ^_^ I completely missed on these posts. I'm on my lunchbreak now but I'll definitely check all of this out tonight. Thank you all very much. I'm learning how great PB can be
And I did end up ordering the full version ^_^
Posted: Sat Jul 24, 2004 8:12 am
by zapman*
Merci KarlKox
I did'nt get any feedback from you, and I wish !