Jump to content
The simFlight Network Forums

FSUIPC7, Lua script and driver audio


zorzini

Recommended Posts

Hi
after weeks of testing I am forced to ask for your help to understand a problem that occurs when trying to reproduce sounds using a LUA (PMCO_FNX32X.lua) and FSUIPC7 script.

I attach the LUA script PMCO_FNX32X.lua the FSUIPC7.ini and the FSUIPC7.log

The audio files are correctly present in the PMCO_FNX32X_Sounds directory

I don't understand why the "calls" of the Fenix's speeds are not reproduced by the main audio driver which otherwise works correctly.

In the fsuipc7 log I see that the LUA correctly generates the flap position call (line 427844 etc) but nothing comes out of the speaker.

Thank you for your attention.

P.S. I probably don't understand how FSUIPC7 identifies and uses the audio driver in use. Just tried with complete FSUIPC reinstall but nothing change.

FSUIPC7.ini FSUIPC7.log PMCO_FNX32X.lua

Link to comment
Share on other sites

1 hour ago, zorzini said:

Just tried with complete FSUIPC reinstall but nothing change.

Re-installing will not change anything.

I don't have time to look into debugging such a complex lua script. If your issue is that no sound is played, please just try with a simpler script first to confirm that sound is working. i.e. test with a script that just uses sound.play in its various forms, e.g. first just specifying the wav, then a call with the wav file and device number, then  add a call that also introduces the volume parameter. You can activate this script on a button or key press.

So, try a simpler script first to confirm that sound is working. Once that is done and you have confirmed that sound is working, you can then debug the script. You can use the Log->Lua Plugins logging facility to debug lua scripts.

John

Link to comment
Share on other sites

4 hours ago, John Dowson said:

Re-installing will not change anything.

I don't have time to look into debugging such a complex lua script. If your issue is that no sound is played, please just try with a simpler script first to confirm that sound is working. i.e. test with a script that just uses sound.play in its various forms, e.g. first just specifying the wav, then a call with the wav file and device number, then  add a call that also introduces the volume parameter. You can activate this script on a button or key press.

So, try a simpler script first to confirm that sound is working. Once that is done and you have confirmed that sound is working, you can then debug the script. You can use the Log->Lua Plugins logging facility to debug lua scripts.

John

I'm asking too much if you could provide me the simple lua script to test the audio? Thank you

Link to comment
Share on other sites

Attached is the one I use...you will need to adjust for the *.wav file names, the locations of the files, and the devices - I have 6 sound devices in registered in my FSUIPC7.ini file.

Note I don't bother using the volume parameter - I adjust volume using windows facilities (or EarTrumpet).

John

soundTest.lua

Link to comment
Share on other sites

21 minutes ago, John Dowson said:

Attached is the one I use...you will need to adjust for the *.wav file names, the locations of the files, and the devices - I have 6 sound devices in registered in my FSUIPC7.ini file.

Note I don't bother using the volume parameter - I adjust volume using windows facilities (or EarTrumpet).

John

soundTest.lua 1 kB · 0 downloads

As always, 10,000 thanks for your availability.

This little problem torments me but I would struggle to study LUA which I have never used from scratch.

Only one question (at the moment): i have the file called "bong" as wav file; in the script is without the estension wav: is correct without or i have to add the estension ?

Thank you

Link to comment
Share on other sites

20 minutes ago, zorzini said:

Only one question (at the moment): i have the file called "bong" as wav file; in the script is without the estension wav: is correct without or i have to add the estension ?

Please see the Lua Library documentation for the sound.play function such questions:

Quote

Plays the wave with the given name. This must be a "wav" file, but you can omit the ".wav" part.

If the device number is omitted, the default is used (device 0).The vol ( volume) is a % value between 0% and 100%. This isn't the complete range from silence to max, but 0 is very quiet. This defaults to 100.

The posn (position) is a value in degrees from 0 to 359 representing the circle around the PC, with 0 being forward centre. This is approximated as well as possible for the sound device being used. For a stereo setup, the circe collapses to a left-right spectrum.

A position given as -1 will play on all speakers.

Unlike FS sounds, this sound will play regardless of whether FS (or WideClient) has the current Focus.

The "ref" value returned is a number which can be used subsequently in the stop, adjust and query functions.

Note that sounds are "global" in the sense that they don't stop when the Lua program ends or is killed..

I provide documentation for a reason - please use it!

John

Link to comment
Share on other sites

4 minutes ago, John Dowson said:

Please see the Lua Library documentation for the sound.play function such questions:

I provide documentation for a reason - please use it!

John

It's correct...sorry

Ciao and thank you

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.