FMOD integration how to check if audio finished

Announcements, support questions, and discussion for the Dialogue System.
Saper
Posts: 84
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi Tony

I checked it looks like the "OnSequenceEnd" is fired at the start and the end of FMODWait. In Sequence ther is only
FMODWait(Test_audio, event:/VO/event_vo_test);
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Is it possible that the first OnSequenceEnd is coming from the previous dialogue entry?
Saper
Posts: 84
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

After some tests. "OnSequenceEnd" fire at the start of the first node after "Start" node. When I use Jump to Specify Starting Entry ther is no problem and "OnSequenceEnd" fire at the end of sequence
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

I think it's firing at the end of the <START> node.
Saper
Posts: 84
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

About <START> node, can i check node ID from code?

Other thing:

We have class that will auto progress dialogue when audio finishes, typewriter finish plus offset.
And to progress dialogue we use:
- DialogueManager.PlaySequence("Continue()"); <- and this doing second "OnSequenceEnd"
Can I call other class / method to continue dialogue ?
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Hi,

To check a node ID, use DialogueManager.currentConversationState.subtitle.dialogueEntry.id

To continue a conversation to the next node, call DialogueManager.standardDialogueUI.OnContinueConversation().

Alternatively, you can advance after FMOD and timing by using a single sequence instead of C# code. Example:

Code: Select all

FMODWait(entrytag)->Message(AudioDone);
WaitForMessage(AudioDone, Typed)
(This assumes you're not requiring a continue button click.)

Or:

Code: Select all

FMODWait(entrytag)->Message(AudioDone);
WaitForMessage(AudioDone, Typed)->Message(Delay2Seconds);
Delay(2)@Message(Delay2Seconds)
Saper
Posts: 84
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi

We requiring a continue button click, DialogueManager.standardDialogueUI.OnContinueConversation() helped with other nodes. Now the problem with <Start> node still exists, when I try to get node ID OnSequenceStart or OnSequenceEnd it shows ID = 1

Same problem happening with response buttons. OnSequenceEnd from it starts when new node is visible

blank node with Continue(); don't do that
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Alternatively, you could use a sequence like this:

Code: Select all

FMODWait(entrytag)->Message(AudioDone);
WaitForMessage(AudioDone, Typed)->Message(Delay2Seconds);
Delay(2)@Message->Message(ReadyToContinue);
Continue()@Message(ReadyToContinue)
Saper
Posts: 84
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi Tony

I found a solution, this what i did:
- I created new var in DS, type: bool , name: StartNode
- In Start node in sequence I change "StartNode" var to true
- In my script OnSequenceEnd i first check if "StartNode" true
- If it is true then change value of "StartNode" to false, and do nothing
- If "StartNode" value is false set audio as finished

Is there a option to set this sequence to all my Start Nodes without doing it per conversation?
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Hi,

Try adding this method to a custom script on the Dialogue Manager GameObject:

Code: Select all

void OnConversationStart(Transform actor)
{
    PixelCrushers.DialogueSystem.DialogueLua.SetVariable("StartNode", true);
}
Post Reply