Jump to content
The simFlight Network Forums

No sound with function sound.play


Recommended Posts

Hello,
I've been using FSX + FSUIPC 4.853 + WideFS7( Key provided) + Linda Lua 2.9.6.550  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 post
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 ()
          sound.path("D:\\Airbus_FWC\\")
          sound.play("airbus_warning")
    end

  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.

Pete

 

Link to post
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")
     sound.path("C:\\Steam\\steamapps\\common\\FSX\\sound\\")
     sound.play("xeng_fire_2")
end

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.

Pete

 

Link to post
Share on other sites
13 hours ago, yak54 said:

Will my registration for FSUIPC + WideFS remain valid?

Yes, your registration details for FSUIPC4 will be valid for all versions of FSUIPC4, and the same for WideFS7. The latest version of WideFS7 is 7.156.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • 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.