Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

I have been trying to play a 2 second wav from a Lua script (it's for the stall test switch) and I am getting an error with the ipc.debug program on the line where I have used the sound.play. I have searched through the pdf manuals with the keyword sound but I have not been able to find anything.

This is the code that is causing the problem,

sound.play("c:\\sounds\\stall.wav")

ipc.sleep(3000)

The wav file is at this location: C:\sounds\stall.wav

ipc.debug writes this to the log file:

2940448 *** LUA Error: ...es\Microsoft Flight Simulator X\Modules\MW_Panel.lua:29: attempt to index global 'sound' (a nil value)

2940448 LUA: ended "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\MW_Panel.lua"

2940448 System time = 23/03/2011 20:07:31, Simulator time = 20:07:47 (20:07Z)

********* LUA execution terminated: Log Closed *********

As always, any help would be very much appreciated

Posted

I have been trying to play a 2 second wav from a Lua script (it's for the stall test switch) and I am getting an error with the ipc.debug program on the line where I have used the sound.play. I have searched through the pdf manuals with the keyword sound but I have not been able to find anything.

...

2940448 *** LUA Error: ...es\Microsoft Flight Simulator X\Modules\MW_Panel.lua:29: attempt to index global 'sound' (a nil value)

That simply means that the "sound" library isn't defined (i.e. it is "nil"). I think you must be using a version of FSUIPC before the "sound" library was added. If you look at the headings of the Lua library documents you are referring to, don't you see an FSUIPC version number?

Try the interim FSUIPC update available in the Download Links subforum.

Regards

Pete

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.