Jump to content
The simFlight Network Forums

No sound with function sound.play

Recommended Posts

I've been using FSX + FSUIPC 4.853 + WideFS7( Key provided) + Linda Lua  in my homecockpit for a long time - FSX main computer + 4 clients without problems.
Now, for example,  I wanted to play a suitable Airbus Wav file for the Master Caution Light on the FSX PC.
I call the sound.play function via event.offset of the M / C offset.
The following appears about the sound in the FSUIPC log file (Debug=Please and LogExtras=x20 activated):
   431686 Sound: Id 1, PlayNow("D:\Airbus_FWC\airbus_warning")
   431686 Sound: Id 1, PlayTheSound("D:\Airbus_FWC\airbus_warning.wav")
   67158 Sound: EnumDevice=Primärer Soundtreiber
I tested different wav file paths and different wav files, as well as different sound devices from the FSUIPC.ini file.
nothing arrives in Windows 7!
All other audios and sounds in FSX as well as from any other program work perfectly. 
A similar post here had the same problem a few years ago - it said, probably a windows problem (driver or something similar).
Are there any more recent findings? 

Best Regards

Link to comment
Share on other sites

1 hour ago, yak54 said:

I have attached the Lua file.

Phew! I was expecting a tiny program which just played the sound on a change in an offset. I could then have tested it here.

I'll just make something simple like your

   function Sound_Warning ()

  event.offset(0x73AE, "UB", "Sound_Warning")

But with a different path and wave file (as I don't have yours. I'll also need to change the offset via FSInterrogate as I don't have anything using that one.



Link to comment
Share on other sites

Tested and all working. I just noticed your FSUIPC4 version is well out of date and is not supported. You need to download the current one, 4.976.

My results were good, tested with this Lua plug-in:

function Sound_Warning ()
     ipc.log("Sound Warning called")

event.offset(0x73AE, "UB", "Sound_Warning")

With the logging enabled I get this in the log:

    78078 LUA.0: Sound Warning called
    78125 Sound: Id 1, PlayNow("C:\Steam\steamapps\common\FSX\sound\xeng_fire_2")
    78125 Sound: Id 1, PlayTheSound("C:\Steam\steamapps\common\FSX\sound\xeng_fire_2.wav")
    83812 Sound: Id 1 DeActivate: sound not playing now ...
    83812 Sound: Id 1 EndPlay: releasing buffer
    83812 Sound: Id 0 EndPlay: all done!

This of course is using the default sound device, since I gave no device number in the sound.play function.

I suggest that, after you update your FSUIPC4 installation, you test with something simpler and using one o the sounds installed with FSX.  You could also try selection the sound device explicitly. The numbers to use are listed in the [Sounds] section of the FSUIPC4.INI file.

Note that, unless you are changing the sound folder for different sounds, there's no point in having the sound.path in your function, being set every time. Just set it the once, at the start of the Lua code.



Link to comment
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
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.