How do I run events through audio?

  • Is it possible to run events when a certain part of a song/sound file is reached? I don't see any events regarding this in the audio plugin.

  • I'd like to know this too. Had a search around for info a while back and didn't come up with much. Using the Wait event can work (On Song Start-Wait 120seconds- do a thing), or using a Variable to store time and matching it to points in the song runtime. Neither of these are going to be completely accurate

  • Timer would be a better option. You can pause/stop the Timer if needed, which you can't do with Wait.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Timer would be a better option. You can pause/stop the Timer if needed, which you can't do with Wait.

    I'd use timer, but what if there's some lag in the music? That would throw the timer off very easily. Games can have all sorts of unexpected janks here and there, so I wouldn't trust an internal clock to do something like this.

  • You might be able to use the system event "Compare two values" and then use:

    Audio.PlaybackTime(Tag)

    Get the current playback time in seconds of a sound with a tag. This starts at 0 and counts up to the duration, except for looping sounds which keep counting up past the duration.

    e.g.

    Compare two values: Audio.PlaybackTime("yourSound") > 2 |Trigger once : Your action

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