From 49547edf4224e2d7b0bb7140931a82bcbc028722 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 15 Oct 2016 23:32:16 -0400 Subject: [PATCH] 5-phones --- BUGS.md | 48 +++++++++++++++++++++++++++++++++++++++++ FIX_PHONEMES.md | 5 +++++ dictionary/NEEDED.md | 2 +- dictionary/cmudict-0.7b | 16 +++++++------- src/audiobank.rs | 9 +++++++- src/synthesizer.rs | 39 +++++++++++++++++++++++++++++++++ 6 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 BUGS.md diff --git a/BUGS.md b/BUGS.md new file mode 100644 index 0000000000..357832af06 --- /dev/null +++ b/BUGS.md @@ -0,0 +1,48 @@ +Things that break +================= + +On A.I., +and @GovGaryJohnson. +RT @Cole_No_Slaw: +Dems' plans +Dem +only $29.99! +Thank you to our U.S. Navy + #TheGreaterGood. + at 2:00pm! + 60-66% +140K + w/ corporate + + +Times +----- +2:00pm two p m +7:30pm seven thirty p m +5:30ET five thirty eastern time +9pm ET nine p m eastern time +8pm ET eight p m eastern time +8:00 P.M. eight p m +9 p.m. ET nine p m eastern time + +units: +- AM, a.m. +- et, pt, ET, PT + +2:00pm -> 2:00 pm +7:30p.m. -> 7:30 p.m. +9pm -> 9 pm +8:00pm -> 8:00 pm +5:30ET +9pm ET +8pm ET +8:00 P.M. +9 p.m. ET + +TimeWord + - am, a.m., AM, A.M. + - pm, p.m., PM, P.M. + - ET, PT + +\d:\d+\s?[(am)|(pm)] + diff --git a/FIX_PHONEMES.md b/FIX_PHONEMES.md index 4fd77737bb..3307d50d72 100644 --- a/FIX_PHONEMES.md +++ b/FIX_PHONEMES.md @@ -2,3 +2,8 @@ - K as in killing (K IH1 L IH0 NG) - IH1 as in killing (K IH1 L IH0 NG) - IH0 as in convict (K AA1 N V IH0 K T) + +Fix problems: +------------- +1M lives +November 8, diff --git a/dictionary/NEEDED.md b/dictionary/NEEDED.md index 17e758e9da..731a364818 100644 --- a/dictionary/NEEDED.md +++ b/dictionary/NEEDED.md @@ -22,11 +22,11 @@ patreon paypal pringles ramen +sanic strudel sucky there's triforce -troglodyte tweens typescript undressing diff --git a/dictionary/cmudict-0.7b b/dictionary/cmudict-0.7b index 65485a10e0..d722e5df73 100644 --- a/dictionary/cmudict-0.7b +++ b/dictionary/cmudict-0.7b @@ -9007,8 +9007,8 @@ BASING B EY1 S IH0 NG BASINGER B EY1 S IH0 NG ER0 BASINS B EY1 S AH0 N Z BASINSKI B AH0 S IH1 N S K IY0 -BASIS B EY1 S AH0 S -BASIS(1) B EY1 S IH0 S +BASIS(1) B EY1 S AH0 S +BASIS B EY1 S IH0 S BASISTA B AH0 S IH1 S T AH0 BASIX B EY1 S IH0 K S BASK B AE1 S K @@ -92193,8 +92193,8 @@ PLACENTA P L AH0 S EH1 N T AH0 PLACENTIA P L AH0 S EH1 N SH AH0 PLACER P L AE1 S ER0 PLACER(1) P L EY1 S ER0 -PLACES P L EY1 S AH0 Z -PLACES(1) P L EY1 S IH0 Z +PLACES(1) P L EY1 S AH0 Z +PLACES P L EY1 S IH0 Z PLACETA P L AH0 S EY1 T AH0 PLACETAS P L AH0 S EY1 T AH0 Z PLACEWAY P L EY1 S W EY2 @@ -100571,8 +100571,8 @@ RESOURCEFULNESS R IY0 S AO1 R S F AH0 L N AH0 S RESOURCES R IY1 S AO0 R S IH0 Z RESOURCES' R IY1 S AO0 R S IH0 Z RESPEAK R IY2 S P IY1 K -RESPECT R IH0 S P EH1 K T -RESPECT(1) R IY0 S P EH1 K T +RESPECT(1) R IH0 S P EH1 K T +RESPECT R IY0 S P EH1 K T RESPECTABILITY R IY0 S P EH2 K T AH0 B IH1 L IH0 T IY0 RESPECTABLE R IH0 S P EH1 K T AH0 B AH0 L RESPECTABLE(1) R IY0 S P EH1 K T AH0 B AH0 L @@ -107929,8 +107929,8 @@ SEMROW S EH1 M R OW0 SEMTEX S EH1 M T EH0 K S SEN S EH1 N SENA S EH1 N AH0 -SENATE S EH1 N AH0 T -SENATE(1) S EH1 N IH0 T +SENATE(1) S EH1 N AH0 T +SENATE S EH1 N IH0 T SENATE'S S EH1 N IH0 T S SENATOR S EH1 N AH0 T ER0 SENATOR'S S EH1 N AH0 T ER0 Z diff --git a/src/audiobank.rs b/src/audiobank.rs index c1daa71435..a6647bda23 100644 --- a/src/audiobank.rs +++ b/src/audiobank.rs @@ -134,8 +134,15 @@ impl Audiobank { n_phone[0], n_phone[1], n_phone[2], n_phone[3]), ) }, + 5 => { + ( + "5-phones/", + format!("{}_{}_{}_{}_{}.wav", + n_phone[0], n_phone[1], n_phone[2], n_phone[3], n_phone[4]), + ) + }, _ => { - return None; // Don't support more than 4-phones. + return None; // Don't support more than 5-phones. } }; diff --git a/src/synthesizer.rs b/src/synthesizer.rs index 3c7742a708..65ee503bb8 100644 --- a/src/synthesizer.rs +++ b/src/synthesizer.rs @@ -352,6 +352,45 @@ impl Synthesizer { debug.push(None); } + // 5-phone + if polyphone.len() >= 5 { + let range = polyphone.len() - 4; + for i in 0..range { + if fulfilled[i] + || fulfilled[i+1] + || fulfilled[i+2] + || fulfilled[i+3] + || fulfilled[i+4] { + continue; + } + + let candidate_n_phone = &polyphone[i..i+5]; + + let sample_preference = match i { + 0 => { SamplePreference::Begin }, + _ if i == range - 1 => { SamplePreference::End }, + _ => { SamplePreference::Middle }, + }; + + //println!("n-phone: {:?}", candidate_n_phone); + let phone = self.audiobank.get_n_phone(speaker.as_str(), + candidate_n_phone, + sample_preference, + use_ends); + + if phone.is_some() { + chunks[i] = phone; + debug[i] = Some(polyphone[i..i+5].join("_")); + + for j in i..i+5 { + fulfilled[j] = true; + } + } + } + } + + info!(target: "synthesis", "5-fulfilled: {:?}", fulfilled); + // 4-phone if polyphone.len() >= 4 { let range = polyphone.len() - 3;