README, word-phoneme dict, phoneme progress script

- Updated README a little
- Added a word-to-phoneme dictionary (CMU open source)
- Added a Python script to track progress on phonemes
This commit is contained in:
Brandon Thomas committed 2016-08-22 02:16:47 -04:00
1 parent 4f79e3d719
commit 5d56da645a
3 files changed
+133999

No files matched your search

+27
View File
@@ -9,3 +9,30 @@ Running the server
1. Install Rust >= 1.1.0
2. `cargo run`
Phoneme
-------
- [CMU Dictionary](http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/),
which uses [Arpabet](https://en.wikipedia.org/wiki/Arpabet).
- 54 units in the Arpabet:
- Vowels:
- 10 monophthongs
- 5 diphthongs
- 8 R-colored vowels
- Consonants:
- 6 Stops
- 2 Affricates
- 9 Fricatives
- 6 Nasals
- 5 Liquids
- 3 Semivowels
Diphones
--------
Generate a list of phoneme 2-tuples.
Unit Selection
--------------
- Combine multiple sources into final output (words, phonemes, diphones)
- Have alternatives (words, phonemes) that pair better with others.
- Optimize joining on a score (start/ending pitch, tempo, etc.)
+133910
View File
File diff suppressed because it is too large. Load diff
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env python2
# Show how many phonemes remain
from os import path
import os
import re
DICTIONARY_FILE = '/home/bt/dev/trumpet/dictionary/cmudict-0.7b'
PHONE_DIR = '/home/bt/Dropbox/jungle.horse/sounds/trump/_phonemes'
def current_phonemes():
"""
Gets the current set of phoneme wav files.
Returns a frozenset of strings.
"""
phonemes = []
for p in os.listdir(PHONE_DIR):
if not p.endswith('.wav'):
continue
phonemes.append(p.replace('.wav', ''))
return frozenset(phonemes)
def all_phonemes():
"""
Read the CMU Word-Phoneme dictionary and extract the phoneme set.
Returns a frozenset of strings.
"""
lines = []
with open(DICTIONARY_FILE) as f:
lines = f.readlines()
lines = [l for l in lines if re.match("^\w+", l)]
phonemes = set()
for l in lines:
word_phones = l.split()[1:]
for w in word_phones:
phonemes.add(w)
return frozenset(phonemes)
current = current_phonemes()
phonemes = all_phonemes()
print "\nAll Phonemes: {}\n".format(len(phonemes))
li = list(phonemes)
li.sort()
print li
print "\nCurrent Phonemes: {}\n".format(len(current))
li = list(current)
li.sort()
print li
missing = phonemes - current
print "\nMissing Phonemes: {}\n".format(len(missing))
li = list(missing)
li.sort()
print li