x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Delay between SoundBase finishes playing and the event "OnAudioFinished" fires

I'm writing a simple dynamic music system that switches music tracks on the fly according to gameplay condition. Each track is a SoundBase list containing a song cut by measure. Every time OnAudioFinished fires, we play the next SoundBase. The whole functionality is done in blueprint with UE 4.14.3.

However, with the current implementation, it seems that there is a noticeable delay between the end of the previous measure ends and the starting of the next. Is there a way to solve the problem or reduce the delay?

Related question: Noticeable gap in sequence node on sound cue and OnAudioFinished

Product Version: UE 4.14
Tags:
more ▼

asked Sep 10 '17 at 07:34 AM in Using UE4

avatar image

Akitsuki Rin
42 2 3 6

avatar image Minus_Kelvin STAFF Sep 11 '17 at 09:46 PM

unfortunately, doing OnAudioFinished delegate triggers for interactive music isn't going to work for a number of reasons. Blueprint runs on a game thread tick while audio runs in a separate thread. To do this we'd have to write a scheduler that introduces latency so that audio events could be scheduled according to a "sample accurate" clock. This is actually something that I'd like to implement in the near feature but doesn't exist now.

People have been able to make interactive/dynamic music systems by doing their musical timing entirely on the game thread vs depending on delegate callbacks. Then, author your music pieces as one-shots with a bit of tail so that when a new piece plays (or if the same piece is retriggered), the tail will prevent an instantaneous stop (and thus sound like a discontinuity). You can also mask transitions via one-shot "stinger" sounds (like cymbal swells, orchestral hits, or some other musical one-shot).

I'd recommend checking out the BP Timeline component to build a BPM counter that counts beats and measures and broadcasts musical structural events which you can use to trigger pieces of music.

avatar image Akitsuki Rin Sep 13 '17 at 09:36 PM

Thank you for answering. I changed the transition to cross-fading for the current project due to time constrain. I will take your suggestions for the future implementation.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question