[RELEASED] Speech and Ambient Sound Module - Updated CMANO 1.12 936.11
Posted: Tue Nov 05, 2013 1:35 am
---------------------
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