diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | country_roads.txt | 29 | ||||
-rwxr-xr-x | numbers-station.raku | 55 |
3 files changed, 87 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b0a62a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# make your own voice files +*.wav + diff --git a/country_roads.txt b/country_roads.txt new file mode 100644 index 0000000..391d1d5 --- /dev/null +++ b/country_roads.txt @@ -0,0 +1,29 @@ +Almost heaven, West Virginia +Blue Ridge Mountains, Shenandoah River +Life is old there, older than the trees +Younger than the mountains, growin' like a breeze + +Country roads, take me home +To the place where I belong +West Virginia, mountain momma +Take me home, country roads + +All my memories gathered 'round her +Miner's lady stranger to blue water +Dark and dusty painted on the sky +Misty taste of moonshine, teardrop in my eye + +Country roads, take me home +To the place I belong +West Virginia, mountain momma +Take me home, country roads + +I hear her voice, in the mornin' hour she calls me +Radio reminds me of my home far away +And driving down the road I get a feeling +I should have been home yesterday, yesterday + +Country roads, take me home +To the place where I belong +West Virginia, mountain momma +Take me home, country roads diff --git a/numbers-station.raku b/numbers-station.raku new file mode 100755 index 0000000..82a993d --- /dev/null +++ b/numbers-station.raku @@ -0,0 +1,55 @@ +#!/usr/bin/raku + +# This is a numbers station script +# It converts letters into numbers and says those numbers +# +# Based on the Major System +# 0 : s z +# 1 : t d th +# 2 : n +# 3 : m +# 4 : r +# 5 : l +# 6 : ch g sh c +# 7 : k g ch (like, bach the musician) ck +# 8 : f v +# 9 : p b +# : h j w +# +# This script will need to: +# 1. somehow know the proper puncication of each word ( probably impossible to accurately impliment :( +# 2. convert each word into numbers +# 3. play the sound for each numbers +# 3.1. add a space between each number set + +my $audio_location = './audio/'; +my $audio_extension = '.wav'; +my %numberlist = (1 => <1a 1b 1c>, 2 => <2a 2b 2c>, 3 => <3a 3b 3c>, 4 => <4a 4b 4c>, 5 => <5a 5b 5c>, 6 => <6a 6b 6c>, 7 => <7a 7b 7c>, 8 => <8a 8b 8c>, 9 => <9a 9b 9c>, 0 => <0a 0b 0c>); + +my $file = w2n(open('country_roads.txt')); + +#say "$audio_location, $audio_extension, " ~ %numberlist{1}[].roll; + +# words to number +sub w2n($file) { + my @n = $file.words; + for @n <-> $word { + $word ~~ s :g:i /(ch)|g|(sh)|c/6/; + $word ~~ s :g:i /s|z/0/; + $word ~~ s :g:i /t|d|(th)/1/; + $word ~~ s :g:i /n/2/; + $word ~~ s :g:i /m/3/; + $word ~~ s :g:i /r/4/; + $word ~~ s :g:i /l/5/; + $word ~~ s :g:i /k|g|ck/7/; + $word ~~ s :g:i /f|v/8/; + $word ~~ s :g:i /p|b/9/; + $word ~~ tr/A..Za..z',//; + if $word.chars == 1 { + $word = ''; + } + } + return @n; +} + +print $file ~ "\n"; |