Why does Blitzmax fail to load in some wav files?

BlitzMax Forums/BlitzMax Programming/Why does Blitzmax fail to load in some wav files?

Grey Alien(Posted 2009) [#1]
OOPS! Totally wrong forum, sorry. Mods please move to BlitzMax Programming forum. Thanks.

Anyone ever found that some wav files don't load into BlitzMax via LoadSound? I often get wav files from Somatone (they make BFG sounds) and other sources which will not load (they are 44KHz 16 bit stereo and other formats too). Yet if I load the sound into Audacity and save it out in the same format it works fine! (saving again in Creative Wave Studio doesn't fix the problem for some reason).

There must be some kind of special header in the ones that don't work. Has anyone noticed this before or got any workarounds (or is a BRL fix in the pipeline) as it's a tad frustrating? Thanks!


GfK(Posted 2009) [#2]
Never come across it, but I always use OGG format anyway.


Brucey(Posted 2009) [#3]
Maybe it's a compressed wav?


REDi(Posted 2009) [#4]
Could you post an example wav file?

AFIAK BlitzMax only supports standard wav files containing PCM data, but wav files can actually contain compressed audio data (mp3 or whatever).

http://en.wikipedia.org/wiki/Wav


Grey Alien(Posted 2009) [#5]
Example: http://www.greyaliengames.com/misc/badwav.wav


ziggy(Posted 2009) [#6]
there are two kind of wav files: PCM and ADPCM. ADPCM is not very common, and not supported by BlitzMax (last time I tried it about two years ago).


Brucey(Posted 2009) [#7]
Looking at the header in my text editor ... :-p ... it's one of these :

http://www.afterdawn.com/glossary/terms/riff-wav.cfm


plash(Posted 2009) [#8]
Well that is just a really dumb format!


Grey Alien(Posted 2009) [#9]
Well I never knew that. Some BMax support would be nice but does it need an MP3 license or some such then?


fischer(Posted 2009) [#10]
For the record I had some problems with wav files I was getting out of online sound archives. I use audacity too, and ultimately I found the problem to be one of the PCM variations I was using. (It was something Iphone liked. and I had used on a previous project.) Changed it to 16 bit pcm and haven't had any problems since.
Following up on this thread:
What is the best compression algorithm I could use that BLitzmax supports?
Beuler....
Beuler....


Ginger Tea(Posted 2009) [#11]
afaik max only supports wav (vanilla style) and ogg
(mp3 has all the patent royalties malarky so not 'officially' supported)
so erm ogg i guess


Muttley(Posted 2009) [#12]
ogg is sonically far superior to mp3 at low bitrates anyway, so I'd generally go that way for compressed audio anyway.


Gabriel(Posted 2009) [#13]
Well I never knew that. Some BMax support would be nice but does it need an MP3 license or some such then?

Yes, but because the license is pervasive, so (arguably) would everyone who released a BlitzMax program with sound support. So I suspect it has been intentionally ignored for the same reason that none of the BRL modules use any GPL or LGPL code: to prevent an additional burden being passed on to users.


Grey Alien(Posted 2009) [#14]
Yeah I'm fine with that as I use oggs generally but sometimes I want to just test out a wav that I've been sent without coverting to an off first.


GaryV(Posted 2009) [#15]
but sometimes I want to just test out a wav that I've been sent without coverting to an off first.
The problem is you are NOT trying to do that are you? You are trying to use an MP3 compressed WAV file not a stsandard WAV file.