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!
Graph Audio Waveform
-
Froggerprogger
- Enthusiast

- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
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. 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
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
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
I suggest you the Froggerpropper's answer + read this
Re: Graph Audio Waveform
No equivalent.Xombie wrote:I'm using a control from NCT in a vb app currently but wondered if there was a PB equivalent.
Could be 2 solutions:
1.- Try to call NCT from PureBasic
2.- Do all the functions by yourself
ARGENTINA WORLD CHAMPION
an attempt to display the captured wave audio :
viewtopic.php?t=7009&start=0&postdays=0 ... ord%20wave
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
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
-
zapman*
- Enthusiast

- Posts: 115
- Joined: Wed Jun 02, 2004 10:17 pm
- Location: New Caledonia (South Pacific)
- Contact:
Here is a complete program for editing and zooming sounds :
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip
Don't try - DO it !
Click on the "this" word from my post, you ll surely like itzapman* wrote:Here is a complete program for editing and zooming sounds :
http://heisspiter.no-ip.com/~zapman/SoundEditor.zip

