Convert Story to Audio
Requirements
Story text from session draft. Voice preference from user profile.
3
Get the narrator voice ID from User Profile preferences (default: Rachel 21m00Tcm4TlvDq8ikWAM).
5
Create Bedtime Story Audio directory if it doesn't exist.
7
Tell the user: '[Name]'s story is ready!' Share the audio path.
To run this task you must have the following required information:
> Story text from session draft. Voice preference from user profile.
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
---
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Story Draft]: Read all files matching `session/bedtime-story-draft/*.md` and analyze their contents (Get the session draft file path)
2. [Read Bedtime Story Audio]: Read all files matching `documents/audio/bedtime-stories/*.mp3` and analyze their contents (Get the audio output path)
3. Get the narrator voice ID from `documents/user/[personal|work|goals|interests].md` preferences (default: Rachel 21m00Tcm4TlvDq8ikWAM).
4. [Gather Arguments: Prep Story for Audio] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `storyFilePath`: ui:bedtime.story.draft file path
- `outputDir`: session directory path (parent of ui:bedtime.story.draft)
5. [Run Code: Prep Story for Audio]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/bedtime.story.prep/preview,
"args": [
"storyFilePath",
"outputDir"
]
},
"packages": null
}
```
6. Create `documents/audio/bedtime-stories/*.mp3` directory if it doesn't exist.
7. [Gather Arguments: Text to Speech] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `textFilePath`: the clean text file path output by the prep step
- `voiceId`: voice ID from preferences (Rachel: 21m00Tcm4TlvDq8ikWAM, Charlotte: XB0fDUnXU5powFXDhCwa, Adam: pNInz6obpgDQGcFmaJgB)
- `modelId` (default: "eleven_multilingual_v2"): eleven_multilingual_v2
- `outputFormat` (default: "mp3_44100_128"): mp3_44100_128
- `outputDir` (default: "session"): ui:bedtime.story.library file path
8. [Run Code: Text to Speech]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/media.audio.tts/preview,
"args": [
"textFilePath",
"voiceId",
"modelId",
"outputFormat",
"outputDir"
]
},
"packages": null
}
```
9. Tell the user: '[Name]'s story is ready!' Share the audio path.