Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Preload Sound - General Question  (Read 4181 times)

0 Members and 1 Guest are viewing this topic.

redfox

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 122
    • View Profile
Preload Sound - General Question
« on: November 19, 2007, 07:40:50 PM »

Hello,

I'm using the actor.PreloadSound("something1.ogg"); to load a sound before it is used in a scene. This is to stop the scene, actors, music and particles from juddering when the sound is loaded. However, does the preload sound allow for multiple sounds to be loaded, such as actor.PreloadSound("something1.ogg"); actor.PreloadSound("something2.ogg"); etc.?

When I want to play the loaded sounds I am using, actor.PlaySound("something1.ogg"); I have tried this but I still end up with the screen jumping when the sound is played. The document files says to use just actor.PlaySound(); to play the last preloaded sound but I wish to load several.

Thanks
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Preload Sound - General Question
« Reply #1 on: November 19, 2007, 08:06:05 PM »

I use array for storing preloaded sounds and then referencing them through indices. I have a preload object for it.

I've posted some ideas here:

http://forum.dead-code.org/index.php?topic=800.0
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Preload Sound - General Question
« Reply #2 on: November 19, 2007, 08:08:41 PM »

An if you're using short sounds very frequently (typically footstep sounds), use WAV files instead. There's a smaller overhead when initializing them compared to ogg.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

redfox

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 122
    • View Profile
Re: Preload Sound - General Question
« Reply #3 on: December 05, 2007, 04:41:58 PM »

Ok, thanks for the information and links. I will use more wav files to quick loading short sounds.

Does that mean I can't preload many sounds, onto a global entity, ready for use later? 

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Preload Sound - General Question
« Reply #4 on: December 06, 2007, 04:03:28 PM »

Each game object can only hold one preloaded sound. If you need more sounds, you need more objects.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

redfox

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 122
    • View Profile
Re: Preload Sound - General Question
« Reply #5 on: December 13, 2007, 02:48:21 PM »

Oh, I see, and thats what metamorphium script does. Thanks for letting me know.
Logged
 

Page created in 0.045 seconds with 21 queries.