Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add create_audiobook function #50

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

Josh-XT
Copy link
Collaborator

@Josh-XT Josh-XT commented Oct 5, 2024

Added create_audiobook function.

  • API Endpoint added for POST /v1/audio/book
    • Accepts file upload
    • Accepts voice and language (2 letter) in the body optionally. Will use default voice and en for the language if not defined.
    • Narrator voice is used from voice
    • If language is defined, it will translate the input to the desired language and output text and audio in the desired language.
  • Still need to add 100x male and female voices for random selection. Will synthesize these so that they're not real peoples voices.
graph TD
    A[Start] --> B[Chunk book content]
    B --> C{Paragraph > 2000 tokens?}
    C -->|No| D[Add paragraph to chunk]
    C -->|Yes| E[Split paragraph into sentences]
    E --> F[Group sentences up to 2000 tokens]
    F --> D
    D --> G[Process each chunk]
    G --> H{Extract characters, dialogue, and narration}
    H --> I[Merge similar characters]
    I --> J{Translation requested?}
    J -->|Yes| K[Translate content]
    J -->|No| L[Assign voices to characters]
    K --> L
    L --> M[Generate audio for each content item]
    M --> N[Combine audio segments]
    N --> O[Export final audiobook]
    O --> P[Save text output]
    P --> Q[End]

    subgraph "Chunking process"
    B
    C
    D
    E
    F
    end

    subgraph "For each chunk"
    G
    H
    I
    end

    subgraph "For each content item"
    M
    end
Loading

@Josh-XT Josh-XT marked this pull request as draft October 5, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant