Board index FlightGear Development Nasal

Need some help to understand how works nasal/XML/ C++

Nasal is the scripting language of FlightGear.

Need some help to understand how works nasal/XML/ C++

Postby VrLngFngrs » Tue May 31, 2016 7:29 pm

Hello everyone,

I'm new in this forum and I need your expertise in that game. For a project at school, we have to make flight gear playable by a blind personn.
To do so, we had some voice in the game, for exemple when the player will press "O", the voice will say " AVIONICS ON". We use the API "SAPI 5" of windows
to make flight gear speak.

But when the player will press "O" again the voice will continue to say that the avionics is on even is already on. It's worst with the throttle because the player is keeping press the key and the voice will keep saying the information . Now my idea is to had condition on the voice by using the data in the xml files. But I don't know how to bind them. Can someone explain me or teach me how to do it ?

I've already ask to the french forum but they advise me to come here. If i didn't make myself clear, tell me and I will explain it to be understand.

Thank you for your help ! :)
VrLngFngrs
 
Posts: 1
Joined: Sun May 29, 2016 11:41 am
Version: 2016.1.1
OS: Windows 10

Re: Need some help to understand how works nasal/XML/ C++

Postby D-ECHO » Wed Jun 01, 2016 2:39 pm

Hi VrLngFngrs and welcome to the forum!
Maybe (I'm no expert here) it's better and easier for you to use the build-in flightgear soundsystem rather than SAPI5. http://wiki.flightgear.org/Howto:Add_so ... o_aircraft
It let's you define conditions quite easily.
And you work with flightgear in your school? Lucky you! :D
Regards
D-ECHO
D-ECHO
 
Posts: 2460
Joined: Sat May 09, 2015 1:31 pm
Pronouns: Bea (she/her)
Version: next

Re: Need some help to understand how works nasal/XML/ C++

Postby Hooray » Thu Jun 02, 2016 1:40 pm

I agree, it would make more sense to directly use festival TTS (bold words are useful search terms for the wiki).

Apart from that, you will definitely want to read up on the property tree and bindings, bindings can be used to trigger so called fgcommands
These are documented in $FG_ROOT/Docs/README.commands

Apart from that there is a powerful built-in scripting language to implement custom functionality, it's called Nasal

You can also interface external software to FlightGear using a variety of I/O mechanisms, including http and telnet/props

In general, you may find that customizing the built-in Phi UI may be the best option to provide a user interface without relying on the graphics.

And in fact, you'd only need to use a little HTML and JavaScript to make this work, and even the sound output could be handled by the browser, so no TTS engine needed then.

HTH
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Nasal

Who is online

Users browsing this forum: No registered users and 4 guests