Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I can't seem to get the sound working in FSUIPC7. Here's what I'm doing:

ipc.log(sound.device(0));
sound.path([[C:\]]);
s = sound.play("click2");
if (sound.query(s)) then
    ipc.log("Sound played.");
else
    ipc.log("Sound not played.");
end

Here's the result I'm getting:

1475122689_ScreenShot2020-11-09at5_29_47PM.png.cfaa1b26ab680d87810f212cf1771bf0.png

(and obviously no sound is playing)

I have a 1 minute long wav file (named 'click2.wav') right in C:\ (just to make sure there were no path spaces issues). Windows can play the file fine, but I've also tried several different files.

Posted

Two questions:

1.  What syntax is this?  "sound.path([[C:\]]);".
Surely that should be sound.path("C:\\")

2.  Have you checked to make sure MSFS doesn't have exclusive access to your sound driver? With FSUIPC7 being a separate process, unlike in previous incarnations, that's a factor.

BTW you don't need ; at the end of each statement in Lua. I know it's a habit from C/C++ and so on. It does no harm, just not needed.

Pete

 

 

Posted

1. [[STRING]] is quoted literal format for Lua. It works fine and avoids the need to escape anything, you can read more about it on lua.org. None the less, I've tried it several ways including a regular escaped string.

2. What is the best way to check this?

-Matt

Posted

For #2, if it's a valid test - I can confirm that I can certainly play sounds from other Windows applications while MSFS is running and producing sound. For example I can watch Youtube videos with audio, use the media player, ...etc. I Can also play the wav file(s) in question.

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.