Jump to content


Photo

Problems with externally loading sounds


  • Please log in to reply
1 reply to this topic

#1 GameRoom

GameRoom

    GMC Member

  • GMC Member
  • 675 posts
  • Version:GM:Studio

Posted 30 July 2012 - 05:27 PM

I've been trying to use asynchronous loading to load sounds in my game, but for some reason the sounds never load. I've gotten it to work on a blank gmx made just for testing, but when it's implemented in my game it doesn't work, even with the exact same code.

Here is the object that loads all the music.
//Create:
var extension;
if os_browser=browser_firefox or os_browser=browser_opera extension=".ogg"
else extension=".mp3"
sound_add(mFile+extension,1,1)

//Sound Loaded:
music=ds_map_find_value(async_load,"id")
sound_loop(music)
instance_activate_all()
instance_destroy()

It should work, but it hangs at the loading screen. I noticed that when I could get it to work in my other gmx, it showed the message "SoundSuspended: <File>" while in my game it didn't. This means that the sound didn't load at all for some reason. I tested it in Firefox and Chrome. Here is the source code so you can test it.

Edited by GameRoom, 02 August 2012 - 12:17 AM.

  • 0

#2 GameRoom

GameRoom

    GMC Member

  • GMC Member
  • 675 posts
  • Version:GM:Studio

Posted 02 August 2012 - 12:17 AM

I've been doing some more testing, and I think the files may be corrupted. I exported the game, played the songs from the html5game folder in Windows Media Player, and it said that my computer was using too much memory to play them even though my memory was fine. Reloading the file from GameMaker doesn't help. I can play them fine from the project folder, though.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users