Quit audio parallel to dialogue

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Quit audio parallel to dialogue

Postby oase » Thu Dec 05, 2019 11:40 am

Hello, I have a problem to quit audio sequences in dialogues! A dialogue can be accelerated by clicking on it. Now I want to be able to finish also the audio of the last dialogue sequence prematurely. However, when I enter "StopSound", an error message comes up. In english it could be called that way,I think: Types incompatible: 'StopSound' (See attachement!) What have I done wrong :?:

Dialogue Wizard > Advanced > Execute VBS Code > On question click do the following > "StopSound"
Attachments
Error Screenshot.jpg
Error Screenshot.jpg (20.01 KiB) Viewed 3055 times
art is political. art is social. art works united! beeing creative is pure spirituality. so - let´s do it! and never forget: life ... is a wonder : )
oase
Active Member
 
Posts: 99
Joined: Sun Jun 27, 2010 1:00 am

Re: Quit audio parallel to dialogue

Postby oase » Mon Dec 16, 2019 8:33 pm

Hey, anybody out there? :cry:
art is political. art is social. art works united! beeing creative is pure spirituality. so - let´s do it! and never forget: life ... is a wonder : )
oase
Active Member
 
Posts: 99
Joined: Sun Jun 27, 2010 1:00 am

Re: Quit audio parallel to dialogue

Postby reneuend » Sat Dec 21, 2019 1:52 am

Hello Oase. Sorry I missed this post!

Can I see your VB code?
What version of AdventureMaker are you using?

It will probably require that we respond back to each other several times before we figure it out. I might want you to write a small sample project and send it to me, but we will wait and see how this goes.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: Quit audio parallel to dialogue

Postby oase » Sat Dec 21, 2019 11:08 pm

I use the newest (?) 4.7.1 version.
Ideally, the audio should stop as soon as you click on the subtitle in the dialogue text box (made with Dialogue Wizard).
Attachments
BUG REPORT II.jpg
BUG REPORT II.jpg (104.22 KiB) Viewed 3028 times
art is political. art is social. art works united! beeing creative is pure spirituality. so - let´s do it! and never forget: life ... is a wonder : )
oase
Active Member
 
Posts: 99
Joined: Sun Jun 27, 2010 1:00 am

Re: Quit audio parallel to dialogue

Postby reneuend » Tue Dec 24, 2019 11:51 pm

are you sure the stop code is being reached when you click on the textbox?
If you aren't sure, then put a msgbox "Hello World", in the STOP Audio routine.

If it isn't getting reached, then I wonder if you can put a transparent hotspot over the top of the textbox and use the click event for it to stop the audio.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: Quit audio parallel to dialogue

Postby oase » Sat Dec 28, 2019 5:35 pm

Can't I type something like that? But of course it should only stop the dialog audio.
Attachments
BUG REPORT III.jpg
BUG REPORT III.jpg (83.13 KiB) Viewed 3005 times
art is political. art is social. art works united! beeing creative is pure spirituality. so - let´s do it! and never forget: life ... is a wonder : )
oase
Active Member
 
Posts: 99
Joined: Sun Jun 27, 2010 1:00 am

Re: Quit audio parallel to dialogue

Postby reneuend » Mon Dec 30, 2019 2:54 am

You need to use the correct routine.

Place the following routines in the "Procedures" tab:

Code: Select all
Sub PlaySoundWin7(SoundFile, NumRepeat, ChannelNumber)
   If ChannelNumber < 9 Then
      'With VBScript it is currently not possible to interact with the 8 first audio channels.
      MsgBox "The specified audio channel is invalid.", vbCritical, "Error"
      Exit Sub
   End If
   If Action.IsComponentInstalled("NSPlay.NSPlayCtl.1") = False Then
      MsgBox "Unable to find the media player component.", vbCritical, "Error"
   Else
      If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = false Then
         AddComponent "NSPlay.NSPlayCtl.1", "MediaPlayer" + CStr(ChannelNumber)
      End If
      Component("MediaPlayer" + CStr(ChannelNumber)).Object.FileName = SoundFile
      Component("MediaPlayer" + CStr(ChannelNumber)).Object.PlayCount = NumRepeat
      Component("MediaPlayer" + CStr(ChannelNumber)).Object.Play
   End If
End Sub


Sub StopSoundWin7(ChannelNumber)
  Component("MediaPlayer" + CStr(ChannelNumber)).Object.Stop
End Sub



Usage:

To Play Channel 10:
1st parameter is the file (this one is in the "external" folder of your project
2nd parameter is number of times to repeat (0 = forever)
3rd parameter is the channel number
PlaySoundWin7 GetPath(2) + "rome_total_war_ending.mp3", 0, 10

To Stop only Sound Channel 10:
parameter is the channel number to stop
StopSoundWin7 10
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: Quit audio parallel to dialogue

Postby oase » Mon Dec 30, 2019 11:21 pm

Thanx, now it works! :D
art is political. art is social. art works united! beeing creative is pure spirituality. so - let´s do it! and never forget: life ... is a wonder : )
oase
Active Member
 
Posts: 99
Joined: Sun Jun 27, 2010 1:00 am

Re: Quit audio parallel to dialogue

Postby reneuend » Wed Jan 01, 2020 3:00 am

AWESOME!!! :mrgreen:
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron