Jump to content
The simFlight Network Forums

error on sound.play


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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...
 Share

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