Error loading .wav files

17 views
Skip to first unread message

Marco Mazzu

unread,
Dec 18, 2012, 4:52:50 AM12/18/12
to gam...@googlegroups.com
Hi,
I'm having an issue loading some music files in .wav codec.
I just write
gamejs.preload(['resources/sounds/music1.wav']);
gamejs.ready(main);
but it give "Uncaught Error: Error loading ..."

Should I use another type of file? Or what do i miss?
I read in the doc that wav is supported.
Thanks!

si...@nekapuzer.at

unread,
Dec 18, 2012, 5:33:51 AM12/18/12
to gam...@googlegroups.com
hi,
can you give us the full error message :)

it should work; what happens if you comment out the preload() line?

simon
Message has been deleted

Marco Mazzu

unread,
Dec 18, 2012, 6:31:16 AM12/18/12
to gam...@googlegroups.com
My answer Has been deleted...
The full errors are
Uncaught Error: Error loading music_path
If I comment the preload line I have
Uncaught Error: Missing "resources/sounds/laser0.wav", gamejs.preload() all audio files before loading

Can it be a file problem?

si...@nekapuzer.at

unread,
Dec 18, 2012, 6:35:31 AM12/18/12
to gam...@googlegroups.com
weird. if you check the network tab in inspector/firebug - does it try to load the file from the right URL?

It should load the file even if it's not a proper wav file.

simon

On Tue, Dec 18, 2012 at 03:31:16AM -0800, Marco Mazzu wrote:
> My answer Has been deleted...
> The full errors are
> Uncaught Error: Error loading music_path
> If I comment the preload line I have
> Uncaught Error: Missing "resources/sounds/laser0.wav", gamejs.preload() all
> audio files before loading
>
> Can it be a file problem?
>

Marco Mazzu

unread,
Dec 18, 2012, 6:52:47 AM12/18/12
to gam...@googlegroups.com
I fixed it by split the preload() line: a preload for the images and a preload for sounds...
Now it seems to work!
Thanks for the help Simon :)
Reply all
Reply to author
Forward
0 new messages