├── audio ├── am.mp3 ├── and.mp3 ├── dot.mp3 ├── its.mp3 ├── one.mp3 ├── per.mp3 ├── pm.mp3 ├── six.mp3 ├── ten.mp3 ├── to.mp3 ├── two.mp3 ├── us.mp3 ├── cent.mp3 ├── centi.mp3 ├── cents.mp3 ├── dollar.mp3 ├── eight.mp3 ├── eighty.mp3 ├── eleven.mp3 ├── feet.mp3 ├── fifty.mp3 ├── five.mp3 ├── foot.mp3 ├── forty.mp3 ├── four.mp3 ├── fourty.mp3 ├── gram.mp3 ├── half.mp3 ├── hour.mp3 ├── inch.mp3 ├── inches.mp3 ├── kilo.mp3 ├── liter.mp3 ├── meter.mp3 ├── mile.mp3 ├── miles.mp3 ├── milli.mp3 ├── minus.mp3 ├── nine.mp3 ├── ninety.mp3 ├── noon.mp3 ├── oclock.mp3 ├── past.mp3 ├── pound.mp3 ├── pounds.mp3 ├── seven.mp3 ├── sixty.mp3 ├── thirty.mp3 ├── three.mp3 ├── twelve.mp3 ├── twenty.mp3 ├── zero.mp3 ├── billion.mp3 ├── celcius.mp3 ├── degrees.mp3 ├── dollars.mp3 ├── eighteen.mp3 ├── fifteen.mp3 ├── fourteen.mp3 ├── hundred.mp3 ├── midnight.mp3 ├── million.mp3 ├── nineteen.mp3 ├── percent.mp3 ├── quarter.mp3 ├── seventy.mp3 ├── silence.mp3 ├── sixteen.mp3 ├── thirteen.mp3 ├── thousand.mp3 ├── eightteen.mp3 ├── fahrenheit.mp3 └── seventeen.mp3 ├── docs ├── html │ ├── bc_s.png │ ├── bdwn.png │ ├── doc.png │ ├── docd.png │ ├── open.png │ ├── bc_sd.png │ ├── closed.png │ ├── nav_f.png │ ├── nav_fd.png │ ├── nav_g.png │ ├── nav_h.png │ ├── nav_hd.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_ad.png │ ├── tab_b.png │ ├── tab_bd.png │ ├── tab_h.png │ ├── tab_hd.png │ ├── tab_s.png │ ├── tab_sd.png │ ├── splitbar.png │ ├── splitbard.png │ ├── sync_off.png │ ├── folderclosed.png │ ├── folderopen.png │ ├── search │ │ ├── search_l.png │ │ ├── search_m.png │ │ ├── search_r.png │ │ ├── pages_0.js │ │ ├── all_1.js │ │ ├── all_4.js │ │ ├── all_5.js │ │ ├── classes_1.js │ │ ├── functions_4.js │ │ ├── functions_5.js │ │ ├── functions_1.js │ │ ├── all_7.js │ │ ├── all_9.js │ │ ├── functions_7.js │ │ ├── variables_0.js │ │ ├── classes_3.js │ │ ├── all_6.js │ │ ├── functions_6.js │ │ ├── all_8.js │ │ ├── all_a.js │ │ ├── classes_2.js │ │ ├── functions_8.js │ │ ├── classes_4.js │ │ ├── functions_0.js │ │ ├── functions_3.js │ │ ├── searchdata.js │ │ ├── all_2.js │ │ ├── functions_2.js │ │ ├── nomatches.html │ │ ├── all_3.js │ │ ├── functions_a.js │ │ ├── classes_0.js │ │ ├── all_c.js │ │ ├── mag.svg │ │ ├── mag_d.svg │ │ ├── close.svg │ │ ├── all_0.js │ │ ├── all_0.html │ │ ├── all_1.html │ │ ├── all_2.html │ │ ├── all_3.html │ │ ├── all_4.html │ │ ├── all_5.html │ │ ├── all_6.html │ │ ├── all_7.html │ │ ├── all_8.html │ │ ├── all_9.html │ │ ├── all_a.html │ │ ├── all_b.html │ │ ├── all_c.html │ │ ├── pages_0.html │ │ ├── classes_0.html │ │ ├── classes_1.html │ │ ├── classes_2.html │ │ ├── classes_3.html │ │ ├── classes_4.html │ │ ├── functions_0.html │ │ ├── functions_1.html │ │ ├── functions_2.html │ │ ├── functions_3.html │ │ ├── functions_4.html │ │ ├── functions_5.html │ │ ├── functions_6.html │ │ ├── functions_7.html │ │ ├── functions_8.html │ │ ├── functions_9.html │ │ ├── functions_a.html │ │ ├── variables_0.html │ │ ├── functions_9.js │ │ ├── mag_sel.svg │ │ ├── mag_seld.svg │ │ └── all_b.js │ ├── classsimple__tts_1_1_time_to_text.png │ ├── classsimple__tts_1_1_audio_dictionary.png │ ├── classsimple__tts_1_1_number_to_text.png │ ├── classsimple__tts_1_1_simple_t_t_s_base.png │ ├── classsimple__tts_1_1_audio_dictionary_base.png │ ├── classsimple__tts_1_1_audio_dictionary_s_d.png │ ├── classsimple__tts_1_1_number_unit_to_text.png │ ├── classsimple__tts_1_1_audio_dictionary_u_r_l.png │ ├── structsimple__tts_1_1_audio_dictionary_entry.png │ ├── classsimple__tts_1_1_audio_stream_file_wrapper.png │ ├── structsimple__tts_1_1_audio_dictionary_entry_ext.png │ ├── menudata.js │ └── functions_vars.html └── latex │ ├── Makefile │ ├── _simple_t_t_s_8h_source.tex │ ├── structsimple__tts_1_1_time.tex │ ├── structsimple__tts_1_1_audio_s_d_entry.tex │ ├── structsimple__tts_1_1_audio_dictionary_entry.tex │ ├── structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info.tex │ ├── structsimple__tts_1_1_audio_dictionary_entry_ext.tex │ ├── files.tex │ ├── structsimple__tts_1_1_simple_time.tex │ ├── classsimple__tts_1_1_audio_dictionary_base.tex │ ├── hierarchy.tex │ ├── _audio_dictionary_u_r_l_8h_source.tex │ ├── classsimple__tts_1_1_number.tex │ ├── classsimple__tts_1_1_audio_dictionary.tex │ ├── classsimple__tts_1_1_simple_t_t_s_base.tex │ ├── classsimple__tts_1_1_audio_dictionary_u_r_l.tex │ └── classsimple__tts_1_1_audio_stream_file_wrapper.tex ├── examples ├── ._.DS_Store ├── time-to-speech │ ├── ._CMakeLists.txt │ ├── Desktop.h │ ├── CMakeLists.txt │ └── time-to-speech.ino ├── main.cpp ├── number-to-speech │ ├── Desktop.h │ ├── CMakeLists.txt │ └── number-to-speech.ino ├── unit-to-speech │ ├── Desktop.h │ ├── CMakeLists.txt │ └── unit-to-speech.ino ├── audio-i2s-nosilence │ ├── Desktop.h │ ├── CMakeLists.txt │ └── audio-i2s-nosilence.ino ├── data-csv │ └── data-csv.ino ├── time-to-text │ ├── time-to-text.ino │ └── CMakeLists.txt ├── number-to-text │ ├── number-to-text.ino │ └── CMakeLists.txt ├── unit-to-text │ ├── unit-to-text.ino │ └── CMakeLists.txt ├── audio-i2s │ └── audio-i2s.ino ├── audio-pwm │ └── audio-pwm.ino ├── audio-analog │ └── audio-analog.ino ├── audio-i2s-queue │ └── audio-i2s-queue.ino ├── example-own-sound │ ├── example-own-sound.ino │ ├── speechSamples.h │ └── speechArray.h ├── CMakeLists.txt ├── talking-clock │ └── talking-clock.ino ├── time-to-speech-sd │ └── time-to-speech-sd.ino ├── time-to-speech-url │ └── time-to-speech-url.ino └── tts-udp-server │ └── tts-udp-server.h ├── src ├── SimpleTTS.h ├── AudioDictionaryURL.h ├── time │ ├── TimeInfoRTC.h │ └── TimeInfoESP32.h ├── en │ └── all.h ├── sandbox │ └── Importer.h └── TextToSpeech.h ├── library.properties ├── CMakeLists.txt ├── tools ├── make-mp3.py ├── make-h.py └── audio.csv └── .gitignore /audio/am.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/am.mp3 -------------------------------------------------------------------------------- /audio/and.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/and.mp3 -------------------------------------------------------------------------------- /audio/dot.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/dot.mp3 -------------------------------------------------------------------------------- /audio/its.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/its.mp3 -------------------------------------------------------------------------------- /audio/one.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/one.mp3 -------------------------------------------------------------------------------- /audio/per.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/per.mp3 -------------------------------------------------------------------------------- /audio/pm.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/pm.mp3 -------------------------------------------------------------------------------- /audio/six.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/six.mp3 -------------------------------------------------------------------------------- /audio/ten.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/ten.mp3 -------------------------------------------------------------------------------- /audio/to.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/to.mp3 -------------------------------------------------------------------------------- /audio/two.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/two.mp3 -------------------------------------------------------------------------------- /audio/us.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/us.mp3 -------------------------------------------------------------------------------- /audio/cent.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/cent.mp3 -------------------------------------------------------------------------------- /audio/centi.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/centi.mp3 -------------------------------------------------------------------------------- /audio/cents.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/cents.mp3 -------------------------------------------------------------------------------- /audio/dollar.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/dollar.mp3 -------------------------------------------------------------------------------- /audio/eight.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/eight.mp3 -------------------------------------------------------------------------------- /audio/eighty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/eighty.mp3 -------------------------------------------------------------------------------- /audio/eleven.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/eleven.mp3 -------------------------------------------------------------------------------- /audio/feet.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/feet.mp3 -------------------------------------------------------------------------------- /audio/fifty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/fifty.mp3 -------------------------------------------------------------------------------- /audio/five.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/five.mp3 -------------------------------------------------------------------------------- /audio/foot.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/foot.mp3 -------------------------------------------------------------------------------- /audio/forty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/forty.mp3 -------------------------------------------------------------------------------- /audio/four.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/four.mp3 -------------------------------------------------------------------------------- /audio/fourty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/fourty.mp3 -------------------------------------------------------------------------------- /audio/gram.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/gram.mp3 -------------------------------------------------------------------------------- /audio/half.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/half.mp3 -------------------------------------------------------------------------------- /audio/hour.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/hour.mp3 -------------------------------------------------------------------------------- /audio/inch.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/inch.mp3 -------------------------------------------------------------------------------- /audio/inches.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/inches.mp3 -------------------------------------------------------------------------------- /audio/kilo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/kilo.mp3 -------------------------------------------------------------------------------- /audio/liter.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/liter.mp3 -------------------------------------------------------------------------------- /audio/meter.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/meter.mp3 -------------------------------------------------------------------------------- /audio/mile.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/mile.mp3 -------------------------------------------------------------------------------- /audio/miles.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/miles.mp3 -------------------------------------------------------------------------------- /audio/milli.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/milli.mp3 -------------------------------------------------------------------------------- /audio/minus.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/minus.mp3 -------------------------------------------------------------------------------- /audio/nine.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/nine.mp3 -------------------------------------------------------------------------------- /audio/ninety.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/ninety.mp3 -------------------------------------------------------------------------------- /audio/noon.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/noon.mp3 -------------------------------------------------------------------------------- /audio/oclock.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/oclock.mp3 -------------------------------------------------------------------------------- /audio/past.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/past.mp3 -------------------------------------------------------------------------------- /audio/pound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/pound.mp3 -------------------------------------------------------------------------------- /audio/pounds.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/pounds.mp3 -------------------------------------------------------------------------------- /audio/seven.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/seven.mp3 -------------------------------------------------------------------------------- /audio/sixty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/sixty.mp3 -------------------------------------------------------------------------------- /audio/thirty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/thirty.mp3 -------------------------------------------------------------------------------- /audio/three.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/three.mp3 -------------------------------------------------------------------------------- /audio/twelve.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/twelve.mp3 -------------------------------------------------------------------------------- /audio/twenty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/twenty.mp3 -------------------------------------------------------------------------------- /audio/zero.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/zero.mp3 -------------------------------------------------------------------------------- /audio/billion.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/billion.mp3 -------------------------------------------------------------------------------- /audio/celcius.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/celcius.mp3 -------------------------------------------------------------------------------- /audio/degrees.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/degrees.mp3 -------------------------------------------------------------------------------- /audio/dollars.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/dollars.mp3 -------------------------------------------------------------------------------- /audio/eighteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/eighteen.mp3 -------------------------------------------------------------------------------- /audio/fifteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/fifteen.mp3 -------------------------------------------------------------------------------- /audio/fourteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/fourteen.mp3 -------------------------------------------------------------------------------- /audio/hundred.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/hundred.mp3 -------------------------------------------------------------------------------- /audio/midnight.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/midnight.mp3 -------------------------------------------------------------------------------- /audio/million.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/million.mp3 -------------------------------------------------------------------------------- /audio/nineteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/nineteen.mp3 -------------------------------------------------------------------------------- /audio/percent.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/percent.mp3 -------------------------------------------------------------------------------- /audio/quarter.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/quarter.mp3 -------------------------------------------------------------------------------- /audio/seventy.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/seventy.mp3 -------------------------------------------------------------------------------- /audio/silence.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/silence.mp3 -------------------------------------------------------------------------------- /audio/sixteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/sixteen.mp3 -------------------------------------------------------------------------------- /audio/thirteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/thirteen.mp3 -------------------------------------------------------------------------------- /audio/thousand.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/thousand.mp3 -------------------------------------------------------------------------------- /docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/bc_s.png -------------------------------------------------------------------------------- /docs/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/bdwn.png -------------------------------------------------------------------------------- /docs/html/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/doc.png -------------------------------------------------------------------------------- /docs/html/docd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/docd.png -------------------------------------------------------------------------------- /docs/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/open.png -------------------------------------------------------------------------------- /audio/eightteen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/eightteen.mp3 -------------------------------------------------------------------------------- /audio/fahrenheit.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/fahrenheit.mp3 -------------------------------------------------------------------------------- /audio/seventeen.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/audio/seventeen.mp3 -------------------------------------------------------------------------------- /docs/html/bc_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/bc_sd.png -------------------------------------------------------------------------------- /docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/closed.png -------------------------------------------------------------------------------- /docs/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/nav_f.png -------------------------------------------------------------------------------- /docs/html/nav_fd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/nav_fd.png -------------------------------------------------------------------------------- /docs/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/nav_g.png -------------------------------------------------------------------------------- /docs/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/nav_h.png -------------------------------------------------------------------------------- /docs/html/nav_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/nav_hd.png -------------------------------------------------------------------------------- /docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/sync_on.png -------------------------------------------------------------------------------- /docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_a.png -------------------------------------------------------------------------------- /docs/html/tab_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_ad.png -------------------------------------------------------------------------------- /docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_b.png -------------------------------------------------------------------------------- /docs/html/tab_bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_bd.png -------------------------------------------------------------------------------- /docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_h.png -------------------------------------------------------------------------------- /docs/html/tab_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_hd.png -------------------------------------------------------------------------------- /docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_s.png -------------------------------------------------------------------------------- /docs/html/tab_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/tab_sd.png -------------------------------------------------------------------------------- /examples/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/examples/._.DS_Store -------------------------------------------------------------------------------- /docs/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/splitbar.png -------------------------------------------------------------------------------- /docs/html/splitbard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/splitbard.png -------------------------------------------------------------------------------- /docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/sync_off.png -------------------------------------------------------------------------------- /docs/html/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/folderclosed.png -------------------------------------------------------------------------------- /docs/html/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/folderopen.png -------------------------------------------------------------------------------- /docs/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/search/search_l.png -------------------------------------------------------------------------------- /docs/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/search/search_m.png -------------------------------------------------------------------------------- /docs/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/search/search_r.png -------------------------------------------------------------------------------- /docs/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['arduino_20simple_20tts_0',['Arduino Simple TTS',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /examples/time-to-speech/._CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/examples/time-to-speech/._CMakeLists.txt -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_time_to_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_time_to_text.png -------------------------------------------------------------------------------- /examples/main.cpp: -------------------------------------------------------------------------------- 1 | #ifdef IS_DESKTOP 2 | 3 | #include "Arduino.h" 4 | int main(){ 5 | setup(); 6 | while(true) loop(); 7 | } 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_audio_dictionary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_audio_dictionary.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_number_to_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_number_to_text.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_simple_t_t_s_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_simple_t_t_s_base.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_audio_dictionary_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_audio_dictionary_base.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_audio_dictionary_s_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_audio_dictionary_s_d.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_number_unit_to_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_number_unit_to_text.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_audio_dictionary_u_r_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_audio_dictionary_u_r_l.png -------------------------------------------------------------------------------- /docs/html/structsimple__tts_1_1_audio_dictionary_entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/structsimple__tts_1_1_audio_dictionary_entry.png -------------------------------------------------------------------------------- /docs/html/classsimple__tts_1_1_audio_stream_file_wrapper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/classsimple__tts_1_1_audio_stream_file_wrapper.png -------------------------------------------------------------------------------- /docs/html/structsimple__tts_1_1_audio_dictionary_entry_ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pschatzmann/arduino-simple-tts/HEAD/docs/html/structsimple__tts_1_1_audio_dictionary_entry_ext.png -------------------------------------------------------------------------------- /docs/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['begin_0',['begin',['../classsimple__tts_1_1_text_to_speech_queue.html#aae0a8c5dc38c4dfff7c0ed9551a6cbc4',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['end_0',['end',['../classsimple__tts_1_1_text_to_speech_queue.html#a875f9926b87ea3287e6cfcab6fd9703f',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_0',['get',['../classsimple__tts_1_1_audio_dictionary_s_d.html#a6408d3dded7a71531a53fb4e0b8c48c1',1,'simple_tts::AudioDictionarySD']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['decimalinfo_0',['DecimalInfo',['../structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info.html',1,'simple_tts::NumberUnitToText']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['end_0',['end',['../classsimple__tts_1_1_text_to_speech_queue.html#a875f9926b87ea3287e6cfcab6fd9703f',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['get_0',['get',['../classsimple__tts_1_1_audio_dictionary_s_d.html#a6408d3dded7a71531a53fb4e0b8c48c1',1,'simple_tts::AudioDictionarySD']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['begin_0',['begin',['../classsimple__tts_1_1_text_to_speech_queue.html#aae0a8c5dc38c4dfff7c0ed9551a6cbc4',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5funit_5f2_0',['max_unit_2',['../classsimple__tts_1_1_number_unit_to_text.html#ac9a76bb190de0cd5ebb2fe80cd990945',1,'simple_tts::NumberUnitToText']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_5b_5d_0',['operator[]',['../classsimple__tts_1_1_text_to_speech_queue.html#ada5489f9972545ae88f4b228ac748d07',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_5b_5d_0',['operator[]',['../classsimple__tts_1_1_text_to_speech_queue.html#ada5489f9972545ae88f4b228ac748d07',1,'simple_tts::TextToSpeechQueue']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5funit_5f2_0',['max_unit_2',['../classsimple__tts_1_1_number_unit_to_text.html#ac9a76bb190de0cd5ebb2fe80cd990945',1,'simple_tts::NumberUnitToText']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['simpletime_0',['SimpleTime',['../structsimple__tts_1_1_simple_time.html',1,'simple_tts']]], 4 | ['simplettsbase_1',['SimpleTTSBase',['../classsimple__tts_1_1_simple_t_t_s_base.html',1,'simple_tts']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /src/SimpleTTS.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TimeToText.h" 4 | #include "NumberToText.h" 5 | #include "NumberUnitToText.h" 6 | #include "TextToSpeech.h" 7 | #include "TextToSpeechQueue.h" 8 | 9 | #ifndef NO_SIMPLE_TTS_NS 10 | using namespace simple_tts; 11 | #endif -------------------------------------------------------------------------------- /docs/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['intvalue_0',['intValue',['../classsimple__tts_1_1_number.html#a0768e8ce47dff8521cec1e662587da32',1,'simple_tts::Number']]], 4 | ['isempty_1',['isEmpty',['../classsimple__tts_1_1_text_to_speech_queue.html#a5719b478407e4229bb35e3ede6db44c1',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /examples/number-to-speech/Desktop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @brief Some special rules for desktop builds. 4 | * The output should go to PortAudioStream 5 | */ 6 | 7 | #ifdef IS_DESKTOP 8 | #include "AudioLibs/PortAudioStream.h" 9 | #define I2SStream PortAudioStream 10 | #define AudioBoardStream PortAudioStream 11 | #endif 12 | -------------------------------------------------------------------------------- /examples/time-to-speech/Desktop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @brief Some special rules for desktop builds. 4 | * The output should go to PortAudioStream 5 | */ 6 | 7 | #ifdef IS_DESKTOP 8 | #include "AudioLibs/PortAudioStream.h" 9 | #define I2SStream PortAudioStream 10 | #define AudioBoardStream PortAudioStream 11 | #endif 12 | -------------------------------------------------------------------------------- /examples/unit-to-speech/Desktop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @brief Some special rules for desktop builds. 4 | * The output should go to PortAudioStream 5 | */ 6 | 7 | #ifdef IS_DESKTOP 8 | #include "AudioLibs/PortAudioStream.h" 9 | #define I2SStream PortAudioStream 10 | #define AudioBoardStream PortAudioStream 11 | #endif 12 | -------------------------------------------------------------------------------- /docs/html/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['intvalue_0',['intValue',['../classsimple__tts_1_1_number.html#a0768e8ce47dff8521cec1e662587da32',1,'simple_tts::Number']]], 4 | ['isempty_1',['isEmpty',['../classsimple__tts_1_1_text_to_speech_queue.html#a5719b478407e4229bb35e3ede6db44c1',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /examples/audio-i2s-nosilence/Desktop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @brief Some special rules for desktop builds. 4 | * The output should go to PortAudioStream 5 | */ 6 | 7 | #ifdef IS_DESKTOP 8 | #include "AudioLibs/PortAudioStream.h" 9 | #define I2SStream PortAudioStream 10 | #define AudioBoardStream PortAudioStream 11 | #endif 12 | -------------------------------------------------------------------------------- /docs/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['number_0',['Number',['../classsimple__tts_1_1_number.html',1,'simple_tts']]], 4 | ['numbertotext_1',['NumberToText',['../classsimple__tts_1_1_number_to_text.html',1,'simple_tts']]], 5 | ['numberunittotext_2',['NumberUnitToText',['../classsimple__tts_1_1_number_unit_to_text.html',1,'simple_tts']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=simple-tts 2 | version=0.0.1 3 | author=Phil Schatzmann 4 | maintainer=Phil Schatzmann 5 | sentence=Some useful simple TTS classes to output prerecorded audio 6 | paragraph= 7 | category=Signal Input/Output 8 | url=https://github.com/pschatzmann/arduino-simple-ttx 9 | architectures=* 10 | depends= 11 | -------------------------------------------------------------------------------- /docs/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['process_0',['process',['../classsimple__tts_1_1_number_unit_to_text.html#aa2ef301472f16644e12ca377537188a0',1,'simple_tts::NumberUnitToText']]], 4 | ['processword_1',['processWord',['../classsimple__tts_1_1_text_to_speech_queue.html#a283909e83d0b0ee0cf2a5f8ad19a5358',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['number_0',['Number',['../classsimple__tts_1_1_number.html',1,'simple_tts']]], 4 | ['numbertotext_1',['NumberToText',['../classsimple__tts_1_1_number_to_text.html',1,'simple_tts']]], 5 | ['numberunittotext_2',['NumberUnitToText',['../classsimple__tts_1_1_number_unit_to_text.html',1,'simple_tts']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/html/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['process_0',['process',['../classsimple__tts_1_1_number_unit_to_text.html#aa2ef301472f16644e12ca377537188a0',1,'simple_tts::NumberUnitToText']]], 4 | ['processword_1',['processWord',['../classsimple__tts_1_1_text_to_speech_queue.html#a283909e83d0b0ee0cf2a5f8ad19a5358',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/classes_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['texttospeech_0',['TextToSpeech',['../classsimple__tts_1_1_text_to_speech.html',1,'simple_tts']]], 4 | ['texttospeechqueue_1',['TextToSpeechQueue',['../classsimple__tts_1_1_text_to_speech_queue.html',1,'simple_tts']]], 5 | ['timetotext_2',['TimeToText',['../classsimple__tts_1_1_time_to_text.html',1,'simple_tts']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/html/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['alltexts_0',['allTexts',['../classsimple__tts_1_1_number_to_text.html#ae7cdf641730a749293956193b785a772',1,'simple_tts::NumberToText::allTexts()'],['../classsimple__tts_1_1_number_unit_to_text.html#adfa5999c7e6b9adc5f51d8213614abc3',1,'simple_tts::NumberUnitToText::allTexts()'],['../classsimple__tts_1_1_time_to_text.html#a74b2534f6c65dc2f3a5403952ff80690',1,'simple_tts::TimeToText::allTexts()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['decvalues_0',['decValues',['../classsimple__tts_1_1_number.html#a33e8504471cb6f4ab31a43b178ec26e5',1,'simple_tts::Number']]], 4 | ['delay_1',['delay',['../classsimple__tts_1_1_text_to_speech.html#aa7ebf5afbc70655c9a0116de496ae58e',1,'simple_tts::TextToSpeech::delay()'],['../classsimple__tts_1_1_text_to_speech_queue.html#a1543ff493a10a7f5d3222fb0135d98ce',1,'simple_tts::TextToSpeechQueue::delay()']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "abcdegimnopst", 4 | 1: "adnst", 5 | 2: "abcdegiopst", 6 | 3: "m", 7 | 4: "a" 8 | }; 9 | 10 | var indexSectionNames = 11 | { 12 | 0: "all", 13 | 1: "classes", 14 | 2: "functions", 15 | 3: "variables", 16 | 4: "pages" 17 | }; 18 | 19 | var indexSectionLabels = 20 | { 21 | 0: "All", 22 | 1: "Classes", 23 | 2: "Functions", 24 | 3: "Variables", 25 | 4: "Pages" 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /docs/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['callback_0',['callback',['../classsimple__tts_1_1_text_to_speech.html#aef5be846d3540b0591952d4b50467bca',1,'simple_tts::TextToSpeech::callback()'],['../classsimple__tts_1_1_text_to_speech_queue.html#aab744bc896bd996f4ffcb59d7424eb79',1,'simple_tts::TextToSpeechQueue::callback(audio_tools::Vector< const char * > words, void *ref)']]], 4 | ['clear_1',['clear',['../classsimple__tts_1_1_text_to_speech_queue.html#acf498d62e072675701d8d21e08ca7d28',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['callback_0',['callback',['../classsimple__tts_1_1_text_to_speech.html#aef5be846d3540b0591952d4b50467bca',1,'simple_tts::TextToSpeech::callback()'],['../classsimple__tts_1_1_text_to_speech_queue.html#aab744bc896bd996f4ffcb59d7424eb79',1,'simple_tts::TextToSpeechQueue::callback(audio_tools::Vector< const char * > words, void *ref)']]], 4 | ['clear_1',['clear',['../classsimple__tts_1_1_text_to_speech_queue.html#acf498d62e072675701d8d21e08ca7d28',1,'simple_tts::TextToSpeechQueue']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /examples/data-csv/data-csv.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file audio-csv.ino 4 | * @author Phil Schatzmann 5 | * @brief We generate the CSV output that can be used as input to the provided tools 6 | * @version 0.1 7 | * @date 2022-02-19 8 | * 9 | * @copyright Copyright (c) 2022 10 | * 11 | */ 12 | #include "SimpleTTS.h" 13 | 14 | NumberToText ntt; 15 | TimeToText ttt; 16 | 17 | void setup() { 18 | Serial.begin(115200); 19 | Serial.println("Name,Text"); 20 | ntt.printCSV(Serial); 21 | ttt.printCSV(Serial); 22 | } 23 | 24 | void loop(){ 25 | 26 | } -------------------------------------------------------------------------------- /docs/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
No Matches
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['decimalinfo_0',['DecimalInfo',['../structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info.html',1,'simple_tts::NumberUnitToText']]], 4 | ['decvalues_1',['decValues',['../classsimple__tts_1_1_number.html#a33e8504471cb6f4ab31a43b178ec26e5',1,'simple_tts::Number']]], 5 | ['delay_2',['delay',['../classsimple__tts_1_1_text_to_speech.html#aa7ebf5afbc70655c9a0116de496ae58e',1,'simple_tts::TextToSpeech::delay()'],['../classsimple__tts_1_1_text_to_speech_queue.html#a1543ff493a10a7f5d3222fb0135d98ce',1,'simple_tts::TextToSpeechQueue::delay()']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /examples/time-to-text/time-to-text.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file time-to-text.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo sketch which translates a number into words. This is the input for generating speech. 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | #include "SimpleTTS.h" 12 | 13 | TimeToText ttt; 14 | 15 | void setup(){ 16 | Serial.begin(115200); 17 | 18 | auto result = ttt.say(12,00); 19 | 20 | for (auto str : result){ 21 | Serial.print(str); 22 | Serial.print(" "); 23 | } 24 | } 25 | 26 | void loop() { 27 | 28 | } -------------------------------------------------------------------------------- /examples/number-to-text/number-to-text.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file number-to-text.ino 4 | * @author Phil Schatzmann 5 | * @brief Demo that translates numbers into individual words. This is used as input to generate speech 6 | * @version 0.1 7 | * @date 2022-02-16 8 | * 9 | * @copyright Copyright (c) 2022 10 | * 11 | */ 12 | #include "SimpleTTS.h" 13 | 14 | NumberToText ntt; 15 | 16 | void setup(){ 17 | Serial.begin(115200); 18 | 19 | auto result = ntt.say(-700123.431); 20 | for (auto str : result){ 21 | Serial.print(str); 22 | Serial.print(" "); 23 | } 24 | } 25 | 26 | void loop() { 27 | 28 | } -------------------------------------------------------------------------------- /examples/unit-to-text/unit-to-text.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file numberunit-to-text.ino 4 | * @author Phil Schatzmann 5 | * @brief Demo that translates numbers with units into individual words. This is used as input to generate speech 6 | * @version 0.1 7 | * @date 2022-02-16 8 | * 9 | * @copyright Copyright (c) 2022 10 | * 11 | */ 12 | #include "SimpleTTS.h" 13 | 14 | NumberUnitToText utt; 15 | 16 | void setup(){ 17 | Serial.begin(115200); 18 | 19 | auto result = utt.say(1.1,"usd"); 20 | for (auto str : result){ 21 | Serial.print(str); 22 | Serial.print(" "); 23 | } 24 | } 25 | 26 | void loop() { 27 | 28 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | # set the project name 4 | project(simple-tts) 5 | 6 | # lots of warnings and all warnings as errors 7 | ## add_compile_options(-Wall -Wextra ) 8 | set(CMAKE_CXX_STANDARD 17) 9 | 10 | # prevent compile errors 11 | #target_compile_options(simple-tts PRIVATE -DIS_DESKTOP) 12 | add_library(simple-tts INTERFACE) 13 | 14 | # define location for header files 15 | target_include_directories(simple-tts INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src ) 16 | 17 | # build examples 18 | #add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/examples" EXCLUDE_FROM_ALL) 19 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/examples" ) 20 | -------------------------------------------------------------------------------- /tools/make-mp3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Generates mp3 audio files from the audio.csv input file. 4 | # make sure that you install gtts: pip install gtts 5 | # 6 | import csv 7 | import os 8 | import gtts 9 | 10 | directory = "out/audio" 11 | ext = "mp3" 12 | os.makedirs(directory,exist_ok=True) 13 | 14 | with open('audio.csv') as csvfile: 15 | audioreader = csv.DictReader(csvfile, delimiter=',') 16 | for row in audioreader: 17 | name = row['Name'] 18 | text = row['Text'] 19 | tts = gtts.gTTS(text) 20 | filename = directory + "/" + name + "." + ext 21 | tts.save(filename) 22 | print(filename) 23 | -------------------------------------------------------------------------------- /docs/latex/Makefile: -------------------------------------------------------------------------------- 1 | LATEX_CMD?=pdflatex 2 | MKIDX_CMD?=makeindex 3 | BIBTEX_CMD?=bibtex 4 | LATEX_COUNT?=8 5 | MANUAL_FILE?=refman 6 | 7 | all: $(MANUAL_FILE).pdf 8 | 9 | pdf: $(MANUAL_FILE).pdf 10 | 11 | $(MANUAL_FILE).pdf: clean $(MANUAL_FILE).tex 12 | $(LATEX_CMD) $(MANUAL_FILE) 13 | $(MKIDX_CMD) $(MANUAL_FILE).idx 14 | $(LATEX_CMD) $(MANUAL_FILE) 15 | latex_count=$(LATEX_COUNT) ; \ 16 | while egrep -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\ 17 | do \ 18 | echo "Rerunning latex...." ;\ 19 | $(LATEX_CMD) $(MANUAL_FILE) ;\ 20 | latex_count=`expr $$latex_count - 1` ;\ 21 | done 22 | $(MKIDX_CMD) $(MANUAL_FILE).idx 23 | $(LATEX_CMD) $(MANUAL_FILE) 24 | 25 | 26 | clean: 27 | rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf 28 | -------------------------------------------------------------------------------- /examples/time-to-text/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(time-to-text) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | # build sketch as executable 13 | add_executable (time-to-text time-to-text.ino ../main.cpp) 14 | # defines needed for desktop build 15 | target_compile_definitions(time-to-text PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DNO_SPEECH) 16 | # define ino as cpp 17 | set_source_files_properties(time-to-text.ino PROPERTIES LANGUAGE CXX) 18 | # specify libraries 19 | target_link_libraries(time-to-text arduino_emulator arduino-audio-tools simple-tts) 20 | 21 | -------------------------------------------------------------------------------- /examples/unit-to-text/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(unit-to-text) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | # build sketch as executable 13 | add_executable (unit-to-text unit-to-text.ino ../main.cpp) 14 | # defines needed for desktop build 15 | target_compile_definitions(unit-to-text PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DNO_SPEECH) 16 | # define ino as cpp 17 | set_source_files_properties(unit-to-text.ino PROPERTIES LANGUAGE CXX) 18 | # specify libraries 19 | target_link_libraries(unit-to-text arduino_emulator arduino-audio-tools simple-tts) 20 | 21 | -------------------------------------------------------------------------------- /examples/number-to-text/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(number-to-text) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | # build sketch as executable 13 | add_executable (number-to-text number-to-text.ino ../main.cpp) 14 | # defines needed for desktop build 15 | target_compile_definitions(number-to-text PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DNO_SPEECH) 16 | # define ino as cpp 17 | set_source_files_properties(number-to-text.ino PROPERTIES LANGUAGE CXX) 18 | # specify libraries 19 | target_link_libraries(number-to-text arduino_emulator arduino-audio-tools simple-tts) 20 | 21 | -------------------------------------------------------------------------------- /docs/latex/_simple_t_t_s_8h_source.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{_simple_t_t_s_8h_source}{}\doxysection{Simple\+TTS.\+h} 2 | \label{_simple_t_t_s_8h_source}\index{src/SimpleTTS.h@{src/SimpleTTS.h}} 3 | 4 | \begin{DoxyCode}{0} 5 | \DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}} 6 | \DoxyCodeLine{00002\ } 7 | \DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ "{}TimeToText.h"{}}} 8 | \DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}NumberToText.h"{}}} 9 | \DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}NumberUnitToText.h"{}}} 10 | \DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}TextToSpeech.h"{}}} 11 | \DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}TextToSpeechQueue.h"{}}} 12 | \DoxyCodeLine{00008\ } 13 | \DoxyCodeLine{00009\ \textcolor{preprocessor}{\#ifndef\ NO\_SIMPLE\_TTS\_NS}} 14 | \DoxyCodeLine{00010\ \textcolor{keyword}{using\ namespace\ }simple\_tts;} 15 | \DoxyCodeLine{00011\ \textcolor{preprocessor}{\#endif}} 16 | 17 | \end{DoxyCode} 18 | -------------------------------------------------------------------------------- /examples/time-to-speech/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(time-to-speech) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | include(FetchContent) 13 | 14 | # build sketch as executable 15 | add_executable (time-to-speech time-to-speech.ino ../main.cpp) 16 | # defines needed for desktop build 17 | target_compile_definitions(time-to-speech PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DUSE_HELIX) 18 | # define ino as cpp 19 | set_source_files_properties(time-to-speech.ino PROPERTIES LANGUAGE CXX) 20 | # specify libraries 21 | target_link_libraries(time-to-speech arduino_emulator arduino_helix arduino-audio-tools simple-tts portaudio) 22 | 23 | -------------------------------------------------------------------------------- /examples/unit-to-speech/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(unit-to-speech) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | include(FetchContent) 13 | 14 | # build sketch as executable 15 | add_executable (unit-to-speech unit-to-speech.ino ../main.cpp) 16 | # defines needed for desktop build 17 | target_compile_definitions(unit-to-speech PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DUSE_HELIX) 18 | # define ino as cpp 19 | set_source_files_properties(unit-to-speech.ino PROPERTIES LANGUAGE CXX) 20 | # specify libraries 21 | target_link_libraries(unit-to-speech arduino_emulator arduino_helix arduino-audio-tools simple-tts portaudio) 22 | 23 | -------------------------------------------------------------------------------- /examples/number-to-speech/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(number-to-speech) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | include(FetchContent) 13 | 14 | # build sketch as executable 15 | add_executable (number-to-speech number-to-speech.ino ../main.cpp) 16 | # defines needed for desktop build 17 | target_compile_definitions(number-to-speech PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DUSE_HELIX) 18 | # define ino as cpp 19 | set_source_files_properties(number-to-speech.ino PROPERTIES LANGUAGE CXX) 20 | # specify libraries 21 | target_link_libraries(number-to-speech arduino_emulator arduino_helix arduino-audio-tools simple-tts portaudio) 22 | 23 | -------------------------------------------------------------------------------- /docs/html/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['texttospeech_0',['TextToSpeech',['../classsimple__tts_1_1_text_to_speech.html#a7ab9d174704592d9fdc5e5b7c97d4cf3',1,'simple_tts::TextToSpeech::TextToSpeech(SimpleTTSBase &tts, AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)'],['../classsimple__tts_1_1_text_to_speech.html#a316f6162063dc215f5e37b6326b109e1',1,'simple_tts::TextToSpeech::TextToSpeech(AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)']]], 4 | ['texttospeechqueue_1',['TextToSpeechQueue',['../classsimple__tts_1_1_text_to_speech_queue.html#ab33ad51a66945e59edae75460dd023e6',1,'simple_tts::TextToSpeechQueue::TextToSpeechQueue(SimpleTTSBase &tts, AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)'],['../classsimple__tts_1_1_text_to_speech_queue.html#aa05c1ef531306fe70b093671ef8b814a',1,'simple_tts::TextToSpeechQueue::TextToSpeechQueue(AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /examples/audio-i2s-nosilence/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | # set the project name 4 | project(audio-i2s-nosilence) 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (DCMAKE_CXX_FLAGS "-Werror") 7 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 8 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 9 | set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") 10 | endif() 11 | 12 | include(FetchContent) 13 | 14 | # build sketch as executable 15 | add_executable (audio-i2s-nosilence audio-i2s-nosilence.ino ../main.cpp) 16 | # defines needed for desktop build 17 | target_compile_definitions(audio-i2s-nosilence PUBLIC -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP -DUSE_HELIX) 18 | # define ino as cpp 19 | set_source_files_properties(audio-i2s-nosilence.ino PROPERTIES LANGUAGE CXX) 20 | # specify libraries 21 | target_link_libraries(audio-i2s-nosilence arduino_emulator arduino_helix arduino-audio-tools simple-tts portaudio) 22 | 23 | -------------------------------------------------------------------------------- /tools/make-h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Generates header files from the mp3 audio. 4 | # make sure that you have xxd installed 5 | # 6 | import os 7 | import sys 8 | from pathlib import Path 9 | 10 | directory = "out/audio" 11 | h_directory = "out/h" 12 | os.makedirs(h_directory,exist_ok=True) 13 | 14 | for file in os.listdir(directory): 15 | filename = Path(file) 16 | filename_h = filename.with_suffix('.h') 17 | path_h = h_directory+"/"+str(filename_h) 18 | cmd = "xxd -i "+directory+"/"+file+" " + path_h 19 | print(cmd) 20 | os.system(cmd) 21 | 22 | # Read in the file 23 | with open(path_h, 'r') as file : 24 | filedata = file.read() 25 | 26 | # Replace the target string 27 | filedata = filedata.replace('unsigned char', '#pragma once\nconst unsigned char') 28 | # remove output path from variable names 29 | filedata = filedata.replace('out_audio_', '') 30 | 31 | # Write the file out again 32 | with open(path_h, 'w') as file: 33 | file.write(filedata) 34 | -------------------------------------------------------------------------------- /docs/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['audiodictionary_0',['AudioDictionary',['../classsimple__tts_1_1_audio_dictionary.html',1,'simple_tts']]], 4 | ['audiodictionarybase_1',['AudioDictionaryBase',['../classsimple__tts_1_1_audio_dictionary_base.html',1,'simple_tts']]], 5 | ['audiodictionaryentry_2',['AudioDictionaryEntry',['../structsimple__tts_1_1_audio_dictionary_entry.html',1,'simple_tts']]], 6 | ['audiodictionarysd_3',['AudioDictionarySD',['../classsimple__tts_1_1_audio_dictionary_s_d.html',1,'simple_tts']]], 7 | ['audiodictionaryurl_4',['AudioDictionaryURL',['../classsimple__tts_1_1_audio_dictionary_u_r_l.html',1,'simple_tts']]], 8 | ['audiosdentry_5',['AudioSDEntry',['../structsimple__tts_1_1_audio_s_d_entry.html',1,'simple_tts']]], 9 | ['audiostreamfilewrapper_6',['AudioStreamFileWrapper',['../classsimple__tts_1_1_audio_stream_file_wrapper.html',1,'simple_tts']]], 10 | ['audiostreamfilewrapper_3c_20audiofile_20_3e_7',['AudioStreamFileWrapper< AudioFile >',['../classsimple__tts_1_1_audio_stream_file_wrapper.html',1,'simple_tts']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /src/AudioDictionaryURL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AudioHttp/URLStream.h" 4 | #include "SimpleTTSBase.h" 5 | 6 | namespace simple_tts { 7 | 8 | /** 9 | * @brief A dictionary which is based on audio files that can be accessed via 10 | * URLs 11 | * @author Phil Schatzmann 12 | * @copyright GPLv3 13 | */ 14 | class AudioDictionaryURL : public AudioDictionaryBase { 15 | public: 16 | AudioDictionaryURL(URLStream &urlStream, const char *url, const char *ext) { 17 | p_url = &urlStream; 18 | url_cstr = url; 19 | ext_cstr = ext; 20 | } 21 | 22 | AudioStream *get(const char *word) { 23 | url_str = url_cstr; 24 | if (!url_str.endsWith("/")){ 25 | url_str.add("/"); 26 | } 27 | url_str.add(word); 28 | url_str.add("."); 29 | url_str.add(ext_cstr); 30 | url_str.toLowerCase(); 31 | LOGI("Using url: %s", url_str.c_str()); 32 | p_url->begin(url_str.c_str()); 33 | return p_url; 34 | } 35 | 36 | protected: 37 | const char *url_cstr; 38 | const char *ext_cstr; 39 | Str url_str; 40 | URLStream *p_url; 41 | }; 42 | 43 | } // namespace simple_tts -------------------------------------------------------------------------------- /examples/audio-i2s/audio-i2s.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech with output as I2S 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | 15 | I2SStream out; 16 | VolumeStream volume(out); 17 | 18 | MP3DecoderHelix mp3; 19 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 20 | NumberUnitToText utt; 21 | TextToSpeech tts(utt, volume, mp3, dictionary); 22 | 23 | double number = 1.1; 24 | 25 | void setup(){ 26 | Serial.begin(115200); 27 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 28 | 29 | // setting the volume 30 | volume.setVolume(0.6); 31 | 32 | // setup out 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | } 38 | 39 | void loop() { 40 | // speach output 41 | utt.say(number, "usd"); 42 | 43 | number++; 44 | delay(1000); 45 | } -------------------------------------------------------------------------------- /examples/audio-pwm/audio-pwm.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech with output as PWM 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | 15 | PWMAudioStream out; 16 | VolumeStream volume(out); 17 | 18 | MP3DecoderHelix mp3; 19 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 20 | NumberUnitToText utt; 21 | TextToSpeech tts(utt, volume, mp3, dictionary); 22 | 23 | double number = 1.1; 24 | 25 | void setup(){ 26 | Serial.begin(115200); 27 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 28 | 29 | // setting the volume 30 | volume.setVolume(0.6); 31 | 32 | // setup out 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | } 38 | 39 | void increment() { 40 | number +=1; 41 | } 42 | 43 | void loop() { 44 | // speach output 45 | utt.say(number, "usd"); 46 | 47 | increment(); 48 | delay(1000); 49 | } -------------------------------------------------------------------------------- /examples/audio-analog/audio-analog.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech with an analog output 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | 15 | AnalogAudioStream out; 16 | VolumeStream volume(out); 17 | 18 | MP3DecoderHelix mp3; 19 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 20 | NumberUnitToText utt; 21 | TextToSpeech tts(utt, volume, mp3, dictionary); 22 | 23 | double number = 1.1; 24 | 25 | void setup(){ 26 | Serial.begin(115200); 27 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 28 | 29 | // setting the volume 30 | volume.setVolume(0.6); 31 | 32 | // setup out 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | } 38 | 39 | void increment() { 40 | number +=1; 41 | } 42 | 43 | void loop() { 44 | // speach output 45 | utt.say(number, "usd"); 46 | 47 | increment(); 48 | // we continue to write empty audio to avoid noise 49 | tts.delay(200); 50 | } -------------------------------------------------------------------------------- /docs/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['texttospeech_0',['TextToSpeech',['../classsimple__tts_1_1_text_to_speech.html',1,'simple_tts::TextToSpeech'],['../classsimple__tts_1_1_text_to_speech.html#a7ab9d174704592d9fdc5e5b7c97d4cf3',1,'simple_tts::TextToSpeech::TextToSpeech(SimpleTTSBase &tts, AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)'],['../classsimple__tts_1_1_text_to_speech.html#a316f6162063dc215f5e37b6326b109e1',1,'simple_tts::TextToSpeech::TextToSpeech(AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)']]], 4 | ['texttospeechqueue_1',['TextToSpeechQueue',['../classsimple__tts_1_1_text_to_speech_queue.html',1,'simple_tts::TextToSpeechQueue'],['../classsimple__tts_1_1_text_to_speech_queue.html#ab33ad51a66945e59edae75460dd023e6',1,'simple_tts::TextToSpeechQueue::TextToSpeechQueue(SimpleTTSBase &tts, AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)'],['../classsimple__tts_1_1_text_to_speech_queue.html#aa05c1ef531306fe70b093671ef8b814a',1,'simple_tts::TextToSpeechQueue::TextToSpeechQueue(AudioStream &sink, AudioDecoder &decoder, AudioDictionaryBase &dict)']]], 5 | ['timetotext_2',['TimeToText',['../classsimple__tts_1_1_time_to_text.html',1,'simple_tts']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /examples/audio-i2s-queue/audio-i2s-queue.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech with output as I2S 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | 15 | I2SStream out; 16 | VolumeStream volume(out); 17 | 18 | MP3DecoderHelix mp3; 19 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 20 | NumberUnitToText utt; 21 | TextToSpeechQueue queue(utt, volume, mp3, dictionary); 22 | 23 | double number = 1.1; 24 | 25 | void setup() { 26 | Serial.begin(115200); 27 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 28 | 29 | // setting the volume 30 | volume.setVolume(0.6); 31 | 32 | // setup out 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | } 38 | 39 | void loop() { 40 | // speach output when queue is empty 41 | if (queue.size()==0) { 42 | delay(1000); 43 | utt.say(number, "usd"); 44 | number++; 45 | } 46 | 47 | Serial.print("next word:"); 48 | Serial.println(queue[0]); 49 | 50 | // process next word in queue 51 | queue.process(); 52 | } -------------------------------------------------------------------------------- /docs/html/search/mag.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 18 | image/svg+xml 19 | 21 | 22 | 23 | 24 | 25 | 27 | 33 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/mag_d.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 18 | image/svg+xml 19 | 21 | 22 | 23 | 24 | 25 | 27 | 33 | 37 | 38 | -------------------------------------------------------------------------------- /examples/example-own-sound/example-own-sound.ino: -------------------------------------------------------------------------------- 1 | #define NO_AUDIO_EXAMPLES 2 | #include "SimpleTTS.h" 3 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 4 | #include "speechArray.h" 5 | //#include "Desktop.h" // some special logic for desktop builds 6 | 7 | I2SStream out; 8 | VolumeStream volume(i2s); 9 | //SilenceRemovalConverter rem(8, 2); 10 | //ConvertedStream> out(volume, rem); 11 | AudioDictionary dictionary(MyAudioDictionaryValues); 12 | 13 | MP3DecoderHelix mp3; 14 | TextToSpeechQueue tts(volume, mp3, dictionary); 15 | int idx=0; 16 | 17 | void setup() { 18 | Serial.begin(115200); 19 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 20 | 21 | // setup out 22 | auto cfg = out.defaultConfig(); 23 | cfg.i2s_format = I2S_LSB_FORMAT; //or I2S_STD_FORMAT 24 | cfg.sample_rate = 24000; 25 | cfg.channels = 1; 26 | out.begin(cfg); 27 | 28 | // setting the volume 29 | volume.setVolume(0.2); 30 | } 31 | 32 | void loop() { 33 | // put your main code here, to run repeatedly: 34 | if (tts.isEmpty()) { 35 | delay(1000); // in your real sketch: avoid delays 36 | tts.say(MyAudioDictionaryValues[idx++].name); // but better use a full sencense 37 | if (idx>58){ 38 | idx = 0; 39 | } 40 | } 41 | 42 | tts.process(); 43 | } 44 | -------------------------------------------------------------------------------- /examples/audio-i2s-nosilence/audio-i2s-nosilence.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech with output as I2S 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | #include "Desktop.h" 15 | 16 | I2SStream out; 17 | VolumeStream volume(i2s); 18 | SilenceRemovalConverter rem(8, 2); 19 | ConvertedStream> out(volume, rem); 20 | 21 | MP3DecoderHelix mp3; 22 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 23 | NumberUnitToText utt; 24 | TextToSpeech tts(utt, out, mp3, dictionary); 25 | 26 | double number = 1.1; 27 | 28 | void setup(){ 29 | Serial.begin(115200); 30 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 31 | // setup out 32 | auto cfg = out.defaultConfig(); 33 | cfg.sample_rate = 24000; 34 | cfg.channels = 1; 35 | out.begin(cfg); 36 | 37 | // define volume 38 | volume.setVolume(0.6); 39 | 40 | } 41 | 42 | void increment() { 43 | number +=1; 44 | } 45 | 46 | void loop() { 47 | // speach output 48 | utt.say(number, "usd"); 49 | 50 | increment(); 51 | delay(1000); 52 | } -------------------------------------------------------------------------------- /tools/audio.csv: -------------------------------------------------------------------------------- 1 | Name,Text 2 | zero,zero 3 | one,one 4 | two,two 5 | three,three 6 | four,four 7 | five,five 8 | six,six 9 | seven,seven 10 | eight,eight 11 | nine,nine 12 | ten,ten 13 | eleven,eleven 14 | twelve,twelve 15 | thirteen,thirteen 16 | fourteen,fourteen 17 | fifteen,fifteen 18 | sixteen,sixteen 19 | seventeen,seventeen 20 | eighteen,eighteen 21 | nineteen,nineteen 22 | ten,ten 23 | twenty,twenty 24 | thirty,thirty 25 | forty,forty 26 | fifty,fifty 27 | sixty,sixty 28 | seventy,seventy 29 | eighty,eighty 30 | ninety,ninety 31 | and,and 32 | dot,dot 33 | point,point 34 | minus,minus 35 | hundred,hundred 36 | thousand,thousand 37 | million,million 38 | billion,billion 39 | its,its 40 | noon,noon 41 | midnight,midnight 42 | oclock,oclock 43 | to,to 44 | past,past 45 | am,am 46 | pm,pm 47 | half,half 48 | quarter,quarter 49 | pound,pound 50 | pounds,pounds 51 | foot,foot 52 | feet,feet 53 | inch,inch 54 | inches,inches 55 | mile,mile 56 | miles,miles 57 | dollar,dollar 58 | dollars,dollars 59 | cent,cent 60 | cents,cents 61 | miles,miles 62 | per,per 63 | hour,hour 64 | degrees,degrees 65 | celcius,celcius 66 | degrees,degrees 67 | fahrenheit,fahrenheit 68 | percent,percent 69 | liter,liter 70 | milli,milli 71 | gram,gram 72 | kilo,kilo 73 | milli,milli 74 | kilo,kilo 75 | meter,meter 76 | centi,centi 77 | milli,milli 78 | us,u.s. 79 | 80 | 81 | -------------------------------------------------------------------------------- /docs/html/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 18 | image/svg+xml 19 | 21 | 22 | 23 | 24 | 25 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_time.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_time}{}\doxysection{simple\+\_\+tts\+::Time Struct Reference} 2 | \label{structsimple__tts_1_1_time}\index{simple\_tts::Time@{simple\_tts::Time}} 3 | 4 | 5 | Just a simple structure with the hour and minutes. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | \doxysubsection*{Public Member Functions} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{structsimple__tts_1_1_time_a3d9445f31c0aa04fa4eddf55e74c660a}\label{structsimple__tts_1_1_time_a3d9445f31c0aa04fa4eddf55e74c660a}} 16 | {\bfseries Time} (int hour, int minutes) 17 | \end{DoxyCompactItemize} 18 | \doxysubsection*{Public Attributes} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | \mbox{\Hypertarget{structsimple__tts_1_1_time_ac457b2b4c52fa750f9805d66d2678212}\label{structsimple__tts_1_1_time_ac457b2b4c52fa750f9805d66d2678212}} 22 | int {\bfseries hour} =0 23 | \item 24 | \mbox{\Hypertarget{structsimple__tts_1_1_time_ad9182823ae9ef734d313956b72f7d0b4}\label{structsimple__tts_1_1_time_ad9182823ae9ef734d313956b72f7d0b4}} 25 | int {\bfseries minute} =0 26 | \end{DoxyCompactItemize} 27 | 28 | 29 | \doxysubsection{Detailed Description} 30 | Just a simple structure with the hour and minutes. 31 | 32 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 33 | \item 34 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 35 | -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_audio_s_d_entry.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_audio_s_d_entry}{}\doxysection{simple\+\_\+tts\+::Audio\+SDEntry Struct Reference} 2 | \label{structsimple__tts_1_1_audio_s_d_entry}\index{simple\_tts::AudioSDEntry@{simple\_tts::AudioSDEntry}} 3 | 4 | 5 | An Entry for the in Memory Audio Dictionary which contains the full text. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | \doxysubsection*{Public Attributes} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{structsimple__tts_1_1_audio_s_d_entry_ab21ba39389e30f386c171d592fa7c539}\label{structsimple__tts_1_1_audio_s_d_entry_ab21ba39389e30f386c171d592fa7c539}} 16 | const char $\ast$ {\bfseries name} 17 | \item 18 | \mbox{\Hypertarget{structsimple__tts_1_1_audio_s_d_entry_ae84a36eb35143451df746ddb306b3d43}\label{structsimple__tts_1_1_audio_s_d_entry_ae84a36eb35143451df746ddb306b3d43}} 19 | const char $\ast$ {\bfseries text} = nullptr 20 | \end{DoxyCompactItemize} 21 | 22 | 23 | \doxysubsection{Detailed Description} 24 | An Entry for the in Memory Audio Dictionary which contains the full text. 25 | 26 | \begin{DoxyAuthor}{Author} 27 | Phil Schatzmann 28 | \end{DoxyAuthor} 29 | \begin{DoxyCopyright}{Copyright} 30 | GPLv3 31 | \end{DoxyCopyright} 32 | 33 | 34 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 35 | \item 36 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 37 | -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_audio_dictionary_entry.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_audio_dictionary_entry}{}\doxysection{simple\+\_\+tts\+::Audio\+Dictionary\+Entry Struct Reference} 2 | \label{structsimple__tts_1_1_audio_dictionary_entry}\index{simple\_tts::AudioDictionaryEntry@{simple\_tts::AudioDictionaryEntry}} 3 | 4 | 5 | An Entry for the in Memory Audio Dictionary. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | \doxysubsection*{Public Attributes} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{structsimple__tts_1_1_audio_dictionary_entry_a8cf05b29c948f218efc8cde502f8cb01}\label{structsimple__tts_1_1_audio_dictionary_entry_a8cf05b29c948f218efc8cde502f8cb01}} 16 | const char $\ast$ {\bfseries name} 17 | \item 18 | \mbox{\Hypertarget{structsimple__tts_1_1_audio_dictionary_entry_abf5333c1498df8a8406ef66f08af0795}\label{structsimple__tts_1_1_audio_dictionary_entry_abf5333c1498df8a8406ef66f08af0795}} 19 | Audio\+Stream $\ast$ {\bfseries audio} 20 | \end{DoxyCompactItemize} 21 | 22 | 23 | \doxysubsection{Detailed Description} 24 | An Entry for the in Memory Audio Dictionary. 25 | 26 | \begin{DoxyAuthor}{Author} 27 | Phil Schatzmann 28 | \end{DoxyAuthor} 29 | \begin{DoxyCopyright}{Copyright} 30 | GPLv3 31 | \end{DoxyCopyright} 32 | 33 | 34 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 35 | \item 36 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 37 | -------------------------------------------------------------------------------- /examples/time-to-speech/time-to-speech.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file time-to-speech.ino 4 | * @author Phil Schatzmann 5 | * @brief Test sketch which announces the indicated time 6 | * @version 0.1 7 | * @date 2022-02-16 8 | * 9 | * @copyright Copyright (c) 2022 10 | * 11 | */ 12 | #include "AudioTools.h" 13 | #include "SimpleTTS.h" 14 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 15 | #include "Desktop.h" // some special logic for desktop builds 16 | #ifndef IS_DESKTOP 17 | #include "AudioTools/AudioLibs/AudioBoardStream.h" 18 | #endif 19 | 20 | 21 | TimeToText ttt; 22 | AudioBoardStream out(AudioKitEs8388V1); // Replace with desired class e.g. I2SStream 23 | MP3DecoderHelix mp3; 24 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 25 | TextToSpeech tts(ttt, out, mp3, dictionary); 26 | int hour=0, minute=0; 27 | 28 | void setup(){ 29 | Serial.begin(115200); 30 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 31 | 32 | // setup out 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | } 38 | 39 | void addMinutes(int minutes) { 40 | minute+=minutes; 41 | if (minute>=60){ 42 | minute=0; 43 | hour++;; 44 | } 45 | if (hour>=24){ 46 | hour = 0; 47 | } 48 | } 49 | 50 | void loop() { 51 | // speach output 52 | ttt.say(hour,minute); 53 | 54 | // generate next time 55 | delay(2000); 56 | addMinutes(10); 57 | } -------------------------------------------------------------------------------- /examples/unit-to-speech/unit-to-speech.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file unit-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers with units into speech 5 | * I used it with an AudioKit. If you want to use it with a regular micrcontroller 6 | * - remove the include "AudioLibs/AudioKit.h" 7 | * - replace the AudioBoardStream with I2SStream, AnalogAudioStream, PMWAudioStream 8 | * @version 0.1 9 | * @date 2022-02-16 10 | * 11 | * @copyright Copyright (c) 2022 12 | * 13 | */ 14 | 15 | #include "SimpleTTS.h" 16 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 17 | #include "Desktop.h" // some special logic for desktop builds 18 | 19 | #ifndef IS_DESKTOP 20 | #include "AudioTools/AudioLibs/AudioBoardStream.h" // for AudioKit 21 | #endif 22 | 23 | NumberUnitToText utt; 24 | AudioBoardStream out(AudioKitEs8388V1); // Replace with desired class e.g. I2SStream 25 | MP3DecoderHelix mp3; 26 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 27 | TextToSpeech tts(utt, out, mp3, dictionary); 28 | 29 | double number = 1.1; 30 | 31 | void setup(){ 32 | Serial.begin(115200); 33 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 34 | 35 | // setup out 36 | auto cfg = out.defaultConfig(); 37 | cfg.sample_rate = 24000; 38 | cfg.channels = 1; 39 | out.begin(cfg); 40 | } 41 | 42 | void increment() { 43 | number +=1; 44 | } 45 | 46 | void loop() { 47 | // speach output 48 | utt.say(number, "usd"); 49 | 50 | increment(); 51 | delay(1000); 52 | } -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info}{}\doxysection{simple\+\_\+tts\+::Number\+Unit\+To\+Text\+::Decimal\+Info Struct Reference} 2 | \label{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info}\index{simple\_tts::NumberUnitToText::DecimalInfo@{simple\_tts::NumberUnitToText::DecimalInfo}} 3 | 4 | 5 | Units might have different decimals. The decimal system is based on 3. But currencies have usually 2. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Number\+Unit\+To\+Text.\+h$>$} 11 | 12 | \doxysubsection*{Public Attributes} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info_a7e0f4560ce3e778db44c35f8d89fc0c9}\label{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info_a7e0f4560ce3e778db44c35f8d89fc0c9}} 16 | const char $\ast$ {\bfseries id} 17 | \item 18 | \mbox{\Hypertarget{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info_a007f6a09c222049545017b201785064f}\label{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info_a007f6a09c222049545017b201785064f}} 19 | int {\bfseries dec} 20 | \end{DoxyCompactItemize} 21 | 22 | 23 | \doxysubsection{Detailed Description} 24 | Units might have different decimals. The decimal system is based on 3. But currencies have usually 2. 25 | 26 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 27 | \item 28 | src/Number\+Unit\+To\+Text.\+h\end{DoxyCompactItemize} 29 | -------------------------------------------------------------------------------- /docs/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['alltexts_0',['allTexts',['../classsimple__tts_1_1_number_to_text.html#ae7cdf641730a749293956193b785a772',1,'simple_tts::NumberToText::allTexts()'],['../classsimple__tts_1_1_number_unit_to_text.html#adfa5999c7e6b9adc5f51d8213614abc3',1,'simple_tts::NumberUnitToText::allTexts()'],['../classsimple__tts_1_1_time_to_text.html#a74b2534f6c65dc2f3a5403952ff80690',1,'simple_tts::TimeToText::allTexts()']]], 4 | ['arduino_20simple_20tts_1',['Arduino Simple TTS',['../index.html',1,'']]], 5 | ['audiodictionary_2',['AudioDictionary',['../classsimple__tts_1_1_audio_dictionary.html',1,'simple_tts']]], 6 | ['audiodictionarybase_3',['AudioDictionaryBase',['../classsimple__tts_1_1_audio_dictionary_base.html',1,'simple_tts']]], 7 | ['audiodictionaryentry_4',['AudioDictionaryEntry',['../structsimple__tts_1_1_audio_dictionary_entry.html',1,'simple_tts']]], 8 | ['audiodictionarysd_5',['AudioDictionarySD',['../classsimple__tts_1_1_audio_dictionary_s_d.html',1,'simple_tts']]], 9 | ['audiodictionaryurl_6',['AudioDictionaryURL',['../classsimple__tts_1_1_audio_dictionary_u_r_l.html',1,'simple_tts']]], 10 | ['audiosdentry_7',['AudioSDEntry',['../structsimple__tts_1_1_audio_s_d_entry.html',1,'simple_tts']]], 11 | ['audiostreamfilewrapper_8',['AudioStreamFileWrapper',['../classsimple__tts_1_1_audio_stream_file_wrapper.html',1,'simple_tts']]], 12 | ['audiostreamfilewrapper_3c_20audiofile_20_3e_9',['AudioStreamFileWrapper< AudioFile >',['../classsimple__tts_1_1_audio_stream_file_wrapper.html',1,'simple_tts']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_audio_dictionary_entry_ext.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_audio_dictionary_entry_ext}{}\doxysection{simple\+\_\+tts\+::Audio\+Dictionary\+Entry\+Ext Struct Reference} 2 | \label{structsimple__tts_1_1_audio_dictionary_entry_ext}\index{simple\_tts::AudioDictionaryEntryExt@{simple\_tts::AudioDictionaryEntryExt}} 3 | 4 | 5 | An Entry for the in Memory Audio Dictionary which contains the full text. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Audio\+Dictionary\+Entry\+Ext\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=2.000000cm]{structsimple__tts_1_1_audio_dictionary_entry_ext} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Attributes} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | \mbox{\Hypertarget{structsimple__tts_1_1_audio_dictionary_entry_ext_a5466223156cc4f051f8e0d1acc77be4b}\label{structsimple__tts_1_1_audio_dictionary_entry_ext_a5466223156cc4f051f8e0d1acc77be4b}} 22 | const char $\ast$ {\bfseries text} = nullptr 23 | \end{DoxyCompactItemize} 24 | 25 | 26 | \doxysubsection{Detailed Description} 27 | An Entry for the in Memory Audio Dictionary which contains the full text. 28 | 29 | \begin{DoxyAuthor}{Author} 30 | Phil Schatzmann 31 | \end{DoxyAuthor} 32 | \begin{DoxyCopyright}{Copyright} 33 | GPLv3 34 | \end{DoxyCopyright} 35 | 36 | 37 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 38 | \item 39 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 40 | -------------------------------------------------------------------------------- /docs/html/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/classes_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/classes_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/html/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /src/time/TimeInfoRTC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SimpleTTS.h" 4 | #include "uRTCLib.h" 5 | 6 | /** 7 | * @brief A simple class which provides the time with the help of a RTC library 8 | * https://github.com/Naguissa/uRTCLib 9 | */ 10 | class TimeInfo { 11 | public: 12 | void begin(uRTCLib &rtc) { 13 | p_rtc = &rtc; 14 | Wire.begin(); 15 | } 16 | 17 | /// annonce only evry n minutes 18 | void setEveryMinutes(int n) { this->minutes = n; } 19 | 20 | // update only every 1 sec 21 | bool update() { 22 | bool result = false; 23 | if (millis() > timeout) { 24 | struct tm timeinfo; 25 | p_rtc->refresh(); 26 | // update time 27 | currentTime.hour = p_rtc->hour(); 28 | currentTime.minute = p_rtc->minute(); 29 | 30 | // check if we need to announce the time 31 | if (isDirty() && isRelevant()) { 32 | result = true; 33 | timeAnnounced = currentTime; 34 | } 35 | 36 | // update timeout 37 | timeout = millis() + 1000; 38 | } 39 | return result; 40 | } 41 | 42 | /// gets the actual time 43 | SimpleTime time() { return currentTime; } 44 | 45 | protected: 46 | int minutes = 5; 47 | unsigned long timeout; 48 | const long gmtOffset_sec = 3600; 49 | const int daylightOffset_sec = 3600; 50 | SimpleTime currentTime; 51 | SimpleTime timeAnnounced; 52 | uRTCLib *p_rtc = nullptr; 53 | 54 | // returns true if we need to announce a new time 55 | bool isDirty() { return currentTime != timeAnnounced; } 56 | // returns true if the minutes are a multiple 57 | bool isRelevant() { return currentTime.minute % minutes == 0; } 58 | }; -------------------------------------------------------------------------------- /docs/latex/files.tex: -------------------------------------------------------------------------------- 1 | \doxysection{File List} 2 | Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{src/\mbox{\hyperlink{_audio_dictionary_8h_source}{Audio\+Dictionary.\+h}} }{\pageref{_audio_dictionary_8h_source}}{} 4 | \item\contentsline{section}{src/\mbox{\hyperlink{_audio_dictionary_s_d_8h_source}{Audio\+Dictionary\+SD.\+h}} }{\pageref{_audio_dictionary_s_d_8h_source}}{} 5 | \item\contentsline{section}{src/\mbox{\hyperlink{_audio_dictionary_u_r_l_8h_source}{Audio\+Dictionary\+URL.\+h}} }{\pageref{_audio_dictionary_u_r_l_8h_source}}{} 6 | \item\contentsline{section}{src/\mbox{\hyperlink{_number_to_text_8h_source}{Number\+To\+Text.\+h}} }{\pageref{_number_to_text_8h_source}}{} 7 | \item\contentsline{section}{src/\mbox{\hyperlink{_number_unit_to_text_8h_source}{Number\+Unit\+To\+Text.\+h}} }{\pageref{_number_unit_to_text_8h_source}}{} 8 | \item\contentsline{section}{src/\mbox{\hyperlink{_simple_t_t_s_8h_source}{Simple\+TTS.\+h}} }{\pageref{_simple_t_t_s_8h_source}}{} 9 | \item\contentsline{section}{src/\mbox{\hyperlink{_simple_t_t_s_base_8h_source}{Simple\+TTSBase.\+h}} }{\pageref{_simple_t_t_s_base_8h_source}}{} 10 | \item\contentsline{section}{src/\mbox{\hyperlink{_text_to_speech_8h_source}{Text\+To\+Speech.\+h}} }{\pageref{_text_to_speech_8h_source}}{} 11 | \item\contentsline{section}{src/\mbox{\hyperlink{_text_to_speech_queue_8h_source}{Text\+To\+Speech\+Queue.\+h}} }{\pageref{_text_to_speech_queue_8h_source}}{} 12 | \item\contentsline{section}{src/\mbox{\hyperlink{_time_to_text_8h_source}{Time\+To\+Text.\+h}} }{\pageref{_time_to_text_8h_source}}{} 13 | \end{DoxyCompactList} 14 | -------------------------------------------------------------------------------- /examples/number-to-speech/number-to-speech.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file number-to-speech.ino 3 | * @author Phil Schatzmann 4 | * @brief Demo that translates numbers into speech 5 | * I tested the sketch with an AudioKit. If you want to use it with a regular micrcontroller 6 | * - remove the include "AudioLibs/AudioKit.h" 7 | * - replace the AudioBoardStream with I2SStream, AnalogAudioStream, PMWAudioStream 8 | * @version 0.1 9 | * @date 2022-02-16 10 | * 11 | * @copyright Copyright (c) 2022 12 | * 13 | */ 14 | 15 | #include "SimpleTTS.h" 16 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 17 | #include "Desktop.h" // some special logic for desktop builds 18 | 19 | #ifndef IS_DESKTOP 20 | #include "AudioTools/AudioLibs/AudioBoardStream.h" 21 | #endif 22 | 23 | NumberToText ntt; 24 | AudioBoardStream out(AudioKitEs8388V1); // Replace with desired class e.g. I2SStream 25 | MP3DecoderHelix mp3; 26 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 27 | TextToSpeech tts(ntt, out, mp3, dictionary); 28 | 29 | int64_t number = 1; 30 | 31 | void setup(){ 32 | Serial.begin(115200); 33 | AudioLogger::instance().begin(Serial, AudioLogger::Warning); 34 | 35 | // setup out 36 | auto cfg = out.defaultConfig(); 37 | cfg.sample_rate = 24000; 38 | cfg.channels = 1; 39 | out.begin(cfg); 40 | } 41 | 42 | void increment() { 43 | // increment number by some value 44 | if(number<1000000000){ 45 | // grow numbers fast 46 | number *=10; 47 | } else { 48 | // grow numbers slow 49 | number +=1; 50 | } 51 | } 52 | 53 | void loop() { 54 | // speach output 55 | ntt.say(number); 56 | 57 | increment(); 58 | delay(1000); 59 | } -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | # set the project name 4 | project(simple-tts-examples) 5 | 6 | include(FetchContent) 7 | 8 | # Build with helix 9 | FetchContent_Declare(helix GIT_REPOSITORY "https://github.com/pschatzmann/arduino-libhelix.git" GIT_TAG main ) 10 | FetchContent_GetProperties(helix) 11 | if(NOT helix_POPULATED) 12 | FetchContent_Populate(helix) 13 | add_subdirectory(${helix_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/helix) 14 | endif() 15 | 16 | # Build with arduino-audio-tools 17 | FetchContent_Declare(audio_tools GIT_REPOSITORY "https://github.com/pschatzmann/arduino-audio-tools.git" GIT_TAG main ) 18 | FetchContent_GetProperties(audio_tools) 19 | if(NOT audio_tools_POPULATED) 20 | FetchContent_Populate(audio_tools) 21 | add_subdirectory(${audio_tools_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/audio_tools) 22 | endif() 23 | 24 | target_compile_definitions(arduino-audio-tools INTERFACE -DARDUINO -DEXIT_ON_STOP -DIS_DESKTOP ) 25 | 26 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/number-to-text") 27 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/time-to-text") 28 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/time-to-speech") 29 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/unit-to-text") 30 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/number-to-speech") 31 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/unit-to-speech") 32 | add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/audio-i2s-nosilence") 33 | # not supported (yet?) 34 | #add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/example-own-sound") 35 | #add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/time-to-speech-sd") 36 | #add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/talking-clock") 37 | -------------------------------------------------------------------------------- /examples/talking-clock/talking-clock.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * @file talking-time.ino 3 | * @author Phil Schatzmann 4 | * @brief A talking clock: You can define how ofter the time is announced with setEveryMinutes 5 | * @version 0.1 6 | * @date 2022-02-16 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | #include "SimpleTTS.h" 12 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 13 | #include "time/TimeInfoESP32.h" // or alternative TimeInfoRTC.h 14 | #include "AudioTools/AudioLibs/AudioBoardStream.h" 15 | 16 | // Output 17 | TimeToText ttt; 18 | AudioBoardStream out(AudioKitEs8388V1); // replace with alterntive Audio Sink if needed: AnalogAudioStream, I2SStream etc. 19 | MP3DecoderHelix mp3; 20 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 21 | TextToSpeech tts(ttt, out, mp3, dictionary); 22 | 23 | // Determine Time 24 | TimeInfo timeInfo; 25 | const char* ssid = "SSID"; 26 | const char* password = "password"; 27 | 28 | void setup() { 29 | Serial.begin(115200); 30 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 31 | 32 | // setup i2s 33 | auto cfg = out.defaultConfig(); 34 | cfg.sample_rate = 24000; 35 | cfg.channels = 1; 36 | out.begin(cfg); 37 | 38 | // We announce the time only every 5 minutes 39 | timeInfo.setEveryMinutes(5); 40 | 41 | // start WIFI and time (ESP32) 42 | timeInfo.begin(ssid, password); 43 | 44 | //uRTCLib rtc(0x68); // alternarive using RTC 45 | //timeInfo.begin(rtc); 46 | 47 | // time at startup 48 | ttt.say(timeInfo.time()); 49 | } 50 | 51 | 52 | void loop() { 53 | // speach output 54 | if (timeInfo.update()){ 55 | ttt.say(timeInfo.time()); 56 | tts.say("SILENCE"); // ESP32: prevent noise at end 57 | } 58 | } -------------------------------------------------------------------------------- /examples/time-to-speech-sd/time-to-speech-sd.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file time-to-speech.ino 4 | * @author Phil Schatzmann 5 | * @brief Test sketch which announces the indicated time. 6 | * I tested the sketch with an AudioKit. If you want to use it with a regular micrcontroller 7 | * - remove the include "AudioLibs/AudioKit.h" 8 | * - replace the AudioBoardStream with I2SStream, AnalogAudioStream, PMWAudioStream 9 | * @version 0.1 10 | * @date 2022-02-16 11 | * 12 | * @copyright Copyright (c) 2022 13 | * 14 | */ 15 | #include "AudioTools.h" 16 | #include "SimpleTTS.h" 17 | #include "AudioDictionarySD.h" 18 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 19 | 20 | #ifndef IS_DESKTOP 21 | #include "AudioTools/AudioLibs/AudioBoardStream.h" // for AudioKit 22 | #endif 23 | 24 | TimeToText ttt; 25 | MP3DecoderHelix mp3; 26 | const char* path = "/tts"; 27 | AudioDictionarySD dictionary(path, "mp3", PIN_AUDIO_KIT_SD_CARD_CS); 28 | AudioBoardStream out(AudioKitEs8388V1); // Replace with desired output class e.g. I2SStream 29 | TextToSpeech tts(ttt, out, mp3, dictionary); 30 | int hour=0, minute=0; 31 | 32 | void setup(){ 33 | Serial.begin(115200); 34 | AudioLogger::instance().begin(Serial, AudioLogger::Warning); 35 | 36 | // setup out 37 | auto cfg = out.defaultConfig(); 38 | cfg.sample_rate = 24000; 39 | cfg.channels = 1; 40 | out.begin(cfg); 41 | } 42 | 43 | void addMinutes(int minutes) { 44 | minute+=minutes; 45 | if (minute>=60){ 46 | minute=0; 47 | hour++;; 48 | } 49 | if (hour>=24){ 50 | hour = 0; 51 | } 52 | } 53 | 54 | void loop() { 55 | // speach output 56 | ttt.say(hour,minute); 57 | 58 | // generate next time 59 | delay(2000); 60 | addMinutes(10); 61 | } 62 | -------------------------------------------------------------------------------- /examples/time-to-speech-url/time-to-speech-url.ino: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file time-to-speech.ino 4 | * @author Phil Schatzmann 5 | * @brief Test sketch which announces the indicated time - the audio files are loaded from the internet. 6 | * However I think this is rather too slow... 7 | * @version 0.1 8 | * @date 2022-02-16 9 | * 10 | * @copyright Copyright (c) 2022 11 | * 12 | */ 13 | #include "AudioTools.h" 14 | #include "SimpleTTS.h" 15 | #include "AudioDictionaryURL.h" 16 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 17 | #include "AudioTools/AudioLibs/AudioBoardStream.h" 18 | 19 | 20 | const char *ssid = "ssid"; 21 | const char *password = "password"; 22 | const char *url = "https://pschatzmann.github.io/arduino-simple-tts/audio/"; 23 | 24 | TimeToText ttt; 25 | URLStream in(ssid, password); 26 | AudioDictionaryURL dictionary(in, url, "mp3"); 27 | MP3DecoderHelix mp3; 28 | AudioBoardStream out(AudioKitEs8388V1); // Replace with desired output class e.g. I2SStream 29 | TextToSpeech tts(ttt, out, mp3, dictionary); 30 | int hour=0, minute=0; 31 | 32 | void setup(){ 33 | Serial.begin(115200); 34 | AudioLogger::instance().begin(Serial, AudioLogger::Warning); 35 | 36 | // setup in 37 | auto cfg = out.defaultConfig(); 38 | cfg.sd_active = false; // for AudioBoardStream to use all pins 39 | cfg.sample_rate = 24000; 40 | cfg.channels = 1; 41 | out.begin(cfg); 42 | 43 | // speach output 44 | ttt.say(11,40); 45 | } 46 | 47 | void addMinutes(int minutes) { 48 | minute+=minutes; 49 | if (minute>=60){ 50 | minute=0; 51 | hour++;; 52 | } 53 | if (hour>=24){ 54 | hour = 0; 55 | } 56 | } 57 | 58 | void loop() { 59 | // speach output 60 | ttt.say(hour,minute); 61 | 62 | // generate next time 63 | delay(2000); 64 | addMinutes(10); 65 | } 66 | -------------------------------------------------------------------------------- /examples/example-own-sound/speechSamples.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "headers/and.h" 4 | #include "headers/angle.h" 5 | #include "headers/axis.h" 6 | #include "headers/billion.h" 7 | #include "headers/calibrated.h" 8 | #include "headers/calibrating.h" 9 | #include "headers/calibration.h" 10 | #include "headers/complete.h" 11 | #include "headers/degrees.h" 12 | #include "headers/disabled.h" 13 | #include "headers/eight.h" 14 | #include "headers/eighteen.h" 15 | #include "headers/eighty.h" 16 | #include "headers/eleven.h" 17 | #include "headers/enabled.h" 18 | #include "headers/exit.h" 19 | #include "headers/fifteen.h" 20 | #include "headers/fifty.h" 21 | #include "headers/five.h" 22 | #include "headers/forty.h" 23 | #include "headers/four.h" 24 | #include "headers/fourteen.h" 25 | #include "headers/hundred.h" 26 | #include "headers/memory.h" 27 | #include "headers/menu.h" 28 | #include "headers/million.h" 29 | #include "headers/minus.h" 30 | #include "headers/nine.h" 31 | #include "headers/nineteen.h" 32 | #include "headers/ninety.h" 33 | #include "headers/one.h" 34 | #include "headers/pitch.h" 35 | #include "headers/plus.h" 36 | #include "headers/roll.h" 37 | #include "headers/save.h" 38 | #include "headers/set.h" 39 | #include "headers/seven.h" 40 | #include "headers/seventeen.h" 41 | #include "headers/seventy.h" 42 | #include "headers/six.h" 43 | #include "headers/sixteen.h" 44 | #include "headers/sixty.h" 45 | #include "headers/tare.h" 46 | #include "headers/ten.h" 47 | #include "headers/thirteen.h" 48 | #include "headers/thirty.h" 49 | #include "headers/thousand.h" 50 | #include "headers/three.h" 51 | #include "headers/trillion.h" 52 | #include "headers/twelve.h" 53 | #include "headers/twenty.h" 54 | #include "headers/two.h" 55 | #include "headers/volume.h" 56 | #include "headers/x.h" 57 | #include "headers/y.h" 58 | #include "headers/yaw.h" 59 | #include "headers/z.h" 60 | #include "headers/zed.h" 61 | #include "headers/zero.h" 62 | -------------------------------------------------------------------------------- /examples/tts-udp-server/tts-udp-server.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tts-udp-server.h 3 | * @author Phil Schatzmann 4 | * @brief A simple UDP server which speaks out words 5 | * @version 0.1 6 | * @date 2022-03-17 7 | * 8 | * @copyright Copyright (c) 2022 9 | * 10 | */ 11 | 12 | #include "SimpleTTS.h" 13 | #include "AudioTools/AudioCodecs/CodecMP3Helix.h" 14 | #include "AudioLibs/Communication.h" 15 | 16 | I2SStream out; 17 | VolumeStream volume(out); 18 | 19 | MP3DecoderHelix mp3; 20 | AudioDictionary dictionary(ExampleAudioDictionaryValues); 21 | NumberToText ntt; 22 | TextToSpeechQueue queue(ntt, volume, mp3, dictionary); 23 | UDPStream udp; 24 | char buffer[160]; 25 | 26 | // Provides a fixed string from dictionary for a temporary input string 27 | const char *toName(char *str) { 28 | for (auto e : ExampleAudioDictionaryValues) { 29 | Str str1(str); 30 | str1.trim(); 31 | if (str1.equalsIgnoreCase(e.name)) { 32 | return e.name; 33 | } 34 | } 35 | return nullptr; 36 | } 37 | 38 | void setup() { 39 | Serial.begin(115200); 40 | AudioLogger::instance().begin(Serial, AudioLogger::Info); 41 | 42 | // setting the volume 43 | volume.setVolume(0.6); 44 | 45 | // setup out 46 | auto cfg = out.defaultConfig(); 47 | cfg.sample_rate = 24000; 48 | cfg.channels = 1; 49 | out.begin(cfg); 50 | } 51 | 52 | void loop() { 53 | // fill queue with words from UDP 54 | while (udp.available()) { 55 | if (udp.readBytesUntil(' ', (uint8_t*)buffer, 160) > 0) { 56 | Str bufferStr((const char*)buffer); 57 | bufferStr.trim(); 58 | if (bufferStr.isNumber()) { 59 | double value = bufferStr.toDouble(); 60 | int decimals = bufferStr.numberOfDecimals(); 61 | for (auto str : ntt.say(value, decimals)) { 62 | queue.say(toName((char*)str)); 63 | } 64 | } else { 65 | queue.say(toName(buffer)); 66 | } 67 | } 68 | } 69 | // play next word in queue 70 | queue.process(); 71 | } -------------------------------------------------------------------------------- /src/en/all.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // numbers 4 | #include "and.h" 5 | #include "eighteen.h" 6 | #include "fifty.h" 7 | #include "forty.h" 8 | #include "nine.h" 9 | #include "one.h" 10 | #include "six.h" 11 | #include "thirteen.h" 12 | #include "twelve.h" 13 | #include "billion.h" 14 | #include "eighty.h" 15 | #include "five.h" 16 | #include "hundred.h" 17 | #include "nineteen.h" 18 | #include "seven.h" 19 | #include "sixteen.h" 20 | #include "thirty.h" 21 | #include "twenty.h" 22 | #include "dot.h" 23 | #include "eleven.h" 24 | #include "four.h" 25 | #include "million.h" 26 | #include "ninety.h" 27 | #include "seventeen.h" 28 | #include "sixty.h" 29 | #include "thousand.h" 30 | #include "two.h" 31 | #include "eight.h" 32 | #include "fifteen.h" 33 | #include "fourteen.h" 34 | #include "minus.h" 35 | #include "oclock.h" 36 | #include "seventy.h" 37 | #include "ten.h" 38 | #include "three.h" 39 | #include "zero.h" 40 | #include "dot.h" 41 | #include "point.h" 42 | // time 43 | #include "am.h" 44 | #include "half.h" 45 | #include "half.h" 46 | #include "its.h" 47 | #include "midnight.h" 48 | #include "noon.h" 49 | #include "past.h" 50 | #include "pm.h" 51 | #include "quarter.h" 52 | #include "to.h" 53 | 54 | // units 55 | #include "pound.h" 56 | #include "pounds.h" 57 | #include "foot.h" 58 | #include "feet.h" 59 | #include "inch.h" 60 | #include "inches.h" 61 | #include "mile.h" 62 | #include "miles.h" 63 | #include "dollar.h" 64 | #include "dollars.h" 65 | #include "cent.h" 66 | #include "cents.h" 67 | #include "miles.h" 68 | #include "per.h" 69 | #include "hour.h" 70 | #include "degrees.h" 71 | #include "celcius.h" 72 | #include "degrees.h" 73 | #include "fahrenheit.h" 74 | #include "percent.h" 75 | #include "liter.h" 76 | #include "milli.h" 77 | #include "gram.h" 78 | #include "kilo.h" 79 | #include "milli.h" 80 | #include "kilo.h" 81 | #include "meter.h" 82 | #include "centi.h" 83 | #include "milli.h" 84 | #include "us.h" -------------------------------------------------------------------------------- /docs/latex/structsimple__tts_1_1_simple_time.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{structsimple__tts_1_1_simple_time}{}\doxysection{simple\+\_\+tts\+::Simple\+Time Struct Reference} 2 | \label{structsimple__tts_1_1_simple_time}\index{simple\_tts::SimpleTime@{simple\_tts::SimpleTime}} 3 | 4 | 5 | Just a simple structure with the hour and minutes. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | \doxysubsection*{Public Member Functions} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{structsimple__tts_1_1_simple_time_a401d63fad8996d3f30f8e11f83ee8fa3}\label{structsimple__tts_1_1_simple_time_a401d63fad8996d3f30f8e11f83ee8fa3}} 16 | {\bfseries Simple\+Time} (int hour, int minutes) 17 | \item 18 | \mbox{\Hypertarget{structsimple__tts_1_1_simple_time_a9bff77a8bdd901db8de6706580e4cff8}\label{structsimple__tts_1_1_simple_time_a9bff77a8bdd901db8de6706580e4cff8}} 19 | bool {\bfseries operator==} (const \mbox{\hyperlink{structsimple__tts_1_1_simple_time}{Simple\+Time}} \&alt) 20 | \item 21 | \mbox{\Hypertarget{structsimple__tts_1_1_simple_time_a8feaa1c44530d6925ae5592227047de9}\label{structsimple__tts_1_1_simple_time_a8feaa1c44530d6925ae5592227047de9}} 22 | bool {\bfseries operator!=} (const \mbox{\hyperlink{structsimple__tts_1_1_simple_time}{Simple\+Time}} \&alt) 23 | \end{DoxyCompactItemize} 24 | \doxysubsection*{Public Attributes} 25 | \begin{DoxyCompactItemize} 26 | \item 27 | \mbox{\Hypertarget{structsimple__tts_1_1_simple_time_a72db4d803204556a3427c8f00779212f}\label{structsimple__tts_1_1_simple_time_a72db4d803204556a3427c8f00779212f}} 28 | int {\bfseries hour} = 0 29 | \item 30 | \mbox{\Hypertarget{structsimple__tts_1_1_simple_time_a1fb5a32cb6ed0b6da64a29362d909ebc}\label{structsimple__tts_1_1_simple_time_a1fb5a32cb6ed0b6da64a29362d909ebc}} 31 | int {\bfseries minute} = 0 32 | \end{DoxyCompactItemize} 33 | 34 | 35 | \doxysubsection{Detailed Description} 36 | Just a simple structure with the hour and minutes. 37 | 38 | \begin{DoxyAuthor}{Author} 39 | Phil Schatzmann 40 | \end{DoxyAuthor} 41 | \begin{DoxyCopyright}{Copyright} 42 | GPLv3 43 | \end{DoxyCopyright} 44 | 45 | 46 | The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} 47 | \item 48 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 49 | -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_audio_dictionary_base.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_audio_dictionary_base}{}\doxysection{simple\+\_\+tts\+::Audio\+Dictionary\+Base Class Reference} 2 | \label{classsimple__tts_1_1_audio_dictionary_base}\index{simple\_tts::AudioDictionaryBase@{simple\_tts::AudioDictionaryBase}} 3 | 4 | 5 | Dictionary which provides a Stream of Audio for the indicated word. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Audio\+Dictionary\+Base\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=1.876047cm]{classsimple__tts_1_1_audio_dictionary_base} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Member Functions} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | virtual Audio\+Stream $\ast$ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base_aa44fb2736db525038696b088bd90716f}{get}} (const char $\ast$word)=0 22 | \end{DoxyCompactItemize} 23 | 24 | 25 | \doxysubsection{Detailed Description} 26 | Dictionary which provides a Stream of Audio for the indicated word. 27 | 28 | \begin{DoxyAuthor}{Author} 29 | Phil Schatzmann 30 | \end{DoxyAuthor} 31 | \begin{DoxyCopyright}{Copyright} 32 | GPLv3 33 | \end{DoxyCopyright} 34 | 35 | 36 | \doxysubsection{Member Function Documentation} 37 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_base_aa44fb2736db525038696b088bd90716f}\label{classsimple__tts_1_1_audio_dictionary_base_aa44fb2736db525038696b088bd90716f}} 38 | \index{simple\_tts::AudioDictionaryBase@{simple\_tts::AudioDictionaryBase}!get@{get}} 39 | \index{get@{get}!simple\_tts::AudioDictionaryBase@{simple\_tts::AudioDictionaryBase}} 40 | \doxysubsubsection{\texorpdfstring{get()}{get()}} 41 | {\footnotesize\ttfamily virtual Audio\+Stream $\ast$ simple\+\_\+tts\+::\+Audio\+Dictionary\+Base\+::get (\begin{DoxyParamCaption}\item[{const char $\ast$}]{word }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}} 42 | 43 | 44 | 45 | Implemented in \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_s_d_a6408d3dded7a71531a53fb4e0b8c48c1}{simple\+\_\+tts\+::\+Audio\+Dictionary\+SD}}. 46 | 47 | 48 | 49 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 50 | \item 51 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 52 | -------------------------------------------------------------------------------- /src/time/TimeInfoESP32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "SimpleTTS.h" 5 | #include "time.h" 6 | 7 | /** 8 | * @brief A simple class which provides the time 9 | * This is working only on a ESP32 using a time server. If you have a processor 10 | * that does not support wifi you will need to replace this logic with one based 11 | * on a RTC module. 12 | */ 13 | class TimeInfo { 14 | public: 15 | void begin(const char* ssid, const char* password) { 16 | // connect to WiFi 17 | Serial.print("Connecting to "); 18 | Serial.println(ssid); 19 | WiFi.begin(ssid, password); 20 | while (WiFi.status() != WL_CONNECTED) { 21 | delay(500); 22 | Serial.print("."); 23 | } 24 | Serial.println(" CONNECTED"); 25 | configTime(gmtOffset_sec, daylightOffset_sec, ntpServer); 26 | 27 | // setup initial time 28 | update(); 29 | 30 | // disconnect WiFi as it's no longer needed 31 | WiFi.disconnect(true); 32 | WiFi.mode(WIFI_OFF); 33 | } 34 | 35 | /// annonce only evry n minutes 36 | void setEveryMinutes(int n) { this->minutes = n; } 37 | 38 | // update only every 1 sec 39 | bool update() { 40 | bool result = false; 41 | if (millis() > timeout) { 42 | struct tm timeinfo; 43 | if (!getLocalTime(&timeinfo)) { 44 | Serial.println("Failed to obtain time"); 45 | return false; 46 | } 47 | Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S"); 48 | // update time 49 | currentTime.hour = timeinfo.tm_hour; 50 | currentTime.minute = timeinfo.tm_min; 51 | 52 | // check if we need to announce the time 53 | if (isDirty() && isRelevant()) { 54 | result = true; 55 | timeAnnounced = currentTime; 56 | } 57 | 58 | // update timeout 59 | timeout = millis() + 1000; 60 | } 61 | return result; 62 | } 63 | 64 | /// gets the actual time 65 | SimpleTime time() { return currentTime; } 66 | 67 | protected: 68 | int minutes = 5; 69 | unsigned long timeout; 70 | const char* ntpServer = "europe.pool.ntp.org"; 71 | // For UTC +1.00 : 1 * 60 * 60 : 3600 72 | const long gmtOffset_sec = 3600; 73 | const int daylightOffset_sec = 3600; 74 | SimpleTime currentTime; 75 | SimpleTime timeAnnounced; 76 | 77 | // returns true if we need to announce a new time 78 | bool isDirty() { return currentTime != timeAnnounced; } 79 | // returns true if the minutes are a multiple 80 | bool isRelevant() { return currentTime.minute % minutes == 0; } 81 | }; -------------------------------------------------------------------------------- /docs/html/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['say_0',['say',['../classsimple__tts_1_1_number_to_text.html#aa5cb276b1a65ece56fcae76bb22b6e1d',1,'simple_tts::NumberToText::say(double value, int decimals=2)'],['../classsimple__tts_1_1_number_to_text.html#a6ad6f5daf5caf6fbc9665947ee3cdc5d',1,'simple_tts::NumberToText::say(const char *wholeNumber, const char *decimals="")'],['../classsimple__tts_1_1_number_unit_to_text.html#aaca7f2bfba41ce229addd8d8177a95d0',1,'simple_tts::NumberUnitToText::say(double value, const char *unit=nullptr, int decimals=2)'],['../classsimple__tts_1_1_number_unit_to_text.html#a5e192470d25434cd6d45aec3916fc409',1,'simple_tts::NumberUnitToText::say(int64_t wholeNumber, const char *unit=nullptr)'],['../classsimple__tts_1_1_number_unit_to_text.html#acf1210691e7681c739e27e6cba875bcf',1,'simple_tts::NumberUnitToText::say(const char *wholeNumber, const char *decimals, const char *unitIn)'],['../classsimple__tts_1_1_text_to_speech.html#ac832e8ee5f5631cc8a75d0afd2ab824d',1,'simple_tts::TextToSpeech::say(const char *word)'],['../classsimple__tts_1_1_text_to_speech.html#a3e32159205a745f4d3a59b40ce57c57b',1,'simple_tts::TextToSpeech::say(audio_tools::Vector< const char * > words)'],['../classsimple__tts_1_1_text_to_speech_queue.html#a209230ab9488a96986199e2fdb264016',1,'simple_tts::TextToSpeechQueue::say(const char *word)'],['../classsimple__tts_1_1_text_to_speech_queue.html#af6ae6fd328a073cd9b386881e0a10890',1,'simple_tts::TextToSpeechQueue::say(const char *word[], int size)'],['../classsimple__tts_1_1_text_to_speech_queue.html#a990fdaf4629913f1c7b542a25aac8f33',1,'simple_tts::TextToSpeechQueue::say(char *(&word)[N])'],['../classsimple__tts_1_1_text_to_speech_queue.html#ad946ed72d69896178a587ad57ff04c1a',1,'simple_tts::TextToSpeechQueue::say(audio_tools::Vector< const char * > words)'],['../classsimple__tts_1_1_time_to_text.html#a65c5d0ca832cda665a63697293f94fb7',1,'simple_tts::TimeToText::say(int hour, int minutes)'],['../classsimple__tts_1_1_time_to_text.html#a3fea7fbf6c9cc754049c144c8fdfffd5',1,'simple_tts::TimeToText::say(SimpleTime time)']]], 4 | ['saynow_1',['sayNow',['../classsimple__tts_1_1_text_to_speech_queue.html#abc85a3fedac7b291c783440d2112ca79',1,'simple_tts::TextToSpeechQueue']]], 5 | ['silence_2',['silence',['../classsimple__tts_1_1_text_to_speech_queue.html#a0ee45611587039062104c1ed7f6cac35',1,'simple_tts::TextToSpeechQueue']]], 6 | ['size_3',['size',['../classsimple__tts_1_1_text_to_speech_queue.html#ad02e6edf96cf855bbd8721dd4f5f3f43',1,'simple_tts::TextToSpeechQueue']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/latex/hierarchy.tex: -------------------------------------------------------------------------------- 1 | \doxysection{Class Hierarchy} 2 | This inheritance list is sorted roughly, but not completely, alphabetically\+:\begin{DoxyCompactList} 3 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Dictionary\+Base}{\pageref{classsimple__tts_1_1_audio_dictionary_base}}{} 4 | \begin{DoxyCompactList} 5 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Dictionary}{\pageref{classsimple__tts_1_1_audio_dictionary}}{} 6 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Dictionary\+SD}{\pageref{classsimple__tts_1_1_audio_dictionary_s_d}}{} 7 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Dictionary\+URL}{\pageref{classsimple__tts_1_1_audio_dictionary_u_r_l}}{} 8 | \end{DoxyCompactList} 9 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Dictionary\+Entry}{\pageref{structsimple__tts_1_1_audio_dictionary_entry}}{} 10 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+SDEntry}{\pageref{structsimple__tts_1_1_audio_s_d_entry}}{} 11 | \item Audio\+Stream\begin{DoxyCompactList} 12 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Stream\+File\+Wrapper\texorpdfstring{$<$}{<} Audio\+File \texorpdfstring{$>$}{>}}{\pageref{classsimple__tts_1_1_audio_stream_file_wrapper}}{} 13 | \item \contentsline{section}{simple\+\_\+tts\+::Audio\+Stream\+File\+Wrapper\texorpdfstring{$<$}{<} T \texorpdfstring{$>$}{>}}{\pageref{classsimple__tts_1_1_audio_stream_file_wrapper}}{} 14 | \end{DoxyCompactList} 15 | \item \contentsline{section}{simple\+\_\+tts\+::Number\+Unit\+To\+Text\+::Decimal\+Info}{\pageref{structsimple__tts_1_1_number_unit_to_text_1_1_decimal_info}}{} 16 | \item \contentsline{section}{simple\+\_\+tts\+::Number}{\pageref{classsimple__tts_1_1_number}}{} 17 | \item \contentsline{section}{simple\+\_\+tts\+::Simple\+Time}{\pageref{structsimple__tts_1_1_simple_time}}{} 18 | \item \contentsline{section}{simple\+\_\+tts\+::Simple\+TTSBase}{\pageref{classsimple__tts_1_1_simple_t_t_s_base}}{} 19 | \begin{DoxyCompactList} 20 | \item \contentsline{section}{simple\+\_\+tts\+::Number\+To\+Text}{\pageref{classsimple__tts_1_1_number_to_text}}{} 21 | \item \contentsline{section}{simple\+\_\+tts\+::Number\+Unit\+To\+Text}{\pageref{classsimple__tts_1_1_number_unit_to_text}}{} 22 | \item \contentsline{section}{simple\+\_\+tts\+::Time\+To\+Text}{\pageref{classsimple__tts_1_1_time_to_text}}{} 23 | \end{DoxyCompactList} 24 | \item \contentsline{section}{simple\+\_\+tts\+::Text\+To\+Speech}{\pageref{classsimple__tts_1_1_text_to_speech}}{} 25 | \item \contentsline{section}{simple\+\_\+tts\+::Text\+To\+Speech\+Queue}{\pageref{classsimple__tts_1_1_text_to_speech_queue}}{} 26 | \end{DoxyCompactList} 27 | -------------------------------------------------------------------------------- /docs/html/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 57 | 63 | 69 | 74 | 75 | -------------------------------------------------------------------------------- /docs/html/search/mag_seld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 57 | 63 | 69 | 74 | 75 | -------------------------------------------------------------------------------- /docs/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['say_0',['say',['../classsimple__tts_1_1_number_to_text.html#aa5cb276b1a65ece56fcae76bb22b6e1d',1,'simple_tts::NumberToText::say(double value, int decimals=2)'],['../classsimple__tts_1_1_number_to_text.html#a6ad6f5daf5caf6fbc9665947ee3cdc5d',1,'simple_tts::NumberToText::say(const char *wholeNumber, const char *decimals="")'],['../classsimple__tts_1_1_number_unit_to_text.html#aaca7f2bfba41ce229addd8d8177a95d0',1,'simple_tts::NumberUnitToText::say(double value, const char *unit=nullptr, int decimals=2)'],['../classsimple__tts_1_1_number_unit_to_text.html#a5e192470d25434cd6d45aec3916fc409',1,'simple_tts::NumberUnitToText::say(int64_t wholeNumber, const char *unit=nullptr)'],['../classsimple__tts_1_1_number_unit_to_text.html#acf1210691e7681c739e27e6cba875bcf',1,'simple_tts::NumberUnitToText::say(const char *wholeNumber, const char *decimals, const char *unitIn)'],['../classsimple__tts_1_1_text_to_speech.html#ac832e8ee5f5631cc8a75d0afd2ab824d',1,'simple_tts::TextToSpeech::say(const char *word)'],['../classsimple__tts_1_1_text_to_speech.html#a3e32159205a745f4d3a59b40ce57c57b',1,'simple_tts::TextToSpeech::say(audio_tools::Vector< const char * > words)'],['../classsimple__tts_1_1_text_to_speech_queue.html#a209230ab9488a96986199e2fdb264016',1,'simple_tts::TextToSpeechQueue::say(const char *word)'],['../classsimple__tts_1_1_text_to_speech_queue.html#af6ae6fd328a073cd9b386881e0a10890',1,'simple_tts::TextToSpeechQueue::say(const char *word[], int size)'],['../classsimple__tts_1_1_text_to_speech_queue.html#a990fdaf4629913f1c7b542a25aac8f33',1,'simple_tts::TextToSpeechQueue::say(char *(&word)[N])'],['../classsimple__tts_1_1_text_to_speech_queue.html#ad946ed72d69896178a587ad57ff04c1a',1,'simple_tts::TextToSpeechQueue::say(audio_tools::Vector< const char * > words)'],['../classsimple__tts_1_1_time_to_text.html#a65c5d0ca832cda665a63697293f94fb7',1,'simple_tts::TimeToText::say(int hour, int minutes)'],['../classsimple__tts_1_1_time_to_text.html#a3fea7fbf6c9cc754049c144c8fdfffd5',1,'simple_tts::TimeToText::say(SimpleTime time)']]], 4 | ['saynow_1',['sayNow',['../classsimple__tts_1_1_text_to_speech_queue.html#abc85a3fedac7b291c783440d2112ca79',1,'simple_tts::TextToSpeechQueue']]], 5 | ['silence_2',['silence',['../classsimple__tts_1_1_text_to_speech_queue.html#a0ee45611587039062104c1ed7f6cac35',1,'simple_tts::TextToSpeechQueue']]], 6 | ['simpletime_3',['SimpleTime',['../structsimple__tts_1_1_simple_time.html',1,'simple_tts']]], 7 | ['simplettsbase_4',['SimpleTTSBase',['../classsimple__tts_1_1_simple_t_t_s_base.html',1,'simple_tts']]], 8 | ['size_5',['size',['../classsimple__tts_1_1_text_to_speech_queue.html#ad02e6edf96cf855bbd8721dd4f5f3f43',1,'simple_tts::TextToSpeechQueue']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/latex/_audio_dictionary_u_r_l_8h_source.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{_audio_dictionary_u_r_l_8h_source}{}\doxysection{Audio\+Dictionary\+URL.\+h} 2 | \label{_audio_dictionary_u_r_l_8h_source}\index{src/AudioDictionaryURL.h@{src/AudioDictionaryURL.h}} 3 | 4 | \begin{DoxyCode}{0} 5 | \DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}} 6 | \DoxyCodeLine{00002\ } 7 | \DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ "{}AudioHttp/URLStream.h"{}}} 8 | \DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}SimpleTTSBase.h"{}}} 9 | \DoxyCodeLine{00005\ } 10 | \DoxyCodeLine{00006\ \textcolor{keyword}{namespace\ }simple\_tts\ \{} 11 | \DoxyCodeLine{00007\ } 12 | \DoxyCodeLine{00014\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_u_r_l}{AudioDictionaryURL}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base}{AudioDictionaryBase}}\ \{} 13 | \DoxyCodeLine{00015\ \textcolor{keyword}{public}:} 14 | \DoxyCodeLine{00016\ \ \ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_u_r_l}{AudioDictionaryURL}}(URLStream\ \&urlStream,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *url,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *ext)\ \{} 15 | \DoxyCodeLine{00017\ \ \ \ \ p\_url\ =\ \&urlStream;} 16 | \DoxyCodeLine{00018\ \ \ \ \ url\_cstr\ =\ url;} 17 | \DoxyCodeLine{00019\ \ \ \ \ ext\_cstr\ =\ ext;} 18 | \DoxyCodeLine{00020\ \ \ \}} 19 | \DoxyCodeLine{00021\ } 20 | \DoxyCodeLine{00022\ \ \ AudioStream\ *get(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *word)\ \{} 21 | \DoxyCodeLine{00023\ \ \ \ \ url\_str\ =\ url\_cstr;} 22 | \DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordflow}{if}\ (!url\_str.endsWith(\textcolor{stringliteral}{"{}/"{}}))\{} 23 | \DoxyCodeLine{00025\ \ \ \ \ \ \ url\_str.add(\textcolor{stringliteral}{"{}/"{}});} 24 | \DoxyCodeLine{00026\ \ \ \ \ \}} 25 | \DoxyCodeLine{00027\ \ \ \ \ url\_str.add(word);} 26 | \DoxyCodeLine{00028\ \ \ \ \ url\_str.add(\textcolor{stringliteral}{"{}."{}});} 27 | \DoxyCodeLine{00029\ \ \ \ \ url\_str.add(ext\_cstr);} 28 | \DoxyCodeLine{00030\ \ \ \ \ url\_str.toLowerCase();} 29 | \DoxyCodeLine{00031\ \ \ \ \ LOGI(\textcolor{stringliteral}{"{}Using\ url:\ \%s"{}},\ url\_str.c\_str());} 30 | \DoxyCodeLine{00032\ \ \ \ \ p\_url-\/>begin(url\_str.c\_str());} 31 | \DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordflow}{return}\ p\_url;} 32 | \DoxyCodeLine{00034\ \ \ \}} 33 | \DoxyCodeLine{00035\ } 34 | \DoxyCodeLine{00036\ \textcolor{keyword}{protected}:} 35 | \DoxyCodeLine{00037\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *url\_cstr;} 36 | \DoxyCodeLine{00038\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *ext\_cstr;} 37 | \DoxyCodeLine{00039\ \ \ StrExt\ url\_str;} 38 | \DoxyCodeLine{00040\ \ \ URLStream\ *p\_url;} 39 | \DoxyCodeLine{00041\ \};} 40 | \DoxyCodeLine{00042\ } 41 | \DoxyCodeLine{00043\ \}\ \textcolor{comment}{//\ namespace\ simple\_tts}} 42 | 43 | \end{DoxyCode} 44 | -------------------------------------------------------------------------------- /docs/html/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | var menudata={children:[ 26 | {text:"Main Page",url:"index.html"}, 27 | {text:"Classes",url:"annotated.html",children:[ 28 | {text:"Class List",url:"annotated.html"}, 29 | {text:"Class Index",url:"classes.html"}, 30 | {text:"Class Hierarchy",url:"hierarchy.html"}, 31 | {text:"Class Members",url:"functions.html",children:[ 32 | {text:"All",url:"functions.html",children:[ 33 | {text:"a",url:"functions.html#index_a"}, 34 | {text:"b",url:"functions.html#index_b"}, 35 | {text:"c",url:"functions.html#index_c"}, 36 | {text:"d",url:"functions.html#index_d"}, 37 | {text:"e",url:"functions.html#index_e"}, 38 | {text:"g",url:"functions.html#index_g"}, 39 | {text:"i",url:"functions.html#index_i"}, 40 | {text:"m",url:"functions.html#index_m"}, 41 | {text:"o",url:"functions.html#index_o"}, 42 | {text:"p",url:"functions.html#index_p"}, 43 | {text:"s",url:"functions.html#index_s"}, 44 | {text:"t",url:"functions.html#index_t"}]}, 45 | {text:"Functions",url:"functions_func.html",children:[ 46 | {text:"a",url:"functions_func.html#index_a"}, 47 | {text:"b",url:"functions_func.html#index_b"}, 48 | {text:"c",url:"functions_func.html#index_c"}, 49 | {text:"d",url:"functions_func.html#index_d"}, 50 | {text:"e",url:"functions_func.html#index_e"}, 51 | {text:"g",url:"functions_func.html#index_g"}, 52 | {text:"i",url:"functions_func.html#index_i"}, 53 | {text:"o",url:"functions_func.html#index_o"}, 54 | {text:"p",url:"functions_func.html#index_p"}, 55 | {text:"s",url:"functions_func.html#index_s"}, 56 | {text:"t",url:"functions_func.html#index_t"}]}, 57 | {text:"Variables",url:"functions_vars.html"}]}]}, 58 | {text:"Files",url:"files.html",children:[ 59 | {text:"File List",url:"files.html"}]}]} 60 | -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_number.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_number}{}\doxysection{simple\+\_\+tts\+::Number Class Reference} 2 | \label{classsimple__tts_1_1_number}\index{simple\_tts::Number@{simple\_tts::Number}} 3 | 4 | 5 | Convert numbers to string and provide integer and decimals. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | \doxysubsection*{Public Member Functions} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a3789d2a1f9e43f26d5b6e27cd50b34dd}\label{classsimple__tts_1_1_number_a3789d2a1f9e43f26d5b6e27cd50b34dd}} 16 | void {\bfseries set} (double value, int digits=2) 17 | \item 18 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a2d1a503b4211eb4fa71252ec1eadbe1d}\label{classsimple__tts_1_1_number_a2d1a503b4211eb4fa71252ec1eadbe1d}} 19 | void {\bfseries set} (int64\+\_\+t whole\+Number) 20 | \item 21 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a0768e8ce47dff8521cec1e662587da32}\label{classsimple__tts_1_1_number_a0768e8ce47dff8521cec1e662587da32}} 22 | const char $\ast$ {\bfseries int\+Value} () 23 | \begin{DoxyCompactList}\small\item\em provides the full number \end{DoxyCompactList}\item 24 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a33e8504471cb6f4ab31a43b178ec26e5}\label{classsimple__tts_1_1_number_a33e8504471cb6f4ab31a43b178ec26e5}} 25 | const char $\ast$ {\bfseries dec\+Values} () 26 | \begin{DoxyCompactList}\small\item\em provides the decimals after the . \end{DoxyCompactList}\item 27 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a89e4ef62c1690dbbcc3b13a8795253a8}\label{classsimple__tts_1_1_number_a89e4ef62c1690dbbcc3b13a8795253a8}} 28 | const char $\ast$ {\bfseries dec\+As\+Int} (const char $\ast$decimals, int digits) 29 | \end{DoxyCompactItemize} 30 | \doxysubsection*{Protected Attributes} 31 | \begin{DoxyCompactItemize} 32 | \item 33 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a50838b20860334fa7cbcc8c8a6416605}\label{classsimple__tts_1_1_number_a50838b20860334fa7cbcc8c8a6416605}} 34 | char {\bfseries buffer} \mbox{[}buffer\+\_\+len\mbox{]} 35 | \item 36 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a66dcb551bb60b64827a4e535d79a25c8}\label{classsimple__tts_1_1_number_a66dcb551bb60b64827a4e535d79a25c8}} 37 | char $\ast$ {\bfseries dot} =buffer 38 | \end{DoxyCompactItemize} 39 | \doxysubsection*{Static Protected Attributes} 40 | \begin{DoxyCompactItemize} 41 | \item 42 | \mbox{\Hypertarget{classsimple__tts_1_1_number_a58ddfec35bd266b24ba47ee7a8c7cb0c}\label{classsimple__tts_1_1_number_a58ddfec35bd266b24ba47ee7a8c7cb0c}} 43 | static const int {\bfseries buffer\+\_\+len} = 100 44 | \end{DoxyCompactItemize} 45 | 46 | 47 | \doxysubsection{Detailed Description} 48 | Convert numbers to string and provide integer and decimals. 49 | 50 | \begin{DoxyAuthor}{Author} 51 | Phil Schatzmann 52 | \end{DoxyAuthor} 53 | \begin{DoxyCopyright}{Copyright} 54 | GPLv3 55 | \end{DoxyCopyright} 56 | 57 | 58 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 59 | \item 60 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 61 | -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_audio_dictionary.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_audio_dictionary}{}\doxysection{simple\+\_\+tts\+::Audio\+Dictionary Class Reference} 2 | \label{classsimple__tts_1_1_audio_dictionary}\index{simple\_tts::AudioDictionary@{simple\_tts::AudioDictionary}} 3 | 4 | 5 | A dictionary which is based on in memory audio files. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Audio\+Dictionary.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Audio\+Dictionary\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=2.000000cm]{classsimple__tts_1_1_audio_dictionary} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Member Functions} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_a3f840676a8ba395058f3a21f9d8b02e6}\label{classsimple__tts_1_1_audio_dictionary_a3f840676a8ba395058f3a21f9d8b02e6}} 22 | {\bfseries Audio\+Dictionary} (\mbox{\hyperlink{structsimple__tts_1_1_audio_dictionary_entry}{Audio\+Dictionary\+Entry}} $\ast$dict) 23 | \item 24 | Audio\+Stream $\ast$ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_aa4b31af02bf51c6c7cbae1e064fefc57}{get}} (const char $\ast$word) 25 | \end{DoxyCompactItemize} 26 | \begin{DoxyCompactItemize} 27 | \item 28 | virtual Audio\+Stream $\ast$ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base_aa44fb2736db525038696b088bd90716f}{get}} (const char $\ast$word)=0 29 | \end{DoxyCompactItemize} 30 | \doxysubsection*{Protected Attributes} 31 | \begin{DoxyCompactItemize} 32 | \item 33 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_ace443df2a4963b80f14a59faf0f2f475}\label{classsimple__tts_1_1_audio_dictionary_ace443df2a4963b80f14a59faf0f2f475}} 34 | \mbox{\hyperlink{structsimple__tts_1_1_audio_dictionary_entry}{Audio\+Dictionary\+Entry}} $\ast$ {\bfseries dictionary} 35 | \end{DoxyCompactItemize} 36 | 37 | 38 | \doxysubsection{Detailed Description} 39 | A dictionary which is based on in memory audio files. 40 | 41 | \begin{DoxyAuthor}{Author} 42 | Phil Schatzmann 43 | \end{DoxyAuthor} 44 | \begin{DoxyCopyright}{Copyright} 45 | GPLv3 46 | \end{DoxyCopyright} 47 | 48 | 49 | \doxysubsection{Member Function Documentation} 50 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_aa4b31af02bf51c6c7cbae1e064fefc57}\label{classsimple__tts_1_1_audio_dictionary_aa4b31af02bf51c6c7cbae1e064fefc57}} 51 | \index{simple\_tts::AudioDictionary@{simple\_tts::AudioDictionary}!get@{get}} 52 | \index{get@{get}!simple\_tts::AudioDictionary@{simple\_tts::AudioDictionary}} 53 | \doxysubsubsection{\texorpdfstring{get()}{get()}} 54 | {\footnotesize\ttfamily Audio\+Stream $\ast$ simple\+\_\+tts\+::\+Audio\+Dictionary\+::get (\begin{DoxyParamCaption}\item[{const char $\ast$}]{word }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}} 55 | 56 | 57 | 58 | Implements \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base}{simple\+\_\+tts\+::\+Audio\+Dictionary\+Base}}. 59 | 60 | 61 | 62 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 63 | \item 64 | src/Audio\+Dictionary.\+h\end{DoxyCompactItemize} 65 | -------------------------------------------------------------------------------- /docs/html/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | arduino-simple-tts: Class Members - Variables 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 |
arduino-simple-tts 25 |
26 |
30 |
31 | 32 | 33 | 38 | 39 | 40 | 48 | 49 |
50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 |
72 |   75 |
76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/sandbox/Importer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | //#include 7 | 8 | #include "SimpleTTSBase.h" 9 | 10 | namespace simple_tts { 11 | 12 | #include "en/all.h" 13 | 14 | 15 | /** 16 | * @brief A dictionary which is based on files stored on an SD card 17 | * @author Phil Schatzmann 18 | * @copyright GPLv3 19 | */ 20 | class Importer { 21 | public: 22 | Importer(const char *path, const char *ext, int cs_pin = -1) { 23 | this->path = path; 24 | this->ext = ext; 25 | this->cs_pin = cs_pin; 26 | } 27 | 28 | ~Importer() { file.close(); } 29 | 30 | 31 | // Creates all missing audio recording files for the indicated source 32 | void initialLoad(SimpleTTSBase &source, const char *url, const char *mime) { 33 | auto texts = source.allTexts(); 34 | for (auto txt : texts) { 35 | initialLoad(txt, txt, url, mime); 36 | } 37 | } 38 | 39 | // Loads the audio for the indicated entries. The last entry must be 40 | // terminated with nullptr 41 | void initialLoad(AudioSDEntry *entries, const char *url, const char *mime) { 42 | AudioSDEntry *e = entries; 43 | while (e != nullptr && e->name != nullptr) { 44 | initialLoad(e->name, e->text, url, mime); 45 | e++; 46 | } 47 | } 48 | 49 | // Creates a single audio files for the indicated text 50 | void initialLoad(const char *name, const char *text, const char *url, 51 | const char *mime) { 52 | setup(); 53 | url_with_text = url; 54 | url_with_text.replace("@", text); 55 | LOGI("url: %s", url_with_text.c_str()); 56 | 57 | const char *file = getFileWithPath(name); 58 | LOGI("file: %s", file); 59 | if (SD.exists(file)) { 60 | SD.remove(file); 61 | } 62 | File newFile = SD.open(file, FILE_WRITE); 63 | bool ok = copy(newFile, url_with_text.c_str(), mime); 64 | if (!ok){ 65 | LOGE("No data available: file '%s' will be deleted", file); 66 | SD.remove(file); 67 | } 68 | } 69 | 70 | protected: 71 | audio_tools::Str url_with_text; 72 | File file; 73 | AudioStreamFileWrapper fileWrapper; 74 | const char *path; 75 | const char *ext; 76 | char file_path[200]; 77 | bool is_setup = false; 78 | int cs_pin = -1; 79 | URLStream url_stream; 80 | StreamCopy cp; 81 | 82 | void setup() { 83 | if (!is_setup) { 84 | LOGI("setup SD.."); 85 | if (cs_pin != -1) { 86 | SD.begin(cs_pin); 87 | } else { 88 | SD.begin(); 89 | } 90 | if (!SD.exists(path)) { 91 | LOGI("Creating directory: %s", path) 92 | SD.mkdir(path); 93 | } 94 | is_setup = true; 95 | } 96 | } 97 | 98 | // determines the filename for the word 99 | const char *getFileWithPath(const char *name) { 100 | file_path[0] = 0; 101 | strcat(file_path, path); 102 | strcat(file_path, "/"); 103 | strcat(file_path, name); 104 | strcat(file_path, "."); 105 | strcat(file_path, ext); 106 | LOGI("%s -> %s", name, file_path); 107 | return (const char *)file_path; 108 | } 109 | 110 | bool copy(File &file, const char *url, const char *mime) { 111 | url_stream.begin(url, mime); 112 | cp.begin(file, url_stream); 113 | bool result = cp.copyAll(0); 114 | url_stream.end(); 115 | LOGI("file size: %d Kbyte", (int) file.size() / 1024); 116 | file.close(); 117 | return result; 118 | } 119 | }; 120 | 121 | } // namespace simple_tts 122 | -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_simple_t_t_s_base.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_simple_t_t_s_base}{}\doxysection{simple\+\_\+tts\+::Simple\+TTSBase Class Reference} 2 | \label{classsimple__tts_1_1_simple_t_t_s_base}\index{simple\_tts::SimpleTTSBase@{simple\_tts::SimpleTTSBase}} 3 | 4 | 5 | Common Functionality for TTS classes. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Simple\+TTSBase.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Simple\+TTSBase\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=2.000000cm]{classsimple__tts_1_1_simple_t_t_s_base} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Member Functions} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | virtual audio\+\_\+tools\+::\+Vector$<$ const char $\ast$ $>$ \& \mbox{\hyperlink{classsimple__tts_1_1_simple_t_t_s_base_a563ec5af8d2a53a4cea48e735de343c5}{all\+Texts}} ()=0 22 | \item 23 | \mbox{\Hypertarget{classsimple__tts_1_1_simple_t_t_s_base_a399e345694a184a7c48ce16a345def6a}\label{classsimple__tts_1_1_simple_t_t_s_base_a399e345694a184a7c48ce16a345def6a}} 24 | virtual void {\bfseries register\+Callback} (void($\ast$ptr)(audio\+\_\+tools\+::\+Vector$<$ const char $\ast$ $>$ words, void $\ast$refx), void $\ast$ref) 25 | \item 26 | \mbox{\Hypertarget{classsimple__tts_1_1_simple_t_t_s_base_a0af042bda3842ad7ab250b6c7cdc122c}\label{classsimple__tts_1_1_simple_t_t_s_base_a0af042bda3842ad7ab250b6c7cdc122c}} 27 | void {\bfseries print\+CSV} (Print \&out) 28 | \end{DoxyCompactItemize} 29 | \doxysubsection*{Protected Attributes} 30 | \begin{DoxyCompactItemize} 31 | \item 32 | \mbox{\Hypertarget{classsimple__tts_1_1_simple_t_t_s_base_a056744a12b983215d731998d23244d14}\label{classsimple__tts_1_1_simple_t_t_s_base_a056744a12b983215d731998d23244d14}} 33 | void($\ast$ {\bfseries callback} )(audio\+\_\+tools\+::\+Vector$<$ const char $\ast$ $>$ word, void $\ast$ref) = nullptr 34 | \item 35 | \mbox{\Hypertarget{classsimple__tts_1_1_simple_t_t_s_base_ab664b7bf4dbde2b10a2bf4da3f44fa52}\label{classsimple__tts_1_1_simple_t_t_s_base_ab664b7bf4dbde2b10a2bf4da3f44fa52}} 36 | void $\ast$ {\bfseries reference} = nullptr 37 | \end{DoxyCompactItemize} 38 | 39 | 40 | \doxysubsection{Detailed Description} 41 | Common Functionality for TTS classes. 42 | 43 | \begin{DoxyAuthor}{Author} 44 | Phil Schatzmann 45 | \end{DoxyAuthor} 46 | \begin{DoxyCopyright}{Copyright} 47 | GPLv3 48 | \end{DoxyCopyright} 49 | 50 | 51 | \doxysubsection{Member Function Documentation} 52 | \mbox{\Hypertarget{classsimple__tts_1_1_simple_t_t_s_base_a563ec5af8d2a53a4cea48e735de343c5}\label{classsimple__tts_1_1_simple_t_t_s_base_a563ec5af8d2a53a4cea48e735de343c5}} 53 | \index{simple\_tts::SimpleTTSBase@{simple\_tts::SimpleTTSBase}!allTexts@{allTexts}} 54 | \index{allTexts@{allTexts}!simple\_tts::SimpleTTSBase@{simple\_tts::SimpleTTSBase}} 55 | \doxysubsubsection{\texorpdfstring{allTexts()}{allTexts()}} 56 | {\footnotesize\ttfamily virtual audio\+\_\+tools\+::\+Vector$<$ const char $\ast$ $>$ \& simple\+\_\+tts\+::\+Simple\+TTSBase\+::all\+Texts (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}} 57 | 58 | 59 | 60 | Implemented in \mbox{\hyperlink{classsimple__tts_1_1_number_to_text_ae7cdf641730a749293956193b785a772}{simple\+\_\+tts\+::\+Number\+To\+Text}}, \mbox{\hyperlink{classsimple__tts_1_1_number_unit_to_text_adfa5999c7e6b9adc5f51d8213614abc3}{simple\+\_\+tts\+::\+Number\+Unit\+To\+Text}}, and \mbox{\hyperlink{classsimple__tts_1_1_time_to_text_a74b2534f6c65dc2f3a5403952ff80690}{simple\+\_\+tts\+::\+Time\+To\+Text}}. 61 | 62 | 63 | 64 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 65 | \item 66 | src/Simple\+TTSBase.\+h\end{DoxyCompactItemize} 67 | -------------------------------------------------------------------------------- /examples/example-own-sound/speechArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AudioDictionary.h" 4 | #include "speechSamples.h" 5 | 6 | // please note that the processing here is w/o namespace 7 | 8 | simple_tts::AudioDictionaryEntry MyAudioDictionaryValues[] = { 9 | {"SILENCE", new MemoryStream(silence_mp3, silence_mp3_len)}, 10 | {"ZERO", new MemoryStream(zero_mp3, zero_mp3_len)}, 11 | {"ZED", new MemoryStream(zed_mp3, zed_mp3_len)}, 12 | {"Z", new MemoryStream(z_mp3, z_mp3_len)}, 13 | {"YAW", new MemoryStream(yaw_mp3, yaw_mp3_len)}, 14 | {"Y", new MemoryStream(y_mp3, y_mp3_len)}, 15 | {"X", new MemoryStream(x_mp3, x_mp3_len)}, 16 | {"VOLUME", new MemoryStream(volume_mp3, volume_mp3_len)}, 17 | {"TWO", new MemoryStream(two_mp3, two_mp3_len)}, 18 | {"TWENTY", new MemoryStream(twenty_mp3, twenty_mp3_len)}, 19 | {"TWELVE", new MemoryStream(twelve_mp3, twelve_mp3_len)}, 20 | {"TRILLION", new MemoryStream(trillion_mp3, trillion_mp3_len)}, 21 | {"THREE", new MemoryStream(three_mp3, three_mp3_len)}, 22 | {"THOUSAND", new MemoryStream(thousand_mp3, thousand_mp3_len)}, 23 | {"THIRTY", new MemoryStream(thirty_mp3, thirty_mp3_len)}, 24 | {"THIRTEEN", new MemoryStream(thirteen_mp3, thirteen_mp3_len)}, 25 | {"TEN", new MemoryStream(ten_mp3, ten_mp3_len)}, 26 | {"TARE", new MemoryStream(tare_mp3, tare_mp3_len)}, 27 | {"SIXTY", new MemoryStream(sixty_mp3, sixty_mp3_len)}, 28 | {"SIXTEEN", new MemoryStream(sixteen_mp3, sixteen_mp3_len)}, 29 | {"SIX", new MemoryStream(six_mp3, six_mp3_len)}, 30 | {"SEVENTY", new MemoryStream(seventy_mp3, seventy_mp3_len)}, 31 | {"SEVENTEEN", new MemoryStream(seventeen_mp3, seventeen_mp3_len)}, 32 | {"SEVEN", new MemoryStream(seven_mp3, seven_mp3_len)}, 33 | {"SET", new MemoryStream(set_mp3, set_mp3_len)}, 34 | {"SAVE", new MemoryStream(save_mp3, save_mp3_len)}, 35 | {"ROLL", new MemoryStream(roll_mp3, roll_mp3_len)}, 36 | {"PLUS", new MemoryStream(plus_mp3, plus_mp3_len)}, 37 | {"PITCH", new MemoryStream(pitch_mp3, pitch_mp3_len)}, 38 | {"ONE", new MemoryStream(one_mp3, one_mp3_len)}, 39 | {"NINETY", new MemoryStream(ninety_mp3, ninety_mp3_len)}, 40 | {"NINETEEN", new MemoryStream(nineteen_mp3, nineteen_mp3_len)}, 41 | {"NINE", new MemoryStream(nine_mp3, nine_mp3_len)}, 42 | {"MINUS", new MemoryStream(minus_mp3, minus_mp3_len)}, 43 | {"MILLION", new MemoryStream(million_mp3, million_mp3_len)}, 44 | {"MENU", new MemoryStream(menu_mp3, menu_mp3_len)}, 45 | {"MEMORY", new MemoryStream(memory_mp3, memory_mp3_len)}, 46 | {"HUNDRED", new MemoryStream(hundred_mp3, hundred_mp3_len)}, 47 | {"FOURTEEN", new MemoryStream(fourteen_mp3, fourteen_mp3_len)}, 48 | {"FOUR", new MemoryStream(four_mp3, four_mp3_len)}, 49 | {"FORTY", new MemoryStream(forty_mp3, forty_mp3_len)}, 50 | {"FIVE", new MemoryStream(five_mp3, five_mp3_len)}, 51 | {"FIFTY", new MemoryStream(fifty_mp3, fifty_mp3_len)}, 52 | {"FIFTEEN", new MemoryStream(fifteen_mp3, fifteen_mp3_len)}, 53 | {"EXIT", new MemoryStream(exit_mp3, exit_mp3_len)}, 54 | {"ENABLED", new MemoryStream(enabled_mp3, enabled_mp3_len)}, 55 | {"ELEVEN", new MemoryStream(eleven_mp3, eleven_mp3_len)}, 56 | {"EIGHTY", new MemoryStream(eighty_mp3, eighty_mp3_len)}, 57 | {"EIGHTEEN", new MemoryStream(eighteen_mp3, eighteen_mp3_len)}, 58 | {"EIGHT", new MemoryStream(eight_mp3, eight_mp3_len)}, 59 | {"DISABLED", new MemoryStream(disabled_mp3, disabled_mp3_len)}, 60 | {"DEGREES", new MemoryStream(degrees_mp3, degrees_mp3_len)}, 61 | {"COMPLETE", new MemoryStream(complete_mp3, complete_mp3_len)}, 62 | {"CALIBRATION", new MemoryStream(calibration_mp3, calibration_mp3_len)}, 63 | {"CALIBRATING", new MemoryStream(calibrating_mp3, calibrating_mp3_len)}, 64 | {"CALIBRATED", new MemoryStream(calibrated_mp3, calibrated_mp3_len)}, 65 | {"BILLION", new MemoryStream(billion_mp3, billion_mp3_len)}, 66 | {"AXIS", new MemoryStream(axis_mp3, axis_mp3_len)}, 67 | {"ANGLE", new MemoryStream(angle_mp3, angle_mp3_len)}, 68 | {"AND", new MemoryStream(and_mp3, and_mp3_len)}, 69 | {nullptr, nullptr}}; 70 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | .vscode/ 44 | 45 | # Build results 46 | 47 | [Dd]ebug/ 48 | [Rr]elease/ 49 | x64/ 50 | build/ 51 | [Bb]in/ 52 | [Oo]bj/ 53 | 54 | # MSTest test Results 55 | [Tt]est[Rr]esult*/ 56 | [Bb]uild[Ll]og.* 57 | 58 | *_i.c 59 | *_p.c 60 | *.ilk 61 | *.meta 62 | *.obj 63 | *.pch 64 | *.pdb 65 | *.pgc 66 | *.pgd 67 | *.rsp 68 | *.sbr 69 | *.tlb 70 | *.tli 71 | *.tlh 72 | *.tmp 73 | *.tmp_proj 74 | *.log 75 | *.vspscc 76 | *.vssscc 77 | .builds 78 | *.pidb 79 | *.log 80 | *.scc 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opensdf 87 | *.sdf 88 | *.cachefile 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | 102 | # TeamCity is a build add-in 103 | _TeamCity* 104 | 105 | # DotCover is a Code Coverage Tool 106 | *.dotCover 107 | 108 | # NCrunch 109 | *.ncrunch* 110 | .*crunch*.local.xml 111 | 112 | # Installshield output folder 113 | [Ee]xpress/ 114 | 115 | # DocProject is a documentation generator add-in 116 | DocProject/buildhelp/ 117 | DocProject/Help/*.HxT 118 | DocProject/Help/*.HxC 119 | DocProject/Help/*.hhc 120 | DocProject/Help/*.hhk 121 | DocProject/Help/*.hhp 122 | DocProject/Help/Html2 123 | DocProject/Help/html 124 | 125 | # Click-Once directory 126 | publish/ 127 | 128 | # Publish Web Output 129 | *.Publish.xml 130 | *.pubxml 131 | 132 | # NuGet Packages Directory 133 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 134 | #packages/ 135 | 136 | # Windows Azure Build Output 137 | csx 138 | *.build.csdef 139 | 140 | # Windows Store app package directory 141 | AppPackages/ 142 | 143 | # Others 144 | sql/ 145 | *.Cache 146 | ClientBin/ 147 | [Ss]tyle[Cc]op.* 148 | ~$* 149 | *~ 150 | *.dbmdl 151 | *.[Pp]ublish.xml 152 | *.pfx 153 | *.publishsettings 154 | 155 | # RIA/Silverlight projects 156 | Generated_Code/ 157 | 158 | # Backup & report files from converting an old project file to a newer 159 | # Visual Studio version. Backup files are not needed, because we have git ;-) 160 | _UpgradeReport_Files/ 161 | Backup*/ 162 | UpgradeLog*.XML 163 | UpgradeLog*.htm 164 | 165 | # SQL Server files 166 | App_Data/*.mdf 167 | App_Data/*.ldf 168 | 169 | ############# 170 | ## Windows detritus 171 | ############# 172 | 173 | # Windows image file caches 174 | Thumbs.db 175 | ehthumbs.db 176 | 177 | # Folder config file 178 | Desktop.ini 179 | 180 | # Recycle Bin used on file shares 181 | $RECYCLE.BIN/ 182 | 183 | # Mac crap 184 | .DS_Store 185 | 186 | 187 | ############# 188 | ## Python 189 | ############# 190 | 191 | *.py[co] 192 | 193 | # Packages 194 | *.egg 195 | *.egg-info 196 | dist/ 197 | build/ 198 | eggs/ 199 | parts/ 200 | var/ 201 | sdist/ 202 | develop-eggs/ 203 | .installed.cfg 204 | 205 | # Installer logs 206 | pip-log.txt 207 | 208 | # Unit test / coverage reports 209 | .coverage 210 | .tox 211 | 212 | # Translations 213 | *.mo 214 | 215 | # Mr Developer 216 | .mr.developer.cfg 217 | 218 | # Doxygen 219 | .DS_Store 220 | /.vs 221 | 222 | out/ -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_audio_dictionary_u_r_l.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l}{}\doxysection{simple\+\_\+tts\+::Audio\+Dictionary\+URL Class Reference} 2 | \label{classsimple__tts_1_1_audio_dictionary_u_r_l}\index{simple\_tts::AudioDictionaryURL@{simple\_tts::AudioDictionaryURL}} 3 | 4 | 5 | A dictionary which is based on audio files that can be accessed via URLs. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Audio\+Dictionary\+URL.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Audio\+Dictionary\+URL\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=2.000000cm]{classsimple__tts_1_1_audio_dictionary_u_r_l} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Member Functions} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_aa1560d1c432a71dddc6a363e3ff78b21}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_aa1560d1c432a71dddc6a363e3ff78b21}} 22 | {\bfseries Audio\+Dictionary\+URL} (URLStream \&url\+Stream, const char $\ast$url, const char $\ast$ext) 23 | \item 24 | Audio\+Stream $\ast$ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_u_r_l_a4fb4e2ffcabf3b022e93542f488100b0}{get}} (const char $\ast$word) 25 | \end{DoxyCompactItemize} 26 | \begin{DoxyCompactItemize} 27 | \item 28 | virtual Audio\+Stream $\ast$ \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base_aa44fb2736db525038696b088bd90716f}{get}} (const char $\ast$word)=0 29 | \end{DoxyCompactItemize} 30 | \doxysubsection*{Protected Attributes} 31 | \begin{DoxyCompactItemize} 32 | \item 33 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_aa81413a28c32031e34f937cb74c6e119}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_aa81413a28c32031e34f937cb74c6e119}} 34 | const char $\ast$ {\bfseries url\+\_\+cstr} 35 | \item 36 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_abb0545ba6b221cf115b554b654ceaf39}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_abb0545ba6b221cf115b554b654ceaf39}} 37 | const char $\ast$ {\bfseries ext\+\_\+cstr} 38 | \item 39 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_a809900cc7cde9e29f1845f2c64d48595}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_a809900cc7cde9e29f1845f2c64d48595}} 40 | Str\+Ext {\bfseries url\+\_\+str} 41 | \item 42 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_a5d1fb245f2e5dd3d3ef6dfda42453be4}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_a5d1fb245f2e5dd3d3ef6dfda42453be4}} 43 | URLStream $\ast$ {\bfseries p\+\_\+url} 44 | \end{DoxyCompactItemize} 45 | 46 | 47 | \doxysubsection{Detailed Description} 48 | A dictionary which is based on audio files that can be accessed via URLs. 49 | 50 | \begin{DoxyAuthor}{Author} 51 | Phil Schatzmann 52 | \end{DoxyAuthor} 53 | \begin{DoxyCopyright}{Copyright} 54 | GPLv3 55 | \end{DoxyCopyright} 56 | 57 | 58 | \doxysubsection{Member Function Documentation} 59 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_dictionary_u_r_l_a4fb4e2ffcabf3b022e93542f488100b0}\label{classsimple__tts_1_1_audio_dictionary_u_r_l_a4fb4e2ffcabf3b022e93542f488100b0}} 60 | \index{simple\_tts::AudioDictionaryURL@{simple\_tts::AudioDictionaryURL}!get@{get}} 61 | \index{get@{get}!simple\_tts::AudioDictionaryURL@{simple\_tts::AudioDictionaryURL}} 62 | \doxysubsubsection{\texorpdfstring{get()}{get()}} 63 | {\footnotesize\ttfamily Audio\+Stream $\ast$ simple\+\_\+tts\+::\+Audio\+Dictionary\+URL\+::get (\begin{DoxyParamCaption}\item[{const char $\ast$}]{word }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}} 64 | 65 | 66 | 67 | Implements \mbox{\hyperlink{classsimple__tts_1_1_audio_dictionary_base}{simple\+\_\+tts\+::\+Audio\+Dictionary\+Base}}. 68 | 69 | 70 | 71 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 72 | \item 73 | src/Audio\+Dictionary\+URL.\+h\end{DoxyCompactItemize} 74 | -------------------------------------------------------------------------------- /src/TextToSpeech.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef NO_SPEECH 3 | #include "AudioTools/CoreAudio/AudioOutput.h" 4 | #include "AudioTools/CoreAudio/AudioStreams.h" 5 | #include "AudioTools/CoreAudio/AudioTypes.h" 6 | #include "NumberToText.h" 7 | #include "AudioDictionary.h" 8 | 9 | namespace simple_tts { 10 | 11 | /** 12 | * @brief Audio output from text via the indicated audio sink. The text 13 | * components need to be prerecorded and available as audio files. 14 | * @author Phil Schatzmann 15 | * @copyright GPLv3 16 | */ 17 | class TextToSpeech { 18 | public: 19 | /// TextToSpeech which support a SimpleTTSBase 20 | TextToSpeech(SimpleTTSBase &tts, AudioStream &sink, AudioDecoder &decoder, 21 | AudioDictionaryBase &dict) { 22 | tts.registerCallback(callback, this); 23 | p_tts = &tts; 24 | p_dictionary = &dict; 25 | p_decoder = &decoder; 26 | p_sink = &sink; 27 | decodedStream = new audio_tools::EncodedAudioStream(&sink, &decoder); 28 | begin(); 29 | } 30 | 31 | TextToSpeech(SimpleTTSBase &tts, AudioOutput &sink, AudioDecoder &decoder, 32 | AudioDictionaryBase &dict) { 33 | tts.registerCallback(callback, this); 34 | p_tts = &tts; 35 | p_dictionary = &dict; 36 | p_decoder = &decoder; 37 | p_sink = &sink; 38 | decodedStream = new audio_tools::EncodedAudioStream(&sink, &decoder); 39 | begin(); 40 | } 41 | 42 | /// Default Constructor 43 | TextToSpeech(AudioStream &sink, AudioDecoder &decoder, 44 | AudioDictionaryBase &dict) { 45 | p_dictionary = &dict; 46 | p_decoder = &decoder; 47 | p_sink = &sink; 48 | decodedStream = new audio_tools::EncodedAudioStream(&sink, &decoder); 49 | begin(); 50 | } 51 | 52 | 53 | ~TextToSpeech() { delete decodedStream; } 54 | 55 | /// a simple API to say one of the supported words 56 | void say(const char *word) { 57 | if (word == nullptr) return; 58 | LOGI("say: %s",word); 59 | AudioStream *mp3Stream = p_dictionary->get(word); 60 | if (mp3Stream != nullptr) { 61 | if (!active) begin(); 62 | mp3Stream->begin(); 63 | copier.begin(*decodedStream, *mp3Stream); 64 | copier.copyAll(0, 0); 65 | copier.end(); 66 | mp3Stream->end(); 67 | // if we use free rtos, we give other processes the chance to 68 | delay(1); 69 | } else { 70 | LOGE("Word not available in dictionary: %s", word); 71 | } 72 | } 73 | 74 | void begin() { 75 | p_decoder->begin(); 76 | active = true; 77 | } 78 | 79 | void end() { 80 | p_decoder->end(); 81 | active = false; 82 | } 83 | 84 | /// a simple API to say multiple of the supported words 85 | void say(audio_tools::Vector words) { 86 | begin(); 87 | for (auto word : words) { 88 | say(word); 89 | } 90 | end(); 91 | } 92 | 93 | /// writes silence for the indicated ms 94 | void delay(uint32_t delay_ms){ 95 | uint8_t buffer[1024] = {0}; 96 | unsigned long timeout = millis()+delay_ms; 97 | while(timeout>millis()){ 98 | p_sink->write((const uint8_t*)buffer,1024); 99 | } 100 | } 101 | 102 | protected: 103 | bool active = false; 104 | NumberToText ntt; 105 | audio_tools::AudioDecoder *p_decoder = nullptr; 106 | audio_tools::EncodedAudioStream *decodedStream = nullptr; // Decoding stream 107 | SimpleTTSBase *p_tts = nullptr; // Text source 108 | AudioDictionaryBase *p_dictionary = nullptr; // Dictionary to access audio data 109 | audio_tools::StreamCopy copier; // copy in to out 110 | Print *p_sink=nullptr; 111 | 112 | /// callback which says the words 113 | static void callback(audio_tools::Vector words, void* ref) { 114 | TextToSpeech* self = (TextToSpeech*)ref; 115 | self->say(words); } 116 | }; 117 | 118 | } // namespace simple_tts 119 | 120 | #endif -------------------------------------------------------------------------------- /docs/latex/classsimple__tts_1_1_audio_stream_file_wrapper.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper}{}\doxysection{simple\+\_\+tts\+::Audio\+Stream\+File\+Wrapper\texorpdfstring{$<$}{<} T \texorpdfstring{$>$}{>} Class Template Reference} 2 | \label{classsimple__tts_1_1_audio_stream_file_wrapper}\index{simple\_tts::AudioStreamFileWrapper$<$ T $>$@{simple\_tts::AudioStreamFileWrapper$<$ T $>$}} 3 | 4 | 5 | A simple Wrapper that let\textquotesingle{}s a file pretend to be a Audio\+Stream to support the begin and end methods. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$Audio\+Dictionary\+SD.\+h$>$} 11 | 12 | Inheritance diagram for simple\+\_\+tts\+::Audio\+Stream\+File\+Wrapper\texorpdfstring{$<$}{<} T \texorpdfstring{$>$}{>}\+:\begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[height=2.000000cm]{classsimple__tts_1_1_audio_stream_file_wrapper} 16 | \end{center} 17 | \end{figure} 18 | \doxysubsection*{Public Member Functions} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a5dc383f0157acc20bbe557111f174c92}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a5dc383f0157acc20bbe557111f174c92}} 22 | virtual bool {\bfseries begin} (T \&file) 23 | \item 24 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a52541de87d6c45d34687cc28241f2ec1}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a52541de87d6c45d34687cc28241f2ec1}} 25 | virtual bool {\bfseries begin} () override 26 | \item 27 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a409d32f6b59c08830383e3ca67980625}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a409d32f6b59c08830383e3ca67980625}} 28 | virtual void {\bfseries end} () override 29 | \item 30 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a2c61acb3bc042e3e331ef9cc1ae162e0}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a2c61acb3bc042e3e331ef9cc1ae162e0}} 31 | virtual size\+\_\+t {\bfseries read\+Bytes} (uint8\+\_\+t $\ast$buffer, size\+\_\+t length) override 32 | \item 33 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a8224b4fcdb7f680f29f1e849f3b673fd}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a8224b4fcdb7f680f29f1e849f3b673fd}} 34 | virtual size\+\_\+t {\bfseries write} (const uint8\+\_\+t $\ast$buffer, size\+\_\+t length) override 35 | \item 36 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a84a175de88cfaceba1cb9c4b64359e2f}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a84a175de88cfaceba1cb9c4b64359e2f}} 37 | virtual int {\bfseries available} () override 38 | \item 39 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_a5c16c5bd284bafec0e1c5c7f2b689dca}\label{classsimple__tts_1_1_audio_stream_file_wrapper_a5c16c5bd284bafec0e1c5c7f2b689dca}} 40 | virtual int {\bfseries available\+For\+Write} () override 41 | \item 42 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_ad33a82cc03f865d743cabdf06c423e1c}\label{classsimple__tts_1_1_audio_stream_file_wrapper_ad33a82cc03f865d743cabdf06c423e1c}} 43 | {\bfseries operator bool} () 44 | \end{DoxyCompactItemize} 45 | \doxysubsection*{Protected Attributes} 46 | \begin{DoxyCompactItemize} 47 | \item 48 | \mbox{\Hypertarget{classsimple__tts_1_1_audio_stream_file_wrapper_acb405b10d981d9acac5abdc05c927582}\label{classsimple__tts_1_1_audio_stream_file_wrapper_acb405b10d981d9acac5abdc05c927582}} 49 | T $\ast$ {\bfseries p\+\_\+file} = nullptr 50 | \end{DoxyCompactItemize} 51 | 52 | 53 | \doxysubsection{Detailed Description} 54 | \subsubsection*{template$<$class T$>$\newline 55 | class simple\+\_\+tts\+::\+Audio\+Stream\+File\+Wrapper$<$ T $>$} 56 | A simple Wrapper that let\textquotesingle{}s a file pretend to be a Audio\+Stream to support the begin and end methods. 57 | 58 | 59 | 60 | The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize} 61 | \item 62 | src/Audio\+Dictionary\+SD.\+h\end{DoxyCompactItemize} 63 | --------------------------------------------------------------------------------