Loading raw sounds

Blitz3D Forums/Blitz3D Beginners Area/Loading raw sounds

Oso(Posted 2004) [#1]
The manual says that "raw" sounds will load. So far I cannot get just any old data to load as a sound. I've been experimenting with mathematically written raw samples but can't get any to load (i.e. returns zero for sound handle). What does the manual mean exactly (under "Loadsound") when it says it accepts "raw" format ? Does even raw data need a header or file type of some sort to be recognised as a sound by BlitzPlus ? I've had no trouble with wav, mp3 etc.


jfk EO-11110(Posted 2004) [#2]
Argh - I know we have discussed before somewhere. Maybe there are several RAW formats. Personally I would use a WAV header. It isn't that hard to make it work, I remember I did this some time ago. Seek for the WAV Header description in the web, probably you'll find it on www.wotsit.org , and there you go.


Oso(Posted 2004) [#3]
Thanks. Okay, it's always vaguely reassuring when something doesn't work for somebody else too. I found a wav header function someone posted so I'll just have to get to grips with it one way or another. I'd still like to know what the manual means though.


jfk EO-11110(Posted 2004) [#4]
There are many, many WAV Formats behind this extension - don't waste too much time. I'd use uncompressed simple PCM Samples.

This one is pretty clear: http://www.wotsit.org/download.asp?f=wav

After a quick look at the structure of the header chunks scroll right down to "Examples of PCM WAVE Files".

EDIT: Ah, ok. Well, wasn't there an Amiga RAW Format?


Oso(Posted 2004) [#5]
I should remember that, I did so much Amiga programming, but I can't - I don't think so. I think most Amiga things like MED just used to assume "raw" meant a string of bytes (-127 to 128) and played it. I have downloaded that file and shall study it. Thanks again.


Oso(Posted 2004) [#6]
jfk:

Just sussed it out ! Generated and played a wav file ! As with most programming things, it's getting it to work the first time. Once you know something CAN work the rest is detail. Thanks for your help in this matter.


sswift(Posted 2004) [#7]
There is a code archive function for saving wav file headers to which you can append sound data I'm pretty sure. If not there, then there is definitely a post on the forum about it. I used this technique in my Pong game in the little "no-prize" contest where we weren't allowed to have "external" data.


Oso(Posted 2004) [#8]
Thanks sswift. Yes, I found that too, which was a big help.