going-digital / Talkie

Speech library for Arduino
305 stars 113 forks source link

Added Volume Support #8

Open ColinCreamer opened 9 years ago

ColinCreamer commented 9 years ago

Hey @going-digital. Love your library. I added volume some control functionality. It would be great if you could check it out and possibly pull it back into the main branch so others can benefit too.

Usage example: voice.setVol(50); //Set the volume to 50% voice.setVol(100); //Set the volume to 100%, original output

It takes one parameter, which is the desired volume in percent, 0-255. A value of 100 will output the 'Max' volume, which is the normal volume outputted by the recording. A value of zero is mute, and a value greater then 100 will actually boost the original volume.

Careful when boosting, if you go too high, the audio will distort/muffle as the waveform hits the roof and starts to clip. I found higher then 180% was counter productive, but it really depends on how loud the original clip was.

Wintermute3 commented 9 years ago

Hi Colin - I am getting interested in speech on the Arduino, in my case a Pololu A-Star 32U4 Prime. I will start by incorporating your patch to the base project - thanks! My first Arduino project (but I do have a microcontroller background)...

ColinCreamer commented 8 years ago

Cool. Thanks for the line Michael. Glad to see an interest in my patch. Have you started on your project yet? @Wintermute3

Wintermute3 commented 8 years ago

Hi @ColinCreamer - yes, I checked my stuff in a week or two ago. Check it out at: https://github.com/Wintermute3/Talkie

SD card support for large libraries is the big thing (and the port to A-Star).