Graph Audio Waveform

Just starting out? Need help? Post your questions and find answers here.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Graph Audio Waveform

Post 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!
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post 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.
%1>>1+1*1/1-1!1|1&1<<$1=1
TIGER
User
User
Posts: 81
Joined: Mon Feb 23, 2004 8:33 pm

Post 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
PIII450 128RAM TNT2
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

I suggest you the Froggerpropper's answer + read this
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Graph Audio Waveform

Post 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
ARGENTINA WORLD CHAMPION
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

an attempt to display the captured wave audio :

viewtopic.php?t=7009&start=0&postdays=0 ... ord%20wave
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
zapman*
Enthusiast
Enthusiast
Posts: 115
Joined: Wed Jun 02, 2004 10:17 pm
Location: New Caledonia (South Pacific)
Contact:

Post by zapman* »

Here is a complete program for editing and zooming sounds :
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip
Don't try - DO it !
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

zapman* wrote:Here is a complete program for editing and zooming sounds :
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip
Click on the "this" word from my post, you ll surely like it :lol:
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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 ^_^
zapman*
Enthusiast
Enthusiast
Posts: 115
Joined: Wed Jun 02, 2004 10:17 pm
Location: New Caledonia (South Pacific)
Contact:

Post by zapman* »

Merci KarlKox :D

I did'nt get any feedback from you, and I wish !
Don't try - DO it !
Post Reply