Audio caching

This forum is currently in read-only mode.
From the Asset Store
100+ Musical High Quality Sound Effects for your game!
  • I've been experimenting audio talking, and I noticed that each time an audio file plays, the entire layout pause for a bit and then the file plays.

    The files are very small. The smallest one I had was a 96kb .wav file, I've also done MP3's as well and just the one file alone made the layout pause.

    I had an idea, I have no idea if it will work:

    *What if I just had all of the audio files play at a zero volume level when starting the game up. Then when the game reaches the layout where music is supposed to play, it will fire up faster from cache (?)

    I don't know, just wondering...?

  • did you try the cache file action?

    or loading the wavs to channels at start of layout?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ^^^ I ignored those for some reason. I guess because my other sounds played without the hitch I thought it might've been some other issue. Thanks for the tip, I'm going to try those.

    I have a two-part question... the layout where I'm trying the talking audio doesn't last for long. It only lasts until there is a collision and that takes about 3 or 4 seconds, then it jumps back to the previous layout. This is done by design. My fear is that in layouts where I need a lot of dialog with some of it triggered by collisions (also by design), there may be more pausing hiccups.

    1. Do you think these actions you've pointed out will address that and keep the timing smooth without there being hiccups? I haven't done all the audio yet and I'd hate to do it all then have it cause a bunch of stops.

    2. Is there a way to load audio for the next layout? For example, I'm in Layout 1 and I want to start loading the audio for layout 2?

  • Hmmmm, this is weird... here are some new issues I'm encountering:

    -At the start of the layout I loaded two .wav files. I tried it loading each from separate Xaudio2 objects. I had one on channel 1, the other on channel 2. I also tried it loading both .wav files from the Xaudio2 object and also putting both files on the same channel... I used "play channel" to play the .wav's.

    ... the result in both situations... a very nasty, loud, garbled electronic sound from one of the files, and the other file playing normally. Very, very strange. It's basically a situation where I'm not able to play more than one sound file at a time.

    -I also attempted to load an MP3 at the start of layout, and then "play channel" to play the file. But, the file doesn't play. If I select "play music from file" it plays but causes the layout to pause. In fact, If I choose "play music from file" with .wav's it does the same thing. All of this happens even after loading the file at the start of the layout.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)