[RELEASED] Speech and Ambient Sound Module - Updated CMANO 1.12 936.11

Take command of air and naval assets from post-WW2 to the near future in tactical and operational scale, complete with historical and hypothetical scenarios and an integrated scenario editor.

Moderator: MOD_Command

Post Reply
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

[RELEASED] Speech and Ambient Sound Module - Updated CMANO 1.12 936.11

Post by sluggy2010 »


---------------------
Quickie instructions

---------------------

SeaHag Version 1.0k

What does SeaHag do?
SeaHag is a Speech and Ambient sound module for Command Modern Air Navy Operations.

Why call it SeaHag? Command is an honour; respect the role, and it just is....I have my reasons.

---------------------

Updated to work with the new format log files in patch 1.12 936.11 onwards of Command -

** DO NOT USE THIS VERSION OF SEAHAG WITH OLDER INSTALLATIONS BEFORE 1.12 936.11 ** IT WILL NOT WORK

Dates / time format string tags are now definable with regular expressions to cope with international formats or 24 hour clocks, and other padding characters. This is because the date time strings stored from CMANO are in local date time formats, not my doing.


example 1
07/08/75 9:30:00 PM - .....

DATE EXPRESSION REGEXP = ".* (AM|PM) - " The default - ignore the double quotes but DO include the spaces and press the button above date regexp to return to default.

example 2
16.07.2011 11:03:46 - ....
DATE EXPRESSION REGEXP = "(0?[1-9]|[12][0-9]|3[01]).(0?[1-9]|1[0-2]).\d\d\d\d (00|[0-9]|1[0-9]|2[0-3]):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]) - "

Ambient Sound tabs save ok now, Use the +/- buttons at the top of the first column to add or delete speech or ambient sound lines. ( thanks Nukkxx for spotting the bug)

My thanks also to bradinggs,commanderchrisp and bomber49 for testing the updates.

==========================================================================================

------------------------------

What does it need to run?
.NET 4.0 same as CMANO
Either Microsoft Speech - present in most modern versions of Windows by default.
or use eSpeak - http://espeak.sourceforge.net/
or any external speech/other command - use other with care....runs an external process to run any other programs but if you know what you are doing this is VERY powerful, eg transmission to web or syslog or anything else.

------------------------------------

SeaHag uses the CMANO logfiles to monitor the action - so no nasty intrusive programs breaking CMANO - and it does not mess about with CMANO in nasty ways.

However if you cant see information you want spoken in the logs - I cannot process it - so no I cant give you voice response for selecting a unit unless the devs send it to the logs.

Installation -

Extract the zip file to a directory that you want to run SeaHag from - thats it, maybe create a shortcut on your desktop.

Start SeaHag and for the first time only click "Default Speech" and "Default Sounds" then click save settings. < YOU MUST DO THIS PART >

It can autodetect the side selection and can detect side changes when you load a savegame now.

Whats new in 1.0i
Change - Changes around date and time processing to reflect CMANO players with different date formats.

Whats new in 1.0h

Bugfix - RegEXP not processing the first RegEXP expression fixed. ( Thanks Rangoon )
Bugfix - A STOP flag in the Reprocess / Continue / Stop column will prevent that line from being spoken at all. ( Thanks jbaxter1964 )
And some small tweaks/tidy ups that should not change functionality

Whats new in 1.0g

Steam users can now set the logfile directory if the registry settings are not found from the Matrix Version - no other changes.

Whats new in 1.0f

- Full expanding editing grid for those with complex rulebases.
- Ability to test speech items and pass a test line immediately through the engine. ( Handy when working with complex lines )
Put the text in the box next to "Parse Line" and click the button "Parse Line" to test how the rules would process the line if found in the log. ( Do a copy and paste from a log file line - it will need the whole line )
- Autodetect savegame loads and skip old messages until the side change is detected.
- New application instance so does not overwrite the old settings files. But does use a new settings file.
- Regular expressions - VERY powerful - and sorry - it may be tricky to understand for the uninitiated, cant change that - its just how things are.
- * wildcard for replace - changes all occurrences in the line ( put the * in the reduce char box )
- created a workaround for Microsoft dotnet library settings not storing fields which contained just a space.

===============================================


Quickstart -

Run SeaHag - ALWAYS BEFORE CMANO - and let it autodetect and do its piece if starting afresh.

- Or you can turn off "autodetect side" and it will get the announcements of both (all) sides if you really want it.

