dialogue wizard + voice audio (VBScript ???)

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

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

dialogue wizard + voice audio (VBScript ???)

Postby oase » Wed Aug 16, 2017 9:54 pm

I use AM version 4.7.1 so that the following VBScript doesn`t works: PlaySound "c:\filename.mp3", False

Now i searched in the AM forums and found, that i could use this command instead: PlaySound GetPath(2) + "c:\filename.mp3", False

I tried, but it still doesn`t work. Path 2 is the folder called "External" (under "Project Ressouce Files") isn`t it?

So again:

I have an audio called "a1" for example,
then i have to load it up - WHERE?
Then i open the dialogue wizard > Advanced (Execute VBS Code) > "After the question has been asked" > GetPath(2) "c:\a1.mp3", False

???
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: dialogue wizard + voice audio (VBScript ???)

Postby reneuend » Mon Aug 28, 2017 2:34 pm

Sorry. I've been away for several weeks. I'll review your question and get back with you in the next couple days.
---


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

Re: dialogue wizard + voice audio (VBScript ???)

Postby reneuend » Wed Aug 30, 2017 8:03 pm

I used GetPath(4)
then place the audio files in the Areas folder

GetPath(2) is the external folder and the default. This should have worked for you.


Here are the routines that work for me:

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)
   If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = true Then
      Component("MediaPlayer" + CStr(ChannelNumber)).Object.Stop
   End If
End Sub


Example: PlaySoundWin7 GetPath(4) & "dart_gun_miss.wav", 1, 10

Let me know if this works for you. I'm guessing you don't have the latest PlaySound routine. :wink:
---


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

Re: dialogue wizard + voice audio (VBScript ???)

Postby oase » Sun Sep 03, 2017 9:12 pm

Oh sorry. I didn`t inform you that i got help by Mystery Egypt meanwhile. But I think to remember that it must be same solution. I will check that when I´m back from holidays ... THX!
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


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron