Legacy GM Problem (?) with audio_create_buffer_sound

U

Untouch

Guest
Not sure if this has something to do with the sound I'm using, or if this is an issue with GM.

I'm using audio_create_buffer_sound to load in .wav files for my game. It's working fine except in one case, about half the files are totally corrupt and are outputted as screeching sounds when I do it this way.
It appears that what's causing this is having metadata in the .wav files after the data chunk, if theres data after this, the files won't work, otherwise they'll be totally fine.
I can find out if this is the case dynamically using GM, but its preventing me from using many files.
I tried simply using the information in the data chunk, but it's just not even letting me (even though files without metadata work fine).

I can't find anyone else having this issue so It makes me think it's a fairly new glitch.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I would think that it's possibly an issue that's been there from the start as I don't think many people load audio in this way as it's not terribly efficient. YYG do suggest that all audio be bundled with the game in the resource tree rather than loaded externally... What I would do though is file a bug report and include a demo GMZ that shows the issue for them to look at. Oh, and you can strip the metadata from a file yourself or use one of the many programs that can it do for you then use the files in the meantime.
 
U

Untouch

Guest
Unfortunately I'm using it for my modding system, to be able to load in external sounds.
It appears not to be the metadata, it there are chunks after the data chunk it doesn't seem to work. (opening it up in audacity and resaving gets rid of the chunks).
I'll send a bug report for now.
 

FrostyCat

Redemption Seeker
For anyone who understands the WAV format, this is 100% expected behaviour.

The Manual entry for audio buffers clearly specify that they take pure PCM input:
The Manual said:
Note that the buffer used to load the audio can only support PCM sounds, so formats like OGG will not be supported.
While the main body of standard WAV files is PCM data by definition, a lot of other stuff associated with the format isn't. Its header is not PCM data, RIFF metadata such as ID3 tags are not PCM data, proprietary codecs are not PCM data.

If you are going to be using Audacity, export the sound as unsigned 8-bit or signed 16-bit RAW. When you select "Export", select "Other Uncompressed Format", then click "Options", then select "RAW (header-less)" as the header and "Unsigned 8-bit" or "Signed 16-bit" as encoding. If you want to convert in batches, import all your sounds as individual tracks, then select "Export Multiple" instead of "Export" and use the same options as above.

Feel free to report WAV file loading as a desired feature, but definitely not as a bug.
 
Top