Only for the first run ....Click DEFAULT SOUND GRID and DEFAULT SPEECH GRID, then click SAVE SETTINGS.
** Note this applies even if you were using an older version ** I could automate this but you never know how people use this so I left it as manual.

If the date / time in your CMANO log files does not look like the following you will need a custom REGEXP string - use google to find what you need here.
07/08/75 9:30:00 PM - ............ <----- This is the default in my timezone

Seahag will need you to regexp up to and including the space after the minus sign.

Then click "START SeaHag"

SeaHag will look up the CMANO home directory automatically ( from the registry),
it processes the log files automatically and detects new ones on its own and will autoswitch to new log files automatically. ( unless you tell it not to ) by default.

New CheckBoxes on the screen.

AutoDetect Playerside - as it says - allows auto detection of the playerside by SeaHag.

SaveGame Force Wait for Playerside - When SeaHag detects a new logfile it will skip all messages until a side selection line is found, it stops issues when you load a savegame ( Used to cause unwanted messages otherwise )
do not turn this on when autodetect playerside is off - you wont hear anything.

Reset Playerside on new file - If you start a new game then CMANO creates a new logfile and now SeaHag clears the playside so it can pick up the new one.

So you never really need to mess with SeaHag now - it does most things on its own.

=======================

Rule Base Details

Each line read from the logfile is parsed down through the rules changing as it goes.

REDUCE - These rules look for the trigger text then reduce line length ending at the chosen character.

REPLACE - These rules look for the trigger text then replace it with the replacement text - only the 1st occurrence unless you put a * in the reduce char box.
You cannot do a REGEX or a REPLACE with nothing - use a space if you want to remove the item.
Autolimited to a max of 20 replaces when using a wildcard *.

BOTH - Does both actions - a REDUCE then a REPLACE

REGEX - runs a regular expression substitution - advanced substitution of strings.

FIND - allows SeaHag to speak the line - if you do not have a find then SeaHag will not say anything.

REGEX means regular expressions - they are VERY powerful but also hard to learn if you have not seen one before.

I am not going to explain regular expressions here - Good references for REGEX are -

https://msdn.microsoft.com/en-us/librar ... 10%29.aspx
https://msdn.microsoft.com/en-us/librar ... 10%29.aspx

And a quick reference card -> here
http://download.microsoft.com/download/ ... erence.pdf

There are examples in the default tables, and you can look at those to get used to REGEX lines and how to use them.

If you find them too hard - you can get most of the functionality out of the normal SeaHag functions.
But you will not be able to do some of the clever manipulations of conditional text.

REMEMBER !!! - REDUCES or REPLACES or BOTH or REGEX ( BOTH does a REDUCE then a REPLACE ) - Do NOT trigger speech – only a successful FIND will trigger speech.

Generally REDUCE, REPLACE, BOTH and REGEX do NOT want to have repeat prevention turned on - but I have included the option in case its needed.

It is FINDS - that you would put repeat prevention times on if you find it too chatty.

The speech level box sets the current level of speech and you will notice the rules have a min and max speech level on them - if the level is above the max or below the minimum that rule will not run.

=======================================================

The two tabs Speech and Ambient are the trigger filters.

A line is passed down through each speech filter line unless a STOP ( Last but one column ) is hit.

Reprocess allows you to send the line back to the start of the rules again - auto loop protection is built in at 5 times through the rulebase

=======================================================

*NOTE* That older XP users may also benefit from installing the following Microsoft update for Speech, otherwise you will just get the (very)old Microsoft SAM speech.

http://www.microsoft.com/en-au/download ... x?id=10121

=======================================================

The application setting are stored in
On Win XP - C:\Documents and Settings\<username>\Local Settings\Application Data\SeaHag.exe_<identifier>\1.0.0.0\user.config
On Win 7 - C:\Users\<username>\AppData\Local\SeaHag.exe\<identifier>\1.0.0.0\user.config

Back this file up if you have added lots of filters or sounds. May change for version updates.


You can buy advanced voice synthesis from AT&T, I bought the Audrey Voice - the quality is exceptional.
Found it at http://www.nextup.com/attnv.html

========================================================

Use a FIND with a search text of * on its own if you want to find all speech lines – a bit too chatty if you don’t have enough REDUCE filters, other wildcard options are not added as of yet.

The default action of a line is to “CONTINUE” to process the table upon a match, a STOP will stop processing the table at that point.

Use sound files to add effects which trigger just before the speech to increase immersion.

