|
From: Michael D. <mik...@gm...> - 2019-11-10 14:01:53
|
On Sun, Nov 10, 2019 at 09:18:47PM +0800, Sidi Liang wrote:
> Hi all,
>
> I'm trying to make a music player using nasal. As there is no docs for the
> sound playing fgcommand at all, I used the sound configuration xml for
> playing sounds. However, I found that it's impossible to change which file
> to play in runtime using nasal as it seems that only path are accepted in
> sound configuration xml instead of property, and I don't have write access
> to the sound configuration xml file. I even tried to find a way to make the
> aircraft use a xml file located in FGHOME but ended up in total failure.
>
> By the way, the method to reset sound system in runtime described in wiki
> doesn't seems to work, at least in 2019.3.2.
> [code]fgcommand("reinit", props.Node.new({ subsystem: "fx" }))[/code]
>
> Am I doing anything wrong here?
I thought there had been added a Nasal interface added for sound
queues, but it has not been properly documented? It would be very
handy as well for instrument sounds and especially crew callouts,
because that would spare having to add dozens of play-once sounds to
sound XML and worrying about keeping as high number of properties that
drive them nonzero for exactly their length to make them play fully.
And also queueing them manually so they don't overlap.
You can instruct the user to add the aircraft's subdir with that file
to write-permitted paths, but that involves adding command line args
manually -- so make sure failing to do that does not break the model
other than being unable to change sounds on the run.
I noticed very long ago reloading sounds this way didn't really work,
but thought it was some weirdness in my setup -- I think this can make
a bug ticket?
But even if the reloading gets fixed -- I would expect an irregularity
or a split-second pause in the sounds, as well as breakage of things
such as replay mute (which is already broken -- try to load another
tape or pause/unpause when replay is muted).
|