fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Speech tag support for SAPI

Open Shivansps opened this issue 3 years ago • 2 comments

Support for using SAPI tags to play messages using different voices and/or voices settings in-game, the settings are added to each Persona on messages.tbl, then each message, or cmdbrief, debriefing, briefing stages need to be set to use that persona.

Example for Persona:

$Persona: Holley $Type: wingman $Speech_Tags: +Gender: Female +Langid: 1009 +Pitch: 6

$Persona: Epsilon 1 $Type: wingman $Speech_Tags: +Gender: Male +Langid: 409 +Rate: 2 +Pitch: 10 +Volume: 70

Options for voices: Gender: Male or Female Langid: These are set by Microsoft, Sapi Settings informs that data. Rate: -10 to 10 Pitch: -10 to 10 Volume: 0 to 100

If a langid or gender is not installed/avalible in user S.O. SAPI adjusts by playing the voice closer to what it is selected. Because SAPI is depecrated in Windows, in order to use all MS voices, after installing them, the voice tokens must be copied in registry from the Speech_OneCore to Speech. This has to be done externally, whiout this only Zira and David are avalible to use. Sapi Settings can do that now.

FSO: -Support for multiples SAPI voices for messages, cmdbrief, brief, and debriefing stages. -Personas have optional speech tag settings for langid, gender, rate, pitch and volume. -In Fiction Viewer mode, the speaker name is the persona name. -Changed the speech_buffer used for debriefings from a fixed char [4096] to a SCP_String, it made the code easier to write, also i was afraid that the tags size would make some debriefings to actually hit that limit. -Added a cmdline argument to disable use of speech tags to force the default selected voice.

Fred2: -Support for using speech to play messages, and texts in cmdbrief, briefing and debriefing editors. Only used if there is no audio file loaded. -Added combo box to select Personas for each cmdbrief, brief, and debriefing stages. -Made the persona selection for messages on event editor a little bigger, it was making the persona selection hard if there are too many.

Applied to JAD 2.21: https://www.youtube.com/watch?v=3kf7p6IIvqc

Test Build, Modified JAD Files, SAPI Settings app and test mission: https://drive.google.com/file/d/1KmIswo1z5aXHvYRJLCWa0xA4VsdFKmss/view?usp=sharing

Shivansps avatar Oct 19 '21 23:10 Shivansps

Nice work!

JohnAFernandez avatar Oct 19 '21 23:10 JohnAFernandez

Great idea. I do have a few comments about the design though.

Goober5000 avatar Oct 24 '21 04:10 Goober5000

Sadly, this PR is now obsolete because of AI TTS. ShivanSPS has agreed to close it.

JohnAFernandez avatar Nov 02 '23 23:11 JohnAFernandez