Is it possible to have a looping wav when you enter a screen

Help each other out

Is it possible to have a looping wav when you enter a screen

Postby atari800 on Thu May 18, 2006 3:11 pm

I am starting plans to build a Mame Arcade/Jukebox/weather station/local movie finder/...you get the picture

What I'd like to do is when I enter a new screen ... arcade for example... I'd like it to play a wav file. I have a wav of sounds of an old 80's arcade that would be great on that screen, while searching for a game

Then maybe thunder and rain when I enter the weather screens

Maybe that old time camera sound when I go to movies screen (click - click -click -click..speeding up) followed by the Lucas Film THX intro - this one I would not want to loop

And that Evening News music from tv when you go to news screen

I guess I could make WinAMP run whatever (somehow) but if I had music queued up - I would lose it


Any ideas - thoughts - comments
/|\
atari800
 
Posts: 11
Joined: Tue Mar 15, 2005 2:38 pm

Postby jowaldo on Thu May 18, 2006 3:44 pm

maybe with xscript...

but you could just do it kinda funky with just a batch file tellin something like media player classic (i think it supports command line switches) to play that file on a loop.

Then you could have an exit screen event that calls another batch file to kill that process.

Just an idea...
Last edited by jowaldo on Thu May 18, 2006 8:28 pm, edited 1 time in total.
jowaldo
 
Posts: 903
Joined: Wed May 21, 2003 7:17 pm

Postby atari800 on Thu May 18, 2006 3:46 pm

well...I updated my xlobby.exe - durrrrr :?
And enabled buttons sounds

Well I am getting closer but with the music (wav) files being so ling, the other sounds get queued up behind the WAV being played

Example: I got a wav (30 seconds long) associated with a button
Event Click is associated with it that plays the wav
If I go back a screen and click button again while wav is playing, the next wav file starts after the first wave is completed

So I am looking for a wav terminate
..probably not doable - but maybe XSCRIPT will let me overlap sounds

I'll keep yall posted...and if anyone has ideas - comments - thoughts...please toss them my way
atari800
 
Posts: 11
Joined: Tue Mar 15, 2005 2:38 pm

Postby dalanik on Thu May 18, 2006 8:14 pm

Speaking of XScript.... (that is, XScriptNG) here's alittle scripplet I use to play wav files:

' --------------------------------------------------------------------------------------
' *** VisualX *** Created by Dalibor Lanik 2006
' --------------------------------------------------------------------------------------

Imports System
Imports System.IO
Imports System.IO.IsolatedStorage
Imports System.Collections
Imports System.Runtime.InteropServices
Imports System.Resources

Module Script

Public Class Sound

Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name As String, ByVal hmod As Integer, ByVal flags As Integer) As Integer

Public Shared Sub PlayWaveFile(ByVal fileWaveFullPath As String)
Try
PlaySound(fileWaveFullPath, 0, &H20000)
Catch
End Try
End Sub

End Class

Public Sub Main( StrFile As String)
Dim StrSkinPath As String

StrSkinPath = Xlobby.ResolvePath("skin://sounds\" & StrFile)
Sound.PlayWaveFile( StrSkinPath )

End Sub

End Module
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby atari800 on Thu May 18, 2006 10:23 pm

I got it..

I am using Xscript

I created a text file with this:
======
Module Script
Public Sub Main()
Dim strSoundFile, strCommand as String
Dim ProcID as Integer
strSoundFile = "d:\goldwave\karlcade.wav"
strCommand = "sndrec32 /play /close " & chr(34) & strSoundFile & chr(34)
ProcID = Shell(strCommand, 0)
End Sub
End Module
======

Then to stop it I use KILL PROCESS (event) and point to c:\windows\system32\sndrec32.exe

I could pretty this up to take command line paths to wavs but ...
MISSION ACCOMPLISHED

-self notes-
Need to kill wav when leaving the games screen
Need to kill wave when a game is launched
Eventually -determine if I quit mame and am back and restart



Xlobby...ya gotta luv it
atari800
 
Posts: 11
Joined: Tue Mar 15, 2005 2:38 pm