This project updates the length of a story according to the users wish. The end goal is to develop a storytelling agent that can adjust the telling of a story to passive user input, creating a better storytelling experience in the same way that a human storyteller would, by reading his/her audience.
First, various versions of the story are created - each containing different amounts of detail. They are organized as a folder of files with a particular naming convention.
A PHP script generates a JSON metadata file from this folder containing the mp3 files and their respective duration.
The playback engine - the user interface - is a single webpage powered by an html5 <audio> tag and JQuery. It looks at the metadata and searches through a variety of possible paths, finding paths that are closest to the users preference. The algorithm remains efficient by only searching a small subset of the domain of all possible paths, yet it re-checks the current path at every intersection in the story.