Access audio data

Blitz3D Forums/Blitz3D Programming/Access audio data

Physt(Posted 2005) [#1]
Is is possible in Blitz3D to load a 16 bit wave file and get access to the raw data so I can write the values to a text file?

Thanks,
Ken


big10p(Posted 2005) [#2]
You can open a .wav file in blitz just as you can with any other file, and read the values from it byte-by-byte, if you want.


KuRiX(Posted 2005) [#3]
I think he is talking about some more automatic, because if you open it with just file access functions you need to parse the chunk data, etc...


big10p(Posted 2005) [#4]
I see. Well, I'm not familiar with the format of a wav file but I can't image parsing it to access the raw data would be too difficult.


Physt(Posted 2005) [#5]
I don't want to have to write everything it takes to decode all the variations of wave files. You are correct KuRiX, I don't want to parse the file.

Not to worry. I've got it mostly written in C with LCC and BASS. :)


KuRiX(Posted 2005) [#6]
I am sure there must be lot of dll's doing this for you!


Damien Sturdy(Posted 2005) [#7]
I don't want to have to write everything it takes to decode all the variations of wave files. You are correct KuRiX, I don't want to parse the file.


It's not all that hard for your standard uncompressed (PCM) WAV file. A good exersize if you ask me :)

Bass is a good choice. its not free though.


Physt(Posted 2005) [#8]
I have it working with BASS.

PCM isn't hard but Microsoft's implementation of the WAV format is full of inconsistancies. Trust me, to handle WAV correctly, even for just PCM encoding, it's not trivial.

BASS is free for what I want to do. I just need to take some wave files and convert them to include files.


Damien Sturdy(Posted 2005) [#9]

PCM isn't hard but Microsoft's implementation of the WAV format is full of inconsistancies. Trust me, to handle WAV correctly, even for just PCM encoding, it's not trivial.



If you follow that specification and its fine. :P trust me, ive done it, several times over :)

Hardest part was the LSB/MSB order of the bytes :)

Good that you got it working with BASS. Whats it for BTW?


Physt(Posted 2005) [#10]
I'd rather work with BASS than write it from scratch. I wrote a wav reader awhile ago but didn't implement the full spec and it was pretty much worthless except for a small set of files.

I run www.speechchips.com and I'm working on an embedded speech synthesizer. I need to convert PCM to another ultracompressed format (600 bytes per second).