element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog Simple Speech Synthesis with a DTS33A Module
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 18 Oct 2024 3:45 AM Date Created
  • Views 2792 views
  • Likes 10 likes
  • Comments 12 comments
  • speech synthesis
  • DTS33A
  • rainy-day-project
  • speech synthesizer
Related
Recommended

Simple Speech Synthesis with a DTS33A Module

shabaz
shabaz
18 Oct 2024

Table of Contents

  • Introduction
  • Wiring
  • Protocol
  • Tones/Alerts
  • Python Code
  • Summary

Introduction

Since it was cheap, I randomly purchased a DTS33A module to try out. It produces both Chinese and English speech output on demand, using a UART connection.

The board is tiny (22 x 17 mm). It looks like the main chip might be a pre-programmed microcontroller. The two 8-pin chips on the board are an audio amplifier and a 64Mbit Flash.

image

Wiring

I wired it up to a USB-UART adapter, and connected the supplied speaker to it:

image

Protocol

The interface is 3.3V UART (115200 baud).

The protocol is pretty basic. In brief, each stream that you transmit needs to starts with a byte 0xFD, and then there should be a 2-byte length field (most significant byte first) which indicates the length of the remainder of the stream.

The stream typically contains one or more commands. Any text needs to be preceded with 0x01 0x04, which is a command that indicates UTF-8 text is to follow.

So, if you want to play out "BOO", then you'd need to transmit the following:

0xFD,   0x00, 0x05,   0x01, 0x04,   0x42, 0x4F, 0x4F

A useful command:

0x21 - status query. This single-byte command ought to return 0x4f if the DTS33a is idle and ready for input. If it returns anything else, then it's likely that speech is currently being played out.

Some instructions are sent "in-band" within the text string. For instance, to speed up the speech, you could send the text "[s9]BOO". Values from s0 to s9 are accepted.

[s0] to [s9] - speed

[t0] to [t9] - pitch

v[1] to [v9] - volume (even volume 1 is loud enough! higher may distort).

Tones/Alerts

There are a few pre-recorded tones/alerts built-in. To use those, the text string needs to contain, at the beginning, one of the following pieces of text:

ring_1 to ring_5 - these are telephone ring type sounds

alert_1 to alert_5 - these are all warning type sounds

message_1 to message_5 - these are all 'e-mail message arrived' or 'chat message arrived' types of sounds.

Python Code

I wrote a simple DTS33A Python demo, but C code for a microcontroller would be very feasible, too.

To use the code, edit the line containing portname = COM5 to suit your system. 

If you wish to modify the speech, you can edit the following lines:

def maincode():
    dts33a_speak("Daisy Daisy", vol = 1, speed=0, pitch=5)
    dts33a_speak("Give me your answer do", vol = 1, speed=2, pitch=5)
    dts33a_speak("I am half crazy", vol = 1, speed=0, pitch=3)
    dts33a_speak("All for the love of you", vol = 1, speed=0, pitch=1)
    dts33a_wait_for_ready()
    print("Done")

See the 30-second video below for a demonstration.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Summary

It's quite easy to use a UART connection to control a DTS33A speech synthesis board. These things are a bit anachronistic these days, since a microcontroller and stored speech files usually provide far better results. Plus, as you can see from the demo, it doesn't respond very quickly. However, it's very convenient to have everything ready-made in a tiny module, so it might still have occasional uses. See the GitHub repo for the source code.

Thanks for reading!

  • Sign in to reply
  • shabaz
    shabaz over 1 year ago

    Just out of curiosity, since I had it recorded:

    image

    It looks like the module firmware is a bit more sophisticated and doesn't simply process each word in isolation. It changed the second Daisy, to make the sentence flow better. It also makes an erroneous bit of noise at the end of a word occasionally (but not always).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to shabaz

    I guess you could use some of Tracy Ballard's lines as a background voice.

    "Don't you think it's dangerous to rely too much on the robots?
     Don't you think something could go wrong again?"

    https://www.imdb.com/title/tt0074559/characters/nm0001100

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 1 year ago in reply to beacon_dave

    If this module did a male voice, I could have added it to a head:  A Westworld / Futureworld Halloween  (I still have that for Halloween use!). Would have been quite neat to send the text from the mobile via BLE.. or to say random things from the movie script.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 1 year ago in reply to bidrohini

    Hi! Yes, any 3.3V Arduino with UART will work. No need for a library, since the message format is straightforward.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago

    Now that could perhaps liven up some of those Halloween projects a bit.

    /challenges-projects/halloween/b/blog/posts/halloween-2024-is-your-time-to-try-and-contain-as-much-spookiness-as-possible-inside-a-box?ICID=hp-halloween

    Perhaps use a few with the pitch shift feature to create a pumpkin a cappella. Don't forget to add the animatronics.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube