Chatter Sox!

Sox can now chatter!

Sox’s voice is still in training and sounds good so far even though I had to restart due to a configuration error. In the meantime, I have been working on getting the servo for Sox’s jaw to move in step with words.

For most robots, speech is not made using a fake tongue and mouth shape, instead relying on a speaker embedded somewhere within its structure. This is no different for Sox. The challenge is to have the mouth move and audio file play in sync with each other, even though the systems that drive these sections are completely independent.

This was achieved by heavily modifying and stripping down ViennaMike’s ChatterPi originally designed for Halloween skull props. After reading through their code multiple times, I was able to distill it down into one class with few imports. This new class, ChatterSox first initializes pyaudio and sets the servo for the jaw and speaker mute objects. Whenever chatterSox.talk is called, the passed in wav file is converted to a stream with 1024 frames per buffer and a callback function added. The stream is then played and the callback function executes for every buffer.

The callback function determines the jaw’s position based on getting the average volume of the buffer and using that volume as a percentage to set jaw position.

Currently, there is no mouth attached to the jaw so Sox still does not look like Sox, but I am another step closer to worrying about Sox’s feline structure as this resolves another major challenge for connecting the hardware and software together for Sox.

Comments

You need to log in to post comments