Skip to main content

Old MacDonald Had A Farm

I wanted to play around with AWS Polly, which is a service that converts text into speech for you.  What better way to test this out than with an "Old MacDonald Had A Farm" song generator.  But first, I needed to do some research.

Song Variations

There are actually many different ways to sing this song.  I spent a few minutes listening to various versions and here are some important differences I discovered:
  • The list of animals is different every time.
  • The Wiggles version shortens the previous animal sounds so there is no "here a woof, there a woof, everywhere a woof woof".  They simple sing "woof woof here, woof woof there".
  • The previous animal sounds can either be in order, reversed or left out entirely.

Generator Program

The code to generate the lyrics is quite simple.  I have it uploaded on Github.

For every animal in the given list of animal names/sounds, it writes a verse.  Each verse has a intro lines ("Old MacDonald had a farm, E-I-E-I-O! And on this farm he had a <animal>, E-I-E-I-O!"), animal calls and finally an outtro line.

The animal calls are implemented using a strategy pattern which will generate the calls of the previous animals in the preferred order (in order, reversed or skipped).

Synthesising the Voice

I used AWS Polly to generate the voice, calling it using the Java client API.  Using sample code from the AWS documentation pages, it was actually quite simple.

Result


Unfortunately the result sounds more like a boring lecture than a song.  It looks like AWS have a way to mark up the text to increase/decrease pitch and speed which might help give it life, but as they say in the well known meme "ain't nobody got time for that".

Comments

  1. However, children can take other steps to alleviate stress and increase the immune system when faculty and home life become overbearing. Explain and interpret house guidelines, similar to recreation guidelines 온라인카지노 or betting limits. Circulate amongst gaming tables to ensure that|to ensure that} operations are performed correctly, that sellers observe house guidelines, or that players usually are not cheating. Remove suspected cheaters, similar to card counters or other players who may have techniques that shift the chances of profitable to their favor.

    ReplyDelete

Post a Comment

Popular posts from this blog

Rude Word Hunt

This post is inspired by a post a friend shared with me on Twitter. It shows a set of famous chocolate bar wrappers that have been cut and reglued together. That immediately got me thinking if I could get a computer to do this for me. There are so many other situations where this could come in handy. For example, have you ever found yourself alone with a letterboard and wondered what fun you could make by rearranging the letters? Wonder no more. There will be some rude words in this article. If you’re not too worried about that, read on. The source code for this article can be found on Github . Some Ins and Outs The program takes a list of everyday words and returns a list of rude words. Each rude word returned will have a pipe character inserted at points where an input word would have to be cut to form the rude word. For example, let’s say the program was given “twix” and “kit kat”. It would return “tw|at”. It would be up to the user to figure out from which input word...

Depth First Search - For Babies!