JSON Format Instructions

To use the Bastaki Story Narrator, you need to provide a JSON file with the following structure:

              {'paragraphs': [{'speaker': 'Narrator',
                 'text': 'Once upon a time, in a lush green forest, there '
                         'stood an old, mysterious treehouse.  It was rumored '
                         'to be magical, capable of transporting anyone who '
                         'dared to enter to far-off lands.'},
                {'speaker': 'Narrator',
                 'text': 'One sunny afternoon, two adventurous children, Lily '
                         'and Tom, stumbled upon this hidden wonder.'},
                {'speaker': 'Lily',
                 'text': 'Wow, Tom! Look at that amazing treehouse!'},
                {'speaker': 'Tom',
                 'text': 'It looks so old! I wonder who built it.'},
                {'speaker': 'Narrator',
                 'text': 'Curiosity bubbling inside them, they climbed the '
                         'rickety ladder and ventured inside.'},
                {'speaker': 'Narrator',
                 'text': 'Suddenly, the treehouse began to shake, and a '
                         'blinding light filled the room. When the light '
                         'subsided, they found themselves in a strange and '
                         'fantastical world.'},
                {'speaker': 'Old Wizard',
                 'text': 'Welcome, young travelers, to the Land of Whispers! I '
                         'am the guardian of this magical treehouse.'},
                {'speaker': 'Lily',
                 'text': "The Land of Whispers? It's... beautiful!"},
                {'speaker': 'Tom', 'text': 'But... how did we get here?'},
                {'speaker': 'Old Wizard',
                 'text': 'The treehouse chose you. It sensed your adventurous '
                         'spirits. Now, you must help me restore balance to '
                         'this land.'},
                {'speaker': 'Narrator',
                 'text': "And so began Lily and Tom's incredible adventure in "
                         'the Land of Whispers...'}],
 'speakers': [{'name': 'Narrator', 'voice': 'en-US-JennyNeural'},
              {'name': 'Lily', 'voice': 'en-US-AriaNeural'},
              {'name': 'Tom', 'voice': 'en-US-GuyNeural'},
              {'name': 'Old Wizard', 'voice': 'en-US-GuyNeural'}],
 'title': 'The Magical Treehouse'}
            

Explanation:

  • title: The title of your story (string).
  • speakers: An array of speaker objects. Each speaker object has:
    • name: The name of the speaker (string).
    • voice: The Edge TTS voice to use for this speaker (string). You can use the `list_voices` function to get available voices.
  • paragraphs: An array of paragraph objects. Each paragraph object has:
    • speaker: The name of the speaker for this paragraph (string). Must match a name in the `speakers` array.
    • text: The text of the paragraph (string).

Example:

The JSON above represents a short story with a title, a few speakers, and some paragraphs. The Narrator, Lily, Tom, and Old Wizard are the speakers. Each paragraph is assigned to a speaker and contains the text to be narrated.

Make sure your JSON file follows this structure exactly. Invalid JSON files will result in an error.

Upload Story