VOX Updated to limit max words per statement. (No more spamming voxtest2.)

This commit is contained in:
Rob Nelson
2014-06-27 21:10:20 -07:00
parent 24902ee817
commit 663ded5f3f
11 changed files with 72 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
// AUTOMATICALLY GENERATED, DO NOT EDIT.
// List is required to compile the resources into the game when it loads.
// Dynamically loading it has bad results with sounds overtaking each other, even with the wait variable.
var/list/vox_sounds = list(
"," = 'sound/vox/,.wav',
"." = 'sound/vox/..wav',
@@ -254,6 +254,7 @@ var/list/vox_sounds = list(
"escape" = 'sound/vox_fem/escape.ogg',
"evacuate" = 'sound/vox_fem/evacuate.ogg',
"every" = 'sound/vox_fem/every.ogg',
"everywhere" = 'sound/vox_fem/everywhere.ogg',
"exchange" = 'sound/vox_fem/exchange.ogg',
"execution" = 'sound/vox_fem/execution.ogg',
"exit" = 'sound/vox_fem/exit.ogg',
@@ -332,6 +333,7 @@ var/list/vox_sounds = list(
"hacking" = 'sound/vox_fem/hacking.ogg',
"handling" = 'sound/vox_fem/handling.ogg',
"hangar" = 'sound/vox_fem/hangar.ogg',
"happening" = 'sound/vox_fem/happening.ogg',
"harm" = 'sound/vox_fem/harm.ogg',
"has" = 'sound/vox_fem/has.ogg',
"have" = 'sound/vox_fem/have.ogg',
@@ -388,6 +390,8 @@ var/list/vox_sounds = list(
"k" = 'sound/vox_fem/k.ogg',
"key" = 'sound/vox_fem/key.ogg',
"kill" = 'sound/vox_fem/kill.ogg',
"killed" = 'sound/vox_fem/killed.ogg',
"killing" = 'sound/vox_fem/killing.ogg',
"kilo" = 'sound/vox_fem/kilo.ogg',
"kit" = 'sound/vox_fem/kit.ogg',
"kitchen" = 'sound/vox_fem/kitchen.ogg',
@@ -429,7 +433,9 @@ var/list/vox_sounds = list(
"magnetic" = 'sound/vox_fem/magnetic.ogg',
"main" = 'sound/vox_fem/main.ogg',
"maintenance" = 'sound/vox_fem/maintenance.ogg',
"malf" = 'sound/vox_fem/malf.ogg',
"malfunction" = 'sound/vox_fem/malfunction.ogg',
"malfunctioning" = 'sound/vox_fem/malfunctioning.ogg',
"man" = 'sound/vox_fem/man.ogg',
"mass" = 'sound/vox_fem/mass.ogg',
"materials" = 'sound/vox_fem/materials.ogg',
@@ -717,6 +723,7 @@ var/list/vox_sounds = list(
"traitor" = 'sound/vox_fem/traitor.ogg',
"traitors" = 'sound/vox_fem/traitors.ogg',
"transportation" = 'sound/vox_fem/transportation.ogg',
"triggering" = 'sound/vox_fem/triggering.ogg',
"truck" = 'sound/vox_fem/truck.ogg',
"tunnel" = 'sound/vox_fem/tunnel.ogg',
"turn" = 'sound/vox_fem/turn.ogg',
@@ -807,4 +814,21 @@ var/list/vox_sounds = list(
"zero" = 'sound/vox_fem/zero.ogg',
"zone" = 'sound/vox_fem/zone.ogg',
"zulu" = 'sound/vox_fem/zulu.ogg',
)
// How long each "word" really is (in words). Single-word phrases are skipped for brevity.
var/list/vox_wordlen = list(
"ce" = 2,
"cmo" = 3,
"hop" = 3,
"hos" = 3,
"iaa" = 3,
"rd" = 2,
"shitlord" = 2,
"ss13" = 3,
"vox_420" = 4,
"voxtest" = 3,
"voxtest2" = 42,
"voxtest3" = 22,
"woody" = 2,
)

View File

@@ -91,6 +91,7 @@ var/const/VOX_DELAY = 600
if(words.len > 30)
words.len = 30
var/total_word_len=0
for(var/word in words)
word = lowertext(trim(word))
if(!word)
@@ -98,6 +99,14 @@ var/const/VOX_DELAY = 600
continue
if(!vox_sounds[word])
incorrect_words += word
// Thank Rippetoe for this!
var/wordlen = 1
if(word in vox_wordlen)
wordlen=vox_wordlen[word]
if(total_word_len+wordlen>50)
src << "<span class='notice'>There are too many words in this announcement.</span>"
return
total_word_len+=wordlen
if(incorrect_words.len)
src << "<span class='notice'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>"

Binary file not shown.

BIN
sound/vox_fem/happening.ogg Normal file

Binary file not shown.

BIN
sound/vox_fem/killed.ogg Normal file

Binary file not shown.

BIN
sound/vox_fem/killing.ogg Normal file

Binary file not shown.

BIN
sound/vox_fem/malf.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -36,12 +36,12 @@ THE SOFTWARE.
##Voice you want to use
#VOICE='rab_diphone'
# This is the nitech-made ARCTIC voice, tut on how to install:
# http://ubuntuforums.org/showthread.php?t=751169 ("Installing the enhanced CMU Arctic voices" section)
# http://ubuntuforums.org/showthread.php?t=751169 ("Installing the enhanced Nitech HTS voices" section)
#VOICE='nitech_us_bdl_arctic_hts'
#VOICE='nitech_us_jmk_arctic_hts'
#VOICE='nitech_us_awb_arctic_hts'
VOICE='nitech_us_slt_arctic_hts' # DEFAULT, less bored US female
#VOICE='nitech_us_clb_arctic_hts' # OLD default: bored US female (occasionally comes up with british pronunciations?!)
VOICE='nitech_us_slt_arctic_hts' # less bored US female
#VOICE='nitech_us_clb_arctic_hts' # DEFAULT, bored US female (occasionally comes up with british pronunciations?!)
#VOICE='nitech_us_rms_arctic_hts'
#PHONESET='mrpa'
@@ -49,34 +49,34 @@ PHONESET=''
# What we do with SoX:
SOX_ARGS = ''
SOX_ARGS += ' pitch -500' # Lol I male now
SOX_ARGS += ' pitch -500'
SOX_ARGS += ' stretch 1.2' # Starts the gravelly sound, lowers pitch a bit.
#SOX_ARGS += ' synth tri fmod 60'
SOX_ARGS += ' synth sine amod 60' # Now REALLY gravelly.
SOX_ARGS += ' synth sine amod 60'
#SOX_ARGS += ' synth tri amod 60'
SOX_ARGS += ' chorus 0.7 0.9 55 0.4 0.25 2 -t'
SOX_ARGS += ' phaser 0.9 0.85 4 0.23 1.3 -s'
SOX_ARGS += ' compand 0.01,1 -90,-90,-70,-70,-60,-20,0,0 -5 -20' # Dynamic range compression.
SOX_ARGS += ' echos 0.8 0.5 100 0.25 10 0.25' # Good with stretch, otherwise sounds like bees.
SOX_ARGS += ' bass -40'
SOX_ARGS += ' highpass 22 highpass 22'
SOX_ARGS += ' compand 0.01,1 -90,-90,-70,-70,-60,-20,0,0 -5 -20' # Dynamic range compression.
SOX_ARGS += ' echos 0.8 0.5 100 0.25 10 0.25' # Good with stretch, otherwise sounds like bees.
#SOX_ARGS += ' delay 0.5'
SOX_ARGS += ' norm'
# Have to do the trimming seperately.
PRE_SOX_ARGS = 'trim 0 -0.1' # Trim off last 0.1s.
PRE_SOX_ARGS = 'trim 0 -0.1' # Trim off last 0.2s.
# Shit we shouldn't change or overwrite. (Boops, pauses, etc)
preexisting=[
'.',
',',
'bloop',
'bizwarn', # Is this a misspelling of the below?
'buzwarn',
'doop',
'dadeda',
'woop',
]
preexisting = {
'.':1,
',':1,
'bloop':1,
'bizwarn':1, # Is this a misspelling of the below?
'buzwarn':1,
'doop':1,
'dadeda':1,
'woop':1,
}
################################################
## ROB'S AWFUL CODE BELOW (cleanup planned)
@@ -84,10 +84,10 @@ preexisting=[
REGEX_SEARCH_STRINGS = re.compile(r'(\'|")(.*?)(?:\1)')
wordlist=[]+preexisting
othersounds=[]
known_phonemes={}
wordlist = dict(preexisting.items())
def md5sum(filename):
md5 = hashlib.md5()
@@ -208,7 +208,7 @@ def GenerateForWord(word,wordfile):
logging.info('Skipping {0}.ogg (Marked as PRE_EXISTING)'.format(wordfile))
return
if '/' not in wordfile:
wordlist += [wordfile]
wordlist[wordfile] = len(word.split(' '))
else:
othersounds += [wordfile]
md5=hashlib.md5(word).hexdigest()
@@ -312,11 +312,11 @@ soundsToKeep=set()
for sound in othersounds:
soundsToKeep.add(sound+'.ogg')
with open(os.path.join(CODE_BASE,'vox_sounds.dm'),'w') as w:
w.write("// AUTOMATICALLY GENERATED, DO NOT EDIT.\n")
w.write("// List is required to compile the resources into the game when it loads.\n")
w.write("// Dynamically loading it has bad results with sounds overtaking each other, even with the wait variable.\n")
w.write("\n")
w.write("var/list/vox_sounds = list(\n")
for word in sorted(wordlist):
for word,wordlen in sorted(wordlist.items()):
if '/' in word:
continue
filename=''
@@ -327,6 +327,15 @@ with open(os.path.join(CODE_BASE,'vox_sounds.dm'),'w') as w:
w.write('\t"{0}" = \'{1}\',\n'.format(word,filename))
soundsToKeep.add(filename)
w.write(')')
w.write('\n\n// How long each "word" really is (in words). Single-word phrases are skipped for brevity.')
w.write('\nvar/list/vox_wordlen = list(\n')
for word,wordlen in sorted(wordlist.items()):
if wordlen == 1: continue
if '/' in word:
continue
w.write('\t"{0}" = {1},\n'.format(word,wordlen))
w.write(')')
for root, dirs, files in os.walk('sound/', topdown=False):
for name in files:

View File

@@ -687,6 +687,7 @@ engineer
engineering
engineers
every
everywhere
execution
fire
fore
@@ -696,6 +697,7 @@ gray
hacker
hackers
hacking
happening
harm
hop = Head of Personnel
hos = Head of Security
@@ -705,12 +707,16 @@ hunger
hydroponics
iaa = internal affairs agent
kitchen
killed
killing
law
laws
lawyer
lizard
loose
love
malfunctioning
malf
me
medbay
mommi = mommy
@@ -768,6 +774,7 @@ tide
toxins
traitor
traitors
triggering
update
updated
updating