Sign in to follow this  
Guest pookie

playing .wav files using switches

Recommended Posts

Can someone help me with this one?I want to flip a switch (momentary) and have my PC play a pre-recorded message (.wav file). I'm using keyboard emulation, but I can also wire the switch to a hacked joystick button I have. What do I need to do in my PC to have it play this file when I flip the switch?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You could do this relatively easily using VB and DirectX. You pole your joystick button for change and call the wave file when toggled.Add a multimedia control to a form and enter this in it:Private Sub MMControl1_PlayClick(Cancel As Integer) MMControl1.Command = "Close" MMControl1.FileName = your_wave_file_path_here MMControl1.DeviceType = "WaveAudio" MMControl1.Notify = False MMControl1.Wait = False MMControl1.Shareable = False MMControl1.Command = "Open" MMControl1.Command = "Play"End SubWhen the button is pressed call the function above:Call MMControl1_PlayClick(-1)That's all there is to it. I leave the DX joystick button input to you since there are plenty of joystick examples on the net.The form does not need to be in focus for this to work.-Leo

Share this post


Link to post
Share on other sites

It would be interresting to do that for FSBUS switch (or IOCARD)for example when you move a switch like "Seatbell" you play a .wav dong file. or when you reach V1 speed a nice woman voice can annouce you "V one"Is that possible ?Does anybody have an idea to realise that ???Thank'sBOB

Share this post


Link to post
Share on other sites

Peter Dowson wrote a little dll called 'esound'. You can configure it to play any sound based on outputs from FSUIPC. It uses Triggers to fire specific sounds. You can use multiple triggers and conditional triggers as well.Example: IF AIR_SPEED => 80, PLAY "ROTATE.WAV"orIF ON_GROUND = 1 and PARK_BRAKE = 0, PLAY "Stewardess welcome.wav"or something like that!In addition (and a big one)...you can use esound to configure the sound card and speaker that you want the sound to come out of. For example, all ATC sounds are directed to an overhead speaker or your headset. All cabin announcements are directed to a speaker behind you. All wheel sounds go to speakers below you...etc, etcYou can then try to tie the keys & switches to affect the appropriate FSUIPC variable. Not sure if you can create your own...but this should get you down the path a little.You can find it at http://www.schiratti.com/dowson.html The program is unsupported but has great documentation and is compatible with all FS versions thru 2004.

Share this post


Link to post
Share on other sites

look's great ... :-)I'll try it and give you my opinionThank's for the informationAnd thank's to P. Dowson, the Add-On Man of FSBOB

Share this post


Link to post
Share on other sites

Now you can do this with the new version of FSBUS 2.2It's integrated in the software and fully programmable.But only 1 .wav playing at the same time.BOB

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this