6464
6565word_fetcher = WordFetcherTTS (fj , launcher_config )
6666
67- def say_and_spell_lastword ():
68- """
69- Say the last word, then spell it out one letter at a time, finally say it once more.
70- """
71- if sayword :
72- if word_fetcher .output_path [- 4 :] == ".mp3" :
73- fj .play_mp3_file (word_fetcher .output_path )
74- elif word_fetcher .output_path [- 4 :] == ".wav" :
75- fj .play_file (word_fetcher .output_path )
76- time .sleep (0.2 )
77- for letter in lastword :
78- fj .play_mp3_file (f"spell_jam_assets/letter_mp3s/{ letter .upper ()} .mp3" )
79- time .sleep (0.2 )
80- if sayword :
81- if word_fetcher .output_path [- 4 :] == ".mp3" :
82- fj .play_mp3_file (word_fetcher .output_path )
83- elif word_fetcher .output_path [- 4 :] == ".wav" :
84- fj .play_file (word_fetcher .output_path )
67+ def play_sound ():
8568 soundPath = None
8669 if 'words' in os .listdir ('spell_jam_assets' ):
8770 soundPath = 'spell_jam_assets/words/'
@@ -103,6 +86,26 @@ def say_and_spell_lastword():
10386 fj .play_file (f'{ soundPath } { sound } ' )
10487 break
10588
89+ def say_and_spell_lastword ():
90+ """
91+ Say the last word, then spell it out one letter at a time, finally say it once more.
92+ """
93+ if sayword :
94+ if word_fetcher .output_path [- 4 :] == ".mp3" :
95+ fj .play_mp3_file (word_fetcher .output_path )
96+ elif word_fetcher .output_path [- 4 :] == ".wav" :
97+ fj .play_file (word_fetcher .output_path )
98+ time .sleep (0.2 )
99+ for letter in lastword :
100+ fj .play_mp3_file (f"spell_jam_assets/letter_mp3s/{ letter .upper ()} .mp3" )
101+ time .sleep (0.2 )
102+ if sayword :
103+ if word_fetcher .output_path [- 4 :] == ".mp3" :
104+ fj .play_mp3_file (word_fetcher .output_path )
105+ elif word_fetcher .output_path [- 4 :] == ".wav" :
106+ fj .play_file (word_fetcher .output_path )
107+ play_sound ()
108+
106109 fj .neopixels .fill (0x000000 )
107110
108111
0 commit comments