How do I Audio Seek?

0 favourites
  • 2 posts
From the Asset Store
Make your game more fun and interactive with the Dog Hide and Seek Buttons Sprite Sheet.
  • I'm trying to make music fade in at random parts of a track.

    I have in Start of Layout Event:

    Audio Play "tag" at volume -100 looping
    Audio Seek To random(Audio.Duration("tag"))
    Audio Fade to 0 over 3 seconds, then keep playing
    

    but the music always starts at the beginning, it won't seek. What am I doing wrong?

    EDIT: I put the Seek in a Keyboard Press 1 Event and it worked, so I put in Trigger Once Event and it did NOT work.

    Is this a thing where it requires a user action? if so, how do I get around it? You should be able to automatically start a music loop at random points...right?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I figured a work around. You need to put a wait after the initial play action. And it can't be a Wait 0. You have to wait at least 1 second (I think). No idea why it needs that.. maybe it has to cue up the file before you can seek? Makes for a little clugey coding but it works. Just another lovely undocumented feature... :)

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