Playing audio files with a speaker and arduino

RTTTL encodes notes and note durations as printable ASCII strings. Here is an example.

HauntHouse: d=4,o=5,b=108: 2a4, 2e, 2d#, 2b4, 2a4, 2c, 2d, 2a#4, 2e., e, 1f4, 1a4, 1d#, 2e., d, 2c., b4, 1a4, 1p, 2a4, 2e, 2d#, 2b4, 2a4, 2c, 2d, 2a#4, 2e., e, 1f4, 1a4, 1d#, 2e., d, 2c., b4, 1a4

Instead of arrays of binary notes and durations, RTTTL encodes the same information as ASCII chars. RTTTL can be stored in const char arrays.

The following library plays RTTTL strings using the Tone library for output. I have not tried it but I would if I had more time.