Use a speech REPLACE with the search text of @ to just trigger the sound launch.

The continuous flag for ambient sound will cause the sample to automatically loop constantly, good options here are control room or radio chatter.

The attached samples are good for control room background noises.

The percentage chance of an ambient sound triggering will be tested and if not successful the replay prevention will be added to the next play trigger.

This means that if a sound has a 40% chance of playing and a 60 second replay prevention then if the sound DOES or DOES NOT play the replay prevention will not have the possibility of playing for another 60 seconds.

If you turn off the voice check box and optionally the "more diagnostics" checkbox you can test filters quickly without waiting for the voice to run. **Remember to turn voice back on, or leave it off if you don't want voice and just use the Ambient and Triggered sound options.

*NOTE* The stop button may have to be pressed more that once, the sounds and speech are higher priority that button detection.

Thanks

Thanks to the Devs for such a great simulation.

MP3/MP2/MP1/OGG/WAV/AIFF Files can be used.

In theory the files can be any size, but the smaller the better really.


My Thanks to the creators of the BASS libraries – awesome library guys thanks.


Disclaimer.

SeaHag is provided as is, the use of this software is done so solely at your own risk.
It is a condition of the use of this software that I am not liable for any damage as a result of its use.

Copyright.

You may use this software free of charge. You may not charge for its distribution or profit from its distribution in any way.

You may not reverse engineer or reduce the binary back to source code form. You may not distribute its source code.

You may distribute SeaHag but you may not do so as your own or someone elses work, it took my time to build it.



Thank you.

Sluggy

Attachments
SeaHag10k.zip
(1.05 MiB) Downloaded 1845 times
jjmauzey
Posts: 8
Joined: Thu Oct 17, 2013 12:25 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by jjmauzey »

Nice job sluggy, I am Checking it now.

Great Idea.
Thanks, Jeff~
User avatar
Dide
Posts: 179
Joined: Sun May 10, 2009 10:42 am
Location: Italy

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by Dide »

Good job![:D] I like the old voices of harpoon II/III, but i don't know how extracting of my boxed game. Any idea? Thanks!
RoryAndersonCDT
Posts: 1826
Joined: Mon Jun 15, 2009 11:45 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by RoryAndersonCDT »

Looks pretty cool!
Command Dev Team
Technical Lead
smudge56
Posts: 667
Joined: Sat Jan 17, 2009 8:31 am
Location: UK

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by smudge56 »

I will look at this thanks mate for your effort.
AKA - Smudge
jjmauzey
Posts: 8
Joined: Thu Oct 17, 2013 12:25 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by jjmauzey »

sluggy, is there a way to configure the text to speech engine to read out long numbers singly? IE: instead of "three hundred and fifty thousand" -> "three five zero five zero zero"

Thanks, Jeff~
GBS
Posts: 899
Joined: Wed Jul 03, 2002 2:14 am
Location: Southeastern USA

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by GBS »

Not being so computer savvy, I'm a little afraid of this. To make sure I understand, does this put voice in to the game announcing certain events like those that appear in the Message Log?
"It is well War is so terrible lest we grow fond of it." -
R. E. Lee

"War..god help me, I love it so." - G. Patton
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by sluggy2010 »


There is now mate - how about that for quick turnaround [:)]
Added as a check box option re-download to get version 1.0a

Regards

Sluggy
jjmauzey
Posts: 8
Joined: Thu Oct 17, 2013 12:25 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by jjmauzey »

Great, can't wait to try it out with numbers enunciated, Thanks sluggy
Thanks, Jeff~
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by sluggy2010 »

Yes mate it does - and also adds ambient sounds if you want.

It does not mess about with the Command program - it reads the logs generated by command and you just run it before running the command simulation.

At present the procedure for first time use is as follow.

1) Extract the zip file to a new folder somewhere you choose.
2) Run SeaHag
3) First Time only Click Default Speech Grid, then click Default Sound Grid, then Click Save Settings.
4) Exit SeaHag.
5) Start SeaHag again and ensure you can see the filter entries in the grids at the bottom of the window - if not go back to step 3
6) Each time you run SeaHag now ( until the next version ) you will need to enter the side you will be playing in game - see the red writing - enter your side ( Capitals sensitive ) into the field and click Start SeaHag
7) Now run Command - SeaHag will autodetect the logfiles and just get on with it.
8) If you finish that scenario then you only need to go back to SeaHag and click stop then enter the new side you will be playing and click start again.

