Skip to content

babadue/talking_clock_chinese_esp32_s3_box

Repository files navigation

A Talking Clock in Chinese for the ESP32 S3 Box


While going through the examples available on github, I wanted to see if I could copy and paste my way through a talking clock (in Chinese).   This is my first time venturing into these niches.


The clock has the following features:

  • offline.
  • listen to commands to tell time and date,
  • temperature (required a DHT22 hardware, G38 is data pin),
  • play mp3 from sc card (required MMC card hardware: Digilent Pmod MicroSD was suggested by Espressif people).  mp3 files can be stored in different folders.  Can go to next or back to previous song.   Music volume can be adjusted.
  • all activities are carrying out via voice commands.

Summary:

wifi and file / http server are from esp-idf.

ispeech.c, ispeak.c:   The sr and tts - speech recognition and text to speech modules came from esp-skainet.

play_mp3_control_example.c:   The MMC sd card and mp3 player came from esp-adf.

DHT22.c:   DHT22 - temperature module came from DHT22.

main.c, clock_ui.c, setdatetime.c:   Display / clock module came from esp-box.

Others - either were from stackoverflow.com or somewhere out there by googling.

While a great effort has been made to avoid modifying any original components directly and to do it at the frontend as much as possible, some changes have to be done at the backend.

If you don't want to compile yourself, the misc folder has all bin files readily to be flashed.


Commands:

  • ask for time:   几点了,   时间呢
  • ask for date:   是什么今号,   什么今号
  • ask for temperature:   是什么温度,  温度呢
  • start music:   开始音乐,   唱歌吧
  • stop music:   停止音乐,   关掉音乐
  • previous song:   从前的,   以前来的
  • next song:   未来的,   后来的
  • increase volume:   更大音乐,   大声音乐
  • decrease volume:   降低声音,   小声音乐
  • previous mp3 folder:   上专辑
  • next mp3 folder:   下目录

No comment on the Chinese command phrases!   These were chosen to adapt to my Chinese accent.   You can modify it to adapt to your voice in the sdkconfig file.   It is in pinyin format.


Hints:

  • boot button (upper left) to goto setting clock menu, and to select mp3 folder.
  • after you have selected a new mp3 folder, either stop then start music again if it is currently playing.   Or just let it finish the current song.
  • the voice volume is independent from music volume.
  • See SD_CARD.md for setting mp3 files structure on the sd card.

Notes:

  • Updated: This project was compiled against idf v5.0.
  • You will need to manually flash esp_tts_voice_data_xiaole.dat at address 0x410000.   This for the Chinese tts.   The file is located in misc\bin_files
  • No attempt was made to handle in the absence of MMC sd card and DHT22 hardware.   So if you do not have these two pieces of hardware and you want to use the clock only, then you will need to dig in and take out those related code.
  • This is provided "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   All code modules are from the mentioned entities.   I just glued it together!


cn_clock_demo3.mov
cn_clock_demo4.mov
cn_clock_demo5.mov
cn_clock_demo6.mov
cn_clock_demo1.mov
cn_clock_demo2.mov


Full Demo on YouTube

Full Demo on YouTube

------------------- A !Mundane World -------------------