Audio Plays Twice Sometimes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
bautistac
Posts: 14
Joined: Tue Jan 06, 2015 5:31 pm

Audio Plays Twice Sometimes

Post by bautistac »

Hello,



I am having an issue where the audio specified in my sequence for a conversation node will sometimes play twice. I set my conversation to only have one actor. I can't figure out why this would happen.











The console shows 2 audioWait commands going to the sequencer for each message. Sometimes you can hear the audio as if its being played from 2 sources. I just want my messages to play once.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Audio Plays Twice Sometimes

Post by Tony Li »

Can you post a few lines above that in the console? Would it be possible for you to send me a scene that demonstrates the issue? I can't find a way to reproduce it here.
bautistac
Posts: 14
Joined: Tue Jan 06, 2015 5:31 pm

Audio Plays Twice Sometimes

Post by bautistac »

Here are shots of the console from the start of the scene. Ignore the first error as that shows up when I zoom my camera in too much. The second error points to the BarkDialogueUI component.



Here's the inspector for the Radio during runtime.



I cannot reproduce the issue at will. It seems to be random. Every time I start the scene, there is at least one message that plays that sounds like multiple audio sources are playing the same clip. I only notice this during Bark conversations. Not during interactive conversations.



I am curious about the Audio Source that gets created on my Radio object during runtime. I know the dialogue system will create an Audio Source if none is present on a speaker if the sequence calls for audio to be played. The audioClip remains blank here, though, so I am thinking that there could be another audio source being placed that has the active clip showing.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Audio Plays Twice Sometimes

Post by Tony Li »

Ah, I forgot that you're using BarkDialogueUI! I'll fix this in the release coming out later today.



Conversations use a model-view-controller (MVC) pattern. In a regular conversation, the conversation view tells the dialogue UI to show the subtitle text, and it separately tells the sequencer to play the sequence.



The bark UI, on the other hand, doesn't normally run inside a conversation, so it shows the subtitle text and plays the sequence.



With BarkDialogueUI, this results in two plays of the sequence -- one initiated by the conversation view, and another initiated by the bark UI.



In v1.4.4, if the bark is coming from BarkDialogueUI, the bark UI won't play the sequence.



Regarding your other question: Through v1.4.3, the Audio() and AudioWait() sequencer commands called AudioSource.PlayOneShot(). This plays an audio clip without actually assigning it to the Audio Clip property. In v1.4.4, it now uses AudioSource.Play(), which assigns the audio clip to the Audio Clip property. This was changed to allow the Dialogue System (including sequencers and conversations) to pause. Previously the only way to pause was to set Time.timeScale to zero (the standard Unity pause method).
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Audio Plays Twice Sometimes

Post by Tony Li »

Version 1.4.4 is now available on the Pixel Crushers customer download site! (If anyone needs access, please email your Asset Store invoice number to tony (at) pixelcrushers.com.)
bautistac
Posts: 14
Joined: Tue Jan 06, 2015 5:31 pm

Audio Plays Twice Sometimes

Post by bautistac »

Version 1.4.4 fixed my issue.



Thank you!
Post Reply