Side detection will be automatic when the Dev's push out beta 452 as they kindly added the text to the logs that I needed.

In fact now that I think about it, for the less computer savvy, I'll make it auto do steps one-three above and start automatically as well

Regards

Sluggy

GBS
Posts: 899
Joined: Wed Jul 03, 2002 2:14 am
Location: Southeastern USA

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by GBS »

Wow that is pretty impressive! I'll try to follow your instructions.
"It is well War is so terrible lest we grow fond of it." -
R. E. Lee

"War..god help me, I love it so." - G. Patton
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by sluggy2010 »


One last thing while I remember.

You can buy advanced voice synthesis from AT&T, I bought the Audrey Voice - ok $60 but the quality is exceptional.
Found it at http://www.nextup.com/attnv.html

An example of the high quality of ( I can only vouch for Audrey ) is attached.

Regards

Sluggy
Attachments
AudreyExample.zip
(477.82 KiB) Downloaded 308 times
GBS
Posts: 899
Joined: Wed Jul 03, 2002 2:14 am
Location: Southeastern USA

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by GBS »

No luck for me, no voices when I run the game. Confused a little on naming my side. I was playing Caribbean Crisis as Netherlands.

In the side space side I typed "Nehterlands" then started CMANO. Did I do this correctly? I had already completed the other steps as prescribed.
"It is well War is so terrible lest we grow fond of it." -
R. E. Lee

"War..god help me, I love it so." - G. Patton
pandoraefretum
Posts: 118
Joined: Fri Sep 27, 2013 2:59 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by pandoraefretum »

Great stuff... Well done Sluggy!
Yes, the "Audrey" sounds very high class... I like it
Anna, the default 64-bit Win 7 voice is not very inspiring.
How do I change her ? (might get Audrey... I am tempted)
Lastly, do you know if "Audrey" works with the default Microsoft Speech API (64bit win7) ?
(or do you have to get "TextAloud" to hear Audrey?

cheers!
Pando
User avatar
airwinger63
Posts: 53
Joined: Thu Sep 26, 2013 7:49 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by airwinger63 »

Evening,

I get the following error when I try to run the execute file, seahag.exe is not a valid Win32 application. I'm running Windows XP w/ SP-3 installed on a Asus Px6D58 motherboard with an Intel i7 950 @ 3.07.

Airwinger63
IYAOYAS

If You Ain't Ordnance You Ain't Shit.
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by sluggy2010 »

**FILE ATTACHMENT REMOVED - NO LONGER TWO VERSIONS **

See top posting
sluggy2010
Posts: 122
Joined: Wed Oct 02, 2013 1:09 am

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by sluggy2010 »


Yep that should be right, do you get sound Fx but no Speech or nothing?

As long as you clicked "Start SeaHag" it should announce its successful start.

I can try to help but need the following info -

Windows Version.
Screen shot of SeaHag and a copy of the log entries in the the log windows ( highlight the text in the log window ) with CTRL_A then CTRL_C to copy - Remember to Check the box marked "more diagnostics" before running.

Then paste that into a post here on the board.

Regards

Sluggy
pandoraefretum
Posts: 118
Joined: Fri Sep 27, 2013 2:59 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by pandoraefretum »

Hi Sluggy,

I purchased TextAloud and Audrey as per your recommendation.
Can you show me what to enter in SeaHag to make it work ?
(I have entered it into external prog but I must be missing a setting within TextAloud perhaps?)

Thanks mate,
cheers, Pando
pandoraefretum
Posts: 118
Joined: Fri Sep 27, 2013 2:59 pm

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by pandoraefretum »

I see now I needn't have bought TextAloud as Audrey16 can be activated and used with the MS Speech API on 64bit Win7 easily enough by pasting

%windir%\SysWOW64\speech\SpeechUX\sapi.cpl

into the browser to change the default voice.

Oddly Anna was replacing Sqn with Squadron while Audrey16 cannot ... am working on it...
Got it.. a SPACE character after the replacement word Squadron was all that was needed.
Now I am replacing BOGEY, which Audrey pronounced strangely... nor can she say the word "air" !
BUT I must admit Audrey16 is a much more soothing voice than the default Win7 Anna
User avatar
jomni
Posts: 2827
Joined: Mon Nov 19, 2007 12:31 am
Contact:

RE: [RELEASED] Speech and Ambient Sound Module - files attached

Post by jomni »

SIRI for Command. Wish I can speak to it as well.
Post Reply

Return to “Command: Modern Operations series”