Page 1 of 1

Invalid WAV headers?

Posted: 02 Jul 2018, 01:11
by dosaki
Hi everyone!

I'm new with springrts and I've been trying to follow this tutorial on the wiki.

I'm using Spring version (version 104.0) for Windows.
I'm trying it out via SpringLobby (version 0.264).

Now my problem is with the sound bit.
I've used the same sound as the author does but I am getting the following error:
Image

Transcript:

Code: Select all

[Sound] Error: ReadWAV: invalid header: sounds/shoot.wav
[Sound] Warning: [LoadSoundBuffer] failed to load file "sounds/shoot.wav"
The file in questions can be found here.

I made sure the file is mono, 44kHz and is in 16-bit PCM when I exported it with Audacity.


Does anyone know what specific settings should I be using? I haven't found much info about this.

Thanks in advance.


EDIT: bit more info
I got some audio files from an existing game, dropped it on mine and it still happens.

Re: Invalid WAV headers?

Posted: 03 Jul 2018, 22:50
by dosaki
Update: I just used OGG and it all started working.

Re: Invalid WAV headers?

Posted: 04 Jul 2018, 18:55
by abma
i'm not familar with spring + sound / wave, but i'll try to help:

the file you provided for download is mono, 16 bit and 16kHz with codec PCM S16LE (s16l)


This is where the error happens:
https://github.com/spring/spring/blob/5 ... er.cpp#L71


when looking at the code and your file for me it looks like the wrong file is loaded:

Explosi3.wav vs. shoot.wav

the file shoot.wav is stored in the wrong format: it should be RIFF-Wave + PCM. did you provide the correct file which causes the error for download?

Re: Invalid WAV headers?

Posted: 04 Jul 2018, 19:32
by dosaki
Hi!

I looked into the source code too to see if there was any clue in there.
Sorry I should have mentioned that I am loading both Explosi3.wab and shoot.wav and they both have the same error.

This was my code before I swapped the files to ogg:

Code: Select all

    --WEAPONS
    orangeblob_explo = {
      file = "sounds/Explosi3.wav"
    },
    tankfire = {
      file = "sounds/shoot.wav"
    }
This is the shoot file: shoot.wav.