Skip to content

Clone your own voice on your own computer: speak any text in 60+ languages and dub videos into another language in your voice. Fully local. Early version.

272 KB
Raw Blame
{
  "methods": [
    {
      "name": "audio.export",
      "summary": "Convert an audio file to another format",
      "description": "Converts any readable audio file to format, by default next to the source with the new extension; an existing dest is replaced. Errors: bad_request (unknown format or quality, relative or folder dest, dest equal to the source, unreadable source), not_found, not_ready (ffmpeg or the encoder missing).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the source audio file"
          },
          "format": {
            "type": "string",
            "description": "Target format",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ]
          },
          "dest": {
            "type": "string",
            "description": "Absolute destination file path; default next to the source (<name>_export.<ext> when that is the source)"
          },
          "quality": {
            "type": "string",
            "description": "Quality for lossy formats",
            "enum": [
              "high",
              "standard",
              "small"
            ],
            "default": "standard"
          }
        },
        "required": [
          "path",
          "format"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the written file"
          },
          "size_bytes": {
            "type": "integer",
            "description": "Size of the written file in bytes"
          }
        },
        "required": [
          "path",
          "size_bytes"
        ]
      }
    },
    {
      "name": "book.cancel",
      "summary": "Cancel a book",
      "description": "Stops a running book (book.error with code cancelled follows) or marks a paused one cancelled, dropping the unfinished chapter's progress. Finished chapter files stay.",
      "job": false,
      "events": [
        "book.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "book.cast",
      "summary": "Find who speaks each line of a book",
      "description": "Finds who speaks each line before a book is read (Character voices component): the cast, the lines per voice and design terms for the voices. The result is kept: book.start of the same chapters, language and mode uses it, and asking again answers at once with job null. Holds the generation slot while it runs. Errors: not_ready without the component, busy while any generation runs.",
      "job": true,
      "events": [
        "book.cast_progress",
        "book.cast_done",
        "book.cast_error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "chapters": {
            "type": "array",
            "description": "Chapters to read; empty ones are skipped",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text"
                }
              },
              "required": [
                "title",
                "text"
              ]
            }
          },
          "language": {
            "type": "string",
            "description": "Language code of the text"
          },
          "cast": {
            "type": "string",
            "enum": [
              "fast",
              "careful"
            ],
            "default": "fast",
            "description": "How the speakers are found: careful reads the book twice and leaves lines the two readings disagree on to the narrator"
          },
          "again": {
            "type": "boolean",
            "description": "Read every chapter with speech again, kept results or not"
          }
        },
        "required": [
          "chapters"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the cast was found before"
          },
          "key": {
            "type": "string",
            "description": "The cast's key: the chapters, language and mode"
          },
          "mode": {
            "type": "string",
            "description": "fast or careful"
          },
          "narrator": {
            "type": "object",
            "properties": {
              "first_person": {
                "type": "boolean",
                "description": "The book is told by an I who is a character"
              },
              "name": {
                "type": "string",
                "description": "That narrator's name"
              }
            }
          },
          "characters": {
            "type": "array",
            "description": "The speaking characters, most lines first (at most 30)",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name"
                },
                "gender": {
                  "type": "string",
                  "enum": [
                    "m",
                    "f"
                  ],
                  "description": "m or f"
                },
                "lines": {
                  "type": "integer",
                  "description": "Lines"
                }
              }
            }
          },
          "lines": {
            "type": "object",
            "properties": {
              "men": {
                "type": "integer",
                "description": "Lines read by the men's voice"
              },
              "women": {
                "type": "integer",
                "description": "Lines read by the women's voice"
              },
              "narrator": {
                "type": "integer",
                "description": "Speech lines left to the narrator"
              }
            }
          },
          "voices": {
            "type": "object",
            "description": "OmniVoice design terms for a voice of each role (voices.design description)",
            "properties": {
              "narrator": {
                "type": "string",
                "description": "The narrator's voice"
              },
              "men": {
                "type": "string",
                "description": "The men's voice"
              },
              "women": {
                "type": "string",
                "description": "The women's voice"
              }
            }
          }
        },
        "required": [
          "key",
          "job"
        ]
      }
    },
    {
      "name": "book.cast_status",
      "summary": "Which chapters need no new search",
      "description": "One answer per chapter given: whether every speech line in it was searched before (in any grouping of the chapters), so book.cast and book.start use the result at once.",
      "job": false,
      "events": [],
      "params": {
        "type": "object",
        "required": [
          "chapters"
        ],
        "properties": {
          "chapters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "language": {
            "type": "string"
          },
          "cast": {
            "type": "string",
            "enum": [
              "fast",
              "careful"
            ]
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "searched": {
            "type": "array",
            "items": {
              "type": "boolean"
            }
          }
        }
      }
    },
    {
      "name": "book.cast_cancel",
      "summary": "Stop finding who speaks",
      "description": "Stops a running book.cast; book.cast_error with code cancelled follows.",
      "job": false,
      "events": [
        "book.cast_error"
      ],
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "cancelled": {
            "type": "boolean",
            "description": "A book.cast was running"
          }
        }
      }
    },
    {
      "name": "book.delete",
      "summary": "Forget a book project",
      "description": "Forgets the project (texts, progress, segment timing); the output files stay. busy while it is being read.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "book.get",
      "summary": "Get a book with its chapters",
      "description": "Returns a book summary plus its settings and chapter list.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "text": {
            "type": "boolean",
            "description": "Include each chapter's text",
            "default": false
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "description": "A book summary plus its settings and chapter list",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "title": {
            "type": "string",
            "description": "Book title"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source file the text came from"
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source format"
          },
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice that reads the book"
          },
          "status": {
            "type": "string",
            "description": "Book status",
            "enum": [
              "new",
              "running",
              "paused",
              "done",
              "error",
              "cancelled"
            ]
          },
          "interrupted": {
            "type": "boolean",
            "description": "True for a book recorded as running whose job is not running in this engine (reported paused)"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id while it is read, else null"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "chapters_done": {
            "type": "integer",
            "description": "Chapters finished"
          },
          "current": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Index of the current chapter"
          },
          "folder": {
            "type": "string",
            "description": "Output folder of the chapter files"
          },
          "m4b": {
            "type": [
              "string",
              "null"
            ],
            "description": "Path of the M4B audiobook, when made"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the chapter files",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ]
          },
          "words": {
            "type": "integer",
            "description": "Words in the book"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's own name for the project"
          },
          "created": {
            "type": "number",
            "description": "Creation time (unix seconds)"
          },
          "updated": {
            "type": "number",
            "description": "Last change (unix seconds)"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "description": "Last error, or null",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Message"
              }
            }
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          },
          "settings": {
            "type": "object",
            "description": "The voice and output settings the book was started with"
          },
          "chapter_list": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Chapter index"
                },
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "words": {
                  "type": "integer",
                  "description": "Words"
                },
                "chars": {
                  "type": "integer",
                  "description": "Characters"
                },
                "status": {
                  "type": "string",
                  "description": "Chapter status",
                  "enum": [
                    "waiting",
                    "partial",
                    "done"
                  ]
                },
                "segment": {
                  "type": "integer",
                  "description": "Segments done"
                },
                "segments": {
                  "type": "integer",
                  "description": "Segments in the chapter"
                },
                "audio_s": {
                  "type": "number",
                  "description": "Audio made, seconds"
                },
                "elapsed_s": {
                  "type": "number",
                  "description": "Generation time, seconds"
                },
                "rtf": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Real-time factor"
                },
                "path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Chapter file"
                },
                "segments_path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Segment timing file; null until done and for chapters finished before the engine wrote one"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text (only with text: true)"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "chapter_list"
        ]
      }
    },
    {
      "name": "book.list",
      "summary": "List book projects",
      "description": "Lists book summaries, most recently changed first. A book whose job is no longer running is reported paused with interrupted true.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "books": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Book summary",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Book id"
                },
                "title": {
                  "type": "string",
                  "description": "Book title"
                },
                "source": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Source file the text came from"
                },
                "format": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Source format"
                },
                "language": {
                  "type": "string",
                  "description": "Language code"
                },
                "voice_id": {
                  "type": "string",
                  "description": "Voice that reads the book"
                },
                "status": {
                  "type": "string",
                  "description": "Book status",
                  "enum": [
                    "new",
                    "running",
                    "paused",
                    "done",
                    "error",
                    "cancelled"
                  ]
                },
                "interrupted": {
                  "type": "boolean",
                  "description": "True for a book recorded as running whose job is not running in this engine (reported paused)"
                },
                "job": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Job id while it is read, else null"
                },
                "chapters": {
                  "type": "integer",
                  "description": "Number of chapters"
                },
                "chapters_done": {
                  "type": "integer",
                  "description": "Chapters finished"
                },
                "current": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Index of the current chapter"
                },
                "folder": {
                  "type": "string",
                  "description": "Output folder of the chapter files"
                },
                "m4b": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Path of the M4B audiobook, when made"
                },
                "output_format": {
                  "type": "string",
                  "description": "Format of the chapter files",
                  "enum": [
                    "wav",
                    "mp3",
                    "flac",
                    "ogg",
                    "opus",
                    "m4a",
                    "aiff"
                  ]
                },
                "words": {
                  "type": "integer",
                  "description": "Words in the book"
                },
                "ref": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The client's own name for the project"
                },
                "created": {
                  "type": "number",
                  "description": "Creation time (unix seconds)"
                },
                "updated": {
                  "type": "number",
                  "description": "Last change (unix seconds)"
                },
                "error": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Last error, or null",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Error code"
                    },
                    "message": {
                      "type": "string",
                      "description": "Message"
                    }
                  }
                },
                "percent": {
                  "type": "number",
                  "description": "Progress by characters (0-100)"
                },
                "audio_s": {
                  "type": "number",
                  "description": "Audio made so far, seconds"
                },
                "elapsed_s": {
                  "type": "number",
                  "description": "Generation time over all sessions, seconds"
                },
                "rtf": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "elapsed_s / audio_s"
                },
                "eta_s": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Time left at the measured pace; null until the first segment"
                },
                "est_audio_s": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The whole book's length extrapolated, seconds"
                },
                "chars": {
                  "type": "integer",
                  "description": "Characters in the book"
                },
                "chars_done": {
                  "type": "integer",
                  "description": "Characters read so far"
                }
              },
              "required": [
                "id",
                "title",
                "status"
              ]
            }
          }
        },
        "required": [
          "books"
        ]
      }
    },
    {
      "name": "book.pause",
      "summary": "Pause a book being read",
      "description": "Stops the job now and frees the slot; book.paused follows. bad_request when the book is not being read.",
      "job": false,
      "events": [
        "book.paused"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "book.play",
      "summary": "Get a playable WAV of a finished chapter",
      "description": "Returns a WAV to play a finished chapter (the chapter file for WAV, else a decoded copy in the engine tmp folder). not_found for a chapter that is not finished.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "index": {
            "type": "integer",
            "description": "Chapter index"
          }
        },
        "required": [
          "id",
          "index"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The chapter file"
          },
          "path_play": {
            "type": "string",
            "description": "A WAV of the chapter to play"
          }
        },
        "required": [
          "path",
          "path_play"
        ]
      }
    },
    {
      "name": "book.reread",
      "summary": "Mark book chapters to be read again",
      "description": "Drops the listed chapters' files, timing, progress and the M4B so book.resume reads them again, optionally with another voice. not_found for a voice without a reference, busy while it is read or reread.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice to use from now on"
          },
          "chapters": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Chapter indexes to read again; all when omitted, [] for none"
          },
          "voices": {
            "type": "object",
            "description": "The voice of men's or women's lines from now on",
            "properties": {
              "men": {
                "type": "string"
              },
              "women": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "description": "A book summary plus its settings and chapter list",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "title": {
            "type": "string",
            "description": "Book title"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source file the text came from"
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source format"
          },
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice that reads the book"
          },
          "status": {
            "type": "string",
            "description": "Book status",
            "enum": [
              "new",
              "running",
              "paused",
              "done",
              "error",
              "cancelled"
            ]
          },
          "interrupted": {
            "type": "boolean",
            "description": "True for a book recorded as running whose job is not running in this engine (reported paused)"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id while it is read, else null"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "chapters_done": {
            "type": "integer",
            "description": "Chapters finished"
          },
          "current": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Index of the current chapter"
          },
          "folder": {
            "type": "string",
            "description": "Output folder of the chapter files"
          },
          "m4b": {
            "type": [
              "string",
              "null"
            ],
            "description": "Path of the M4B audiobook, when made"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the chapter files",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ]
          },
          "words": {
            "type": "integer",
            "description": "Words in the book"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's own name for the project"
          },
          "created": {
            "type": "number",
            "description": "Creation time (unix seconds)"
          },
          "updated": {
            "type": "number",
            "description": "Last change (unix seconds)"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "description": "Last error, or null",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Message"
              }
            }
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          },
          "settings": {
            "type": "object",
            "description": "The voice and output settings the book was started with"
          },
          "chapter_list": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Chapter index"
                },
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "words": {
                  "type": "integer",
                  "description": "Words"
                },
                "chars": {
                  "type": "integer",
                  "description": "Characters"
                },
                "status": {
                  "type": "string",
                  "description": "Chapter status",
                  "enum": [
                    "waiting",
                    "partial",
                    "done"
                  ]
                },
                "segment": {
                  "type": "integer",
                  "description": "Segments done"
                },
                "segments": {
                  "type": "integer",
                  "description": "Segments in the chapter"
                },
                "audio_s": {
                  "type": "number",
                  "description": "Audio made, seconds"
                },
                "elapsed_s": {
                  "type": "number",
                  "description": "Generation time, seconds"
                },
                "rtf": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Real-time factor"
                },
                "path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Chapter file"
                },
                "segments_path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Segment timing file; null until done and for chapters finished before the engine wrote one"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text (only with text: true)"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "chapter_list"
        ]
      }
    },
    {
      "name": "book.add",
      "summary": "Add chapters to a book",
      "description": "Adds the chapters the book lacks (by text), numbered in the files by number, and leaves it paused; book.resume reads them into its folder with its settings. bad_request when none is new, busy while it is read.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "chapters": {
            "type": "array",
            "description": "Chapters to read; empty ones are skipped",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text"
                },
                "number": {
                  "type": "integer",
                  "description": "The chapter's place in the source, for its file name"
                }
              },
              "required": [
                "title",
                "text"
              ]
            }
          }
        },
        "required": [
          "id",
          "chapters"
        ]
      },
      "result": {
        "type": "object",
        "description": "A book summary plus its settings and chapter list",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "title": {
            "type": "string",
            "description": "Book title"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source file the text came from"
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source format"
          },
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice that reads the book"
          },
          "status": {
            "type": "string",
            "description": "Book status",
            "enum": [
              "new",
              "running",
              "paused",
              "done",
              "error",
              "cancelled"
            ]
          },
          "interrupted": {
            "type": "boolean",
            "description": "True for a book recorded as running whose job is not running in this engine (reported paused)"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id while it is read, else null"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "chapters_done": {
            "type": "integer",
            "description": "Chapters finished"
          },
          "current": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Index of the current chapter"
          },
          "folder": {
            "type": "string",
            "description": "Output folder of the chapter files"
          },
          "m4b": {
            "type": [
              "string",
              "null"
            ],
            "description": "Path of the M4B audiobook, when made"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the chapter files",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ]
          },
          "words": {
            "type": "integer",
            "description": "Words in the book"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's own name for the project"
          },
          "created": {
            "type": "number",
            "description": "Creation time (unix seconds)"
          },
          "updated": {
            "type": "number",
            "description": "Last change (unix seconds)"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "description": "Last error, or null",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Message"
              }
            }
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          },
          "settings": {
            "type": "object",
            "description": "The voice and output settings the book was started with"
          },
          "chapter_list": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Chapter index"
                },
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "words": {
                  "type": "integer",
                  "description": "Words"
                },
                "chars": {
                  "type": "integer",
                  "description": "Characters"
                },
                "status": {
                  "type": "string",
                  "description": "Chapter status",
                  "enum": [
                    "waiting",
                    "partial",
                    "done"
                  ]
                },
                "segment": {
                  "type": "integer",
                  "description": "Segments done"
                },
                "segments": {
                  "type": "integer",
                  "description": "Segments in the chapter"
                },
                "audio_s": {
                  "type": "number",
                  "description": "Audio made, seconds"
                },
                "elapsed_s": {
                  "type": "number",
                  "description": "Generation time, seconds"
                },
                "rtf": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Real-time factor"
                },
                "path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Chapter file"
                },
                "segments_path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Segment timing file; null until done and for chapters finished before the engine wrote one"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text (only with text: true)"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "chapter_list"
        ]
      }
    },
    {
      "name": "book.settings",
      "summary": "Change a book's settings",
      "description": "Sets voice_id, voices, cast, m4b, read_titles or exact_stress for what the book reads from now on, also while it is read; an M4B ticked then is made when the reading ends.",
      "job": false,
      "events": [],
      "params": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "voice_id": {
            "type": "string"
          },
          "voices": {
            "type": "object",
            "properties": {
              "men": {
                "type": "string"
              },
              "women": {
                "type": "string"
              }
            }
          },
          "cast": {
            "type": "string",
            "enum": [
              "fast",
              "careful"
            ]
          },
          "m4b": {
            "type": "boolean"
          },
          "read_titles": {
            "type": "boolean"
          },
          "exact_stress": {
            "type": "boolean"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "book.resume",
      "summary": "Resume a paused, failed or cancelled book",
      "description": "Continues a paused, error, cancelled or new book with its original settings from the next unfinished segment. bad_request for a finished book, busy while a generation runs.",
      "job": true,
      "events": [
        "book.progress",
        "book.chapter",
        "book.done",
        "book.paused",
        "book.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "description": "The project and its job, plus accent and reference fields as tts.generate (not for an existing running or done project found by ref)",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id; null when an existing project is already done"
          },
          "folder": {
            "type": "string",
            "description": "Output folder"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "words": {
            "type": "integer",
            "description": "Words"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's name for the project"
          },
          "existing": {
            "type": "boolean",
            "description": "True when a project with this ref already existed"
          },
          "status": {
            "type": "string",
            "description": "running or done",
            "enum": [
              "running",
              "done"
            ]
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          }
        },
        "required": [
          "id",
          "job",
          "status"
        ]
      }
    },
    {
      "name": "book.start",
      "summary": "Create a book project and start reading it",
      "description": "Creates a book project and reads it in one engine job, one file per chapter. With an existing ref it continues or reports that project instead. Errors: not_found, not_ready, bad_request as tts.generate; busy while any generation runs.",
      "job": true,
      "events": [
        "book.progress",
        "book.chapter",
        "book.done",
        "book.paused",
        "book.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Book title"
          },
          "source": {
            "type": "string",
            "description": "Source file the text came from"
          },
          "format": {
            "type": "string",
            "description": "Source format"
          },
          "chapters": {
            "type": "array",
            "description": "Chapters to read; empty ones are skipped",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "text": {
                  "type": "string",
                  "description": "Chapter text"
                },
                "number": {
                  "type": "integer",
                  "description": "The chapter's place in the source, for its file name"
                }
              },
              "required": [
                "title",
                "text"
              ]
            }
          },
          "voice_id": {
            "type": "string",
            "description": "Voice that reads the book"
          },
          "language": {
            "type": "string",
            "description": "Language code of the text"
          },
          "expressiveness": {
            "type": "number",
            "description": "Sampling freedom (0.1-1.5)",
            "minimum": 0.1,
            "maximum": 1.5,
            "default": 0.6
          },
          "voice_match": {
            "type": "number",
            "description": "RVC index rate (0-1); 0 skips RVC",
            "minimum": 0,
            "maximum": 1,
            "default": 1
          },
          "quality": {
            "type": "string",
            "description": "best (32 decoding steps) or fast (16 steps)",
            "enum": [
              "best",
              "fast"
            ],
            "default": "best"
          },
          "speed": {
            "type": "number",
            "description": "Speaking speed (0.8-1.3), clamped",
            "minimum": 0.8,
            "maximum": 1.3,
            "default": 1
          },
          "accent": {
            "type": "string",
            "description": "own (the voice's reference) or native-us (a native US speaker, converted to the voice's timbre); applies to English speech",
            "enum": [
              "own",
              "native-us"
            ],
            "default": "own"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker for native-us: auto picks by pitch",
            "enum": [
              "auto",
              "male",
              "female"
            ],
            "default": "auto"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the saved result",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ],
            "default": "wav"
          },
          "m4b": {
            "type": "boolean",
            "description": "Also make one M4B audiobook with chapter marks",
            "default": false
          },
          "read_titles": {
            "type": "boolean",
            "description": "Read each chapter title aloud first",
            "default": true
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's own name for the project; an existing project with it is reused"
          },
          "model": {
            "type": "string",
            "description": "Voice-cloning model: auto (OmniVoice, or an installed model for a language OmniVoice does not speak), or the id of an installed one in hello speech_models (omnivoice, voxcpm, chatterbox)",
            "default": "auto"
          },
          "voices": {
            "type": "object",
            "description": "Character voices: the voice ids that read the men's and the women's lines (the narrator reads the rest); needs the Character voices component",
            "properties": {
              "men": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Voice id for every male character"
              },
              "women": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Voice id for every female character"
              }
            }
          },
          "cast": {
            "type": "string",
            "enum": [
              "fast",
              "careful"
            ],
            "default": "fast",
            "description": "How the speakers are found: careful reads the book twice and leaves lines the two readings disagree on to the narrator"
          }
        },
        "required": [
          "title",
          "chapters",
          "voice_id"
        ]
      },
      "result": {
        "type": "object",
        "description": "The project and its job, plus accent and reference fields as tts.generate (not for an existing running or done project found by ref)",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id; null when an existing project is already done"
          },
          "folder": {
            "type": "string",
            "description": "Output folder"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "words": {
            "type": "integer",
            "description": "Words"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's name for the project"
          },
          "existing": {
            "type": "boolean",
            "description": "True when a project with this ref already existed"
          },
          "status": {
            "type": "string",
            "description": "running or done",
            "enum": [
              "running",
              "done"
            ]
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          }
        },
        "required": [
          "id",
          "job",
          "status"
        ]
      }
    },
    {
      "name": "components.set",
      "summary": "Turn an installed component on or off",
      "description": "Turns an installed optional part on or off in components.json; it takes effect when the engine starts again, so the app restarts it. speech cannot be turned off (bad_request).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional component",
            "enum": [
              "training",
              "translation",
              "better_translation",
              "native_accent",
              "music_removal",
              "ukrainian",
              "voxcpm",
              "chatterbox"
            ]
          },
          "on": {
            "type": "boolean",
            "description": "true turns it on, false off"
          }
        },
        "required": [
          "id",
          "on"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "off": {
            "type": "array",
            "description": "Components now turned off",
            "items": {
              "type": "string",
              "description": "Component"
            }
          },
          "restart": {
            "type": "boolean",
            "description": "Always true: restart the engine to apply"
          }
        },
        "required": [
          "off",
          "restart"
        ]
      }
    },
    {
      "name": "dataset.add",
      "summary": "Add or replace a dataset part",
      "description": "Reads any audio file (or a video's audio track), trims and normalises it, stores it as dataset/part<N>.wav replacing an older take, and refreshes reference.wav (a manual choice is kept). bad_request for takes under 0.3 s or below 16 kHz; not_found for an unknown voice or file.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice id"
          },
          "part_index": {
            "type": "integer",
            "description": "Part number (from 1)",
            "minimum": 1
          },
          "path": {
            "type": "string",
            "description": "Absolute path of the audio or video file"
          },
          "expected_s": {
            "type": "number",
            "description": "Estimated reading time, seconds"
          },
          "start_over": {
            "type": "boolean",
            "description": "First remove the voice's recordings, reference clips, media pool and trained model"
          },
          "language": {
            "type": "string",
            "description": "With start_over: the voice's new language code"
          }
        },
        "required": [
          "voice_id",
          "part_index",
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "part": {
            "type": "object",
            "description": "A recorded part",
            "properties": {
              "index": {
                "type": "integer",
                "description": "Part index (from 1)"
              },
              "duration_s": {
                "type": "number",
                "description": "Duration, seconds"
              },
              "verdict": {
                "type": "string",
                "description": "Quality verdict",
                "enum": [
                  "ok",
                  "warn",
                  "bad"
                ]
              },
              "issues": {
                "type": "array",
                "description": "Plain-language issues",
                "items": {
                  "type": "string",
                  "description": "Issue"
                }
              }
            },
            "required": [
              "index",
              "duration_s",
              "verdict",
              "issues"
            ]
          },
          "summary": {
            "type": "object",
            "description": "Dataset summary",
            "properties": {
              "total_minutes": {
                "type": "number",
                "description": "Recorded minutes"
              },
              "usable_minutes": {
                "type": "number",
                "description": "Minutes of parts whose verdict is not bad"
              },
              "parts": {
                "type": "array",
                "description": "Recorded parts",
                "items": {
                  "type": "object",
                  "description": "A recorded part",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "description": "Part index (from 1)"
                    },
                    "duration_s": {
                      "type": "number",
                      "description": "Duration, seconds"
                    },
                    "verdict": {
                      "type": "string",
                      "description": "Quality verdict",
                      "enum": [
                        "ok",
                        "warn",
                        "bad"
                      ]
                    },
                    "issues": {
                      "type": "array",
                      "description": "Plain-language issues",
                      "items": {
                        "type": "string",
                        "description": "Issue"
                      }
                    }
                  },
                  "required": [
                    "index",
                    "duration_s",
                    "verdict",
                    "issues"
                  ]
                }
              },
              "level": {
                "type": "string",
                "description": "Dataset level from usable minutes (under 0.5 too_short, under 3 zero_shot, under 10 trainable, else great)",
                "enum": [
                  "too_short",
                  "zero_shot",
                  "trainable",
                  "great"
                ]
              },
              "message": {
                "type": "string",
                "description": "Plain-language message"
              },
              "recommended_epochs": {
                "type": "integer",
                "description": "0 below 3 usable minutes, else what train.start with epochs null would use"
              },
              "has_reference": {
                "type": "boolean",
                "description": "reference.wav exists"
              },
              "reference": {
                "type": "object",
                "description": "Present only with has_reference: the clip in use, from a part {part,start_s,end_s,duration_s,manual?,rate?,pauses?} or from the media pool {source:\"media\",start_s,end_s,duration_s,manual:true,pool,file,title,...}"
              }
            },
            "required": [
              "total_minutes",
              "usable_minutes",
              "parts",
              "level",
              "message",
              "recommended_epochs",
              "has_reference"
            ]
          }
        },
        "required": [
          "part",
          "summary"
        ]
      }
    },
    {
      "name": "dataset.remove",
      "summary": "Remove a dataset part",
      "description": "Removes a recorded part; removing a missing part is not an error.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice id"
          },
          "part_index": {
            "type": "integer",
            "description": "Part number (from 1)",
            "minimum": 1
          }
        },
        "required": [
          "voice_id",
          "part_index"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "object",
            "description": "Dataset summary",
            "properties": {
              "total_minutes": {
                "type": "number",
                "description": "Recorded minutes"
              },
              "usable_minutes": {
                "type": "number",
                "description": "Minutes of parts whose verdict is not bad"
              },
              "parts": {
                "type": "array",
                "description": "Recorded parts",
                "items": {
                  "type": "object",
                  "description": "A recorded part",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "description": "Part index (from 1)"
                    },
                    "duration_s": {
                      "type": "number",
                      "description": "Duration, seconds"
                    },
                    "verdict": {
                      "type": "string",
                      "description": "Quality verdict",
                      "enum": [
                        "ok",
                        "warn",
                        "bad"
                      ]
                    },
                    "issues": {
                      "type": "array",
                      "description": "Plain-language issues",
                      "items": {
                        "type": "string",
                        "description": "Issue"
                      }
                    }
                  },
                  "required": [
                    "index",
                    "duration_s",
                    "verdict",
                    "issues"
                  ]
                }
              },
              "level": {
                "type": "string",
                "description": "Dataset level from usable minutes (under 0.5 too_short, under 3 zero_shot, under 10 trainable, else great)",
                "enum": [
                  "too_short",
                  "zero_shot",
                  "trainable",
                  "great"
                ]
              },
              "message": {
                "type": "string",
                "description": "Plain-language message"
              },
              "recommended_epochs": {
                "type": "integer",
                "description": "0 below 3 usable minutes, else what train.start with epochs null would use"
              },
              "has_reference": {
                "type": "boolean",
                "description": "reference.wav exists"
              },
              "reference": {
                "type": "object",
                "description": "Present only with has_reference: the clip in use, from a part {part,start_s,end_s,duration_s,manual?,rate?,pauses?} or from the media pool {source:\"media\",start_s,end_s,duration_s,manual:true,pool,file,title,...}"
              }
            },
            "required": [
              "total_minutes",
              "usable_minutes",
              "parts",
              "level",
              "message",
              "recommended_epochs",
              "has_reference"
            ]
          }
        },
        "required": [
          "summary"
        ]
      }
    },
    {
      "name": "dataset.summary",
      "summary": "Summarise a voice's dataset",
      "description": "Returns recorded and usable minutes, the parts, the dataset level, the recommended epochs and the reference clip. Parts copied in by hand are analysed on the first summary.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice id"
          }
        },
        "required": [
          "voice_id"
        ]
      },
      "result": {
        "type": "object",
        "description": "Dataset summary",
        "properties": {
          "total_minutes": {
            "type": "number",
            "description": "Recorded minutes"
          },
          "usable_minutes": {
            "type": "number",
            "description": "Minutes of parts whose verdict is not bad"
          },
          "parts": {
            "type": "array",
            "description": "Recorded parts",
            "items": {
              "type": "object",
              "description": "A recorded part",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Part index (from 1)"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Duration, seconds"
                },
                "verdict": {
                  "type": "string",
                  "description": "Quality verdict",
                  "enum": [
                    "ok",
                    "warn",
                    "bad"
                  ]
                },
                "issues": {
                  "type": "array",
                  "description": "Plain-language issues",
                  "items": {
                    "type": "string",
                    "description": "Issue"
                  }
                }
              },
              "required": [
                "index",
                "duration_s",
                "verdict",
                "issues"
              ]
            }
          },
          "level": {
            "type": "string",
            "description": "Dataset level from usable minutes (under 0.5 too_short, under 3 zero_shot, under 10 trainable, else great)",
            "enum": [
              "too_short",
              "zero_shot",
              "trainable",
              "great"
            ]
          },
          "message": {
            "type": "string",
            "description": "Plain-language message"
          },
          "recommended_epochs": {
            "type": "integer",
            "description": "0 below 3 usable minutes, else what train.start with epochs null would use"
          },
          "has_reference": {
            "type": "boolean",
            "description": "reference.wav exists"
          },
          "reference": {
            "type": "object",
            "description": "Present only with has_reference: the clip in use, from a part {part,start_s,end_s,duration_s,manual?,rate?,pauses?} or from the media pool {source:\"media\",start_s,end_s,duration_s,manual:true,pool,file,title,...}"
          }
        },
        "required": [
          "total_minutes",
          "usable_minutes",
          "parts",
          "level",
          "message",
          "recommended_epochs",
          "has_reference"
        ]
      }
    },
    {
      "name": "formats.list",
      "summary": "List the audio and video formats for import and export",
      "description": "Lists the lower-case extensions (without a dot) the found ffmpeg can read and write, for file pickers. Without ffmpeg only WAV, FLAC, OGG and AIFF can be read.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "import": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Readable extensions (wma only with a WMA decoder)"
          },
          "import_video": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The subset of import that are video containers"
          },
          "export": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "wav",
                "mp3",
                "flac",
                "ogg",
                "opus",
                "m4a",
                "aiff"
              ]
            },
            "description": "Formats audio.export and output_format can write"
          },
          "export_video": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "mp4",
                "mkv",
                "webm",
                "mov"
              ]
            },
            "description": "Containers video.export can write"
          },
          "qualities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "high",
                "standard",
                "small"
              ]
            },
            "description": "Export quality names"
          },
          "ffmpeg": {
            "type": [
              "string",
              "null"
            ],
            "description": "ffmpeg version line, or null when ffmpeg is not found"
          }
        },
        "required": [
          "import",
          "import_video",
          "export",
          "export_video",
          "qualities",
          "ffmpeg"
        ]
      }
    },
    {
      "name": "hello",
      "summary": "Get engine info",
      "description": "Returns the engine version, device, model states, speech languages, installed translators and components. The same data is in the ready event.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "description": "Engine info",
        "properties": {
          "version": {
            "type": "string",
            "description": "Engine version"
          },
          "device": {
            "type": "object",
            "description": "Compute device",
            "properties": {
              "backend": {
                "type": "string",
                "description": "Compute backend",
                "enum": [
                  "cuda",
                  "mps",
                  "cpu"
                ]
              },
              "name": {
                "type": "string",
                "description": "Device name, e.g. \"NVIDIA GeForce RTX 4070\" or \"CPU\""
              },
              "vram_gb": {
                "type": "number",
                "description": "Total VRAM rounded to 0.1; 0.0 for MPS and CPU"
              },
              "vendor": {
                "type": "string",
                "description": "GPU vendor from runtime.toml; left out when not set",
                "enum": [
                  "nvidia",
                  "amd"
                ]
              }
            },
            "required": [
              "backend",
              "name",
              "vram_gb"
            ]
          },
          "models": {
            "type": "object",
            "description": "Model states",
            "properties": {
              "tts": {
                "type": "string",
                "description": "Speech model state",
                "enum": [
                  "ready",
                  "loading",
                  "paused",
                  "missing",
                  "no_memory"
                ]
              },
              "rvc": {
                "type": "string",
                "description": "RVC model state",
                "enum": [
                  "ready",
                  "loading",
                  "paused",
                  "missing"
                ]
              },
              "tts_message": {
                "type": "string",
                "description": "Why the speech model is not loaded; only with tts no_memory"
              }
            },
            "required": [
              "tts",
              "rvc"
            ]
          },
          "languages": {
            "type": "array",
            "description": "Every language the speech model speaks, common ones first, then the rest by English name",
            "items": {
              "type": "object",
              "description": "A language the speech model speaks",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "ISO 639-1 code"
                },
                "name": {
                  "type": "string",
                  "description": "Name in English"
                },
                "native": {
                  "type": "string",
                  "description": "Name in the language itself"
                },
                "common": {
                  "type": "boolean",
                  "description": "A common language (listed first)"
                }
              },
              "required": [
                "code",
                "name",
                "native"
              ]
            }
          },
          "translators": {
            "type": "array",
            "description": "Installed Redub translation models, best first; empty when none",
            "items": {
              "type": "string",
              "description": "Translator id",
              "enum": [
                "nllb-1.3b",
                "nllb-600m"
              ]
            }
          },
          "zero_shot_vc": {
            "type": "boolean",
            "description": "The zero-shot voice converter (Seed-VC) is installed and on"
          },
          "components": {
            "type": "array",
            "description": "Installed runtime parts that are not turned off",
            "items": {
              "type": "string",
              "description": "Component",
              "enum": [
                "speech",
                "training",
                "translation",
                "better_translation",
                "native_accent",
                "music_removal",
                "ukrainian",
                "voxcpm",
                "chatterbox"
              ]
            }
          },
          "components_off": {
            "type": "array",
            "description": "Installed parts the user turned off",
            "items": {
              "type": "string",
              "description": "Component"
            }
          },
          "speech_models": {
            "type": "array",
            "description": "Installed voice-cloning models a request may name in model, OmniVoice first",
            "items": {
              "type": "object",
              "description": "A voice-cloning model",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Model id",
                  "enum": [
                    "omnivoice",
                    "voxcpm",
                    "chatterbox"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Display name"
                },
                "languages": {
                  "type": "array",
                  "description": "ISO 639-1 codes it speaks",
                  "items": {
                    "type": "string",
                    "description": "ISO 639-1 code"
                  }
                },
                "design": {
                  "type": "boolean",
                  "description": "It makes voices from a description (voices.design)"
                }
              },
              "required": [
                "id",
                "name",
                "languages",
                "design"
              ]
            }
          }
        },
        "required": [
          "version",
          "device",
          "models",
          "languages",
          "translators",
          "zero_shot_vc",
          "components",
          "components_off",
          "speech_models"
        ]
      }
    },
    {
      "name": "media.combine",
      "summary": "Combine media files into one clean WAV",
      "description": "Joins many audio/video files of one speaker into one cleaned mono 16-bit 44.1 kHz WAV under <data>/tmp/combined/ (at most 20 minutes). Unreadable files or files without clear speech are skipped; none usable is bad_request. With language \"auto\" it also detects the language spoken in the result, and gives it to voice_id when that voice has no recordings yet. A plain request without progress events.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "paths": {
            "type": "array",
            "description": "Files to combine",
            "items": {
              "type": "string",
              "description": "Absolute path of an audio or video file"
            }
          },
          "remove_music": {
            "type": [
              "boolean",
              "string",
              "null"
            ],
            "enum": [
              true,
              false,
              "auto",
              null
            ],
            "default": "auto",
            "description": "Remove background music: true (every file), false (never) or \"auto\" (null too): video files with an SNR under 35 dB, only on CUDA with no training holding the GPU"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "auto",
              null
            ],
            "description": "\"auto\": detect the language spoken in the combined result with Whisper (up to 5 windows of 30 s over the whole result, their probabilities summed); left out or null: no detection"
          },
          "voice_id": {
            "type": "string",
            "description": "With language \"auto\": a voice with no recordings and no trained model takes the detected language"
          }
        },
        "required": [
          "paths"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Path of the combined WAV"
          },
          "duration_s": {
            "type": "number",
            "description": "Length, seconds"
          },
          "files": {
            "type": "array",
            "description": "Files used",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "File name"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Seconds used"
                },
                "truncated": {
                  "type": "boolean",
                  "description": "Cut at the 20-minute limit"
                },
                "music_removed": {
                  "type": "boolean",
                  "description": "Background music was removed"
                }
              },
              "required": [
                "name",
                "duration_s"
              ]
            }
          },
          "skipped": {
            "type": "array",
            "description": "Skipped files",
            "items": {
              "type": "object",
              "description": "A skipped file",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "File name"
                },
                "path": {
                  "type": "string",
                  "description": "File path"
                },
                "reason": {
                  "type": "string",
                  "description": "Why it was skipped"
                }
              },
              "required": [
                "name",
                "path",
                "reason"
              ]
            }
          },
          "unused": {
            "type": "array",
            "description": "Files past the 20-minute limit",
            "items": {
              "type": "string",
              "description": "File name"
            }
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language detected in the result (e.g. \"zh\"), null when not asked, unsure or Whisper is missing"
          },
          "language_set": {
            "type": "boolean",
            "description": "voice_id's language was set to the detected one"
          },
          "music_removed": {
            "type": "boolean",
            "description": "Background music was removed from at least one file"
          },
          "music_files": {
            "type": "integer",
            "description": "Number of files separated"
          },
          "music_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no file was separated, e.g. \"turned off\", \"no background sound found under the voice\", \"the music-removal model is not installed (run setup again)\""
          },
          "music_device": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cuda",
              "cpu",
              null
            ],
            "description": "Device the separation ran on"
          }
        },
        "required": [
          "path",
          "duration_s",
          "files",
          "skipped",
          "unused"
        ]
      }
    },
    {
      "name": "outputs.delete",
      "summary": "Delete a saved result",
      "description": "Deletes the result file, files of the same name with other extensions and its sidecar, and path_play when given. Any path outside <data>/outputs or <data>/tmp/play, relative or a folder refuses the whole request with bad_request; a file that cannot be removed is internal.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the result (the path of tts.done / redub.done)"
          },
          "path_play": {
            "type": "string",
            "description": "Absolute path of its playback WAV; omit or send path for a wav result"
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Absolute paths actually deleted (files already gone are not listed)"
          }
        },
        "required": [
          "deleted"
        ]
      }
    },
    {
      "name": "outputs.list",
      "summary": "List the saved results",
      "description": "Lists the results in <data>/outputs (top level only), newest first by created, after a restart too. Page with before; more says older ones exist. A limit that is not a positive integer is bad_request.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "description": "Only results of this kind",
            "enum": [
              "speak",
              "redub"
            ]
          },
          "limit": {
            "type": "integer",
            "description": "At most this many entries (at most 500)",
            "minimum": 1,
            "maximum": 500,
            "default": 50
          },
          "before": {
            "type": "number",
            "description": "Only entries with created below this (unix seconds): the last entry created, for the next page"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One saved result (files with one stem are one entry)",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The file stem"
                },
                "kind": {
                  "type": "string",
                  "description": "Result kind",
                  "enum": [
                    "speak",
                    "redub"
                  ]
                },
                "legacy": {
                  "type": "boolean",
                  "description": "Saved before sidecars (or external): recognised by its name only"
                },
                "external": {
                  "type": "boolean",
                  "description": "A file put into outputs from outside (legacy is true too)"
                },
                "name": {
                  "type": "string",
                  "description": "Saved file name"
                },
                "created": {
                  "type": "number",
                  "description": "Unix seconds (the file mtime for legacy entries)"
                },
                "path": {
                  "type": "string",
                  "description": "Absolute path of the audio file (a video-only result: the video)"
                },
                "path_play": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "A WAV that plays it now without decoding; null: ask outputs.play"
                },
                "video_path": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Absolute path of the video file of a Redub of a video"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Duration in seconds"
                },
                "elapsed_s": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Time the job took; null for legacy entries"
                },
                "format": {
                  "type": "string",
                  "description": "Format of the saved file"
                },
                "voice_id": {
                  "type": "string",
                  "description": "From the sidecar"
                },
                "voice_name": {
                  "type": "string",
                  "description": "From the sidecar"
                },
                "text": {
                  "type": "string",
                  "description": "Speak: the whole text (from the sidecar)"
                },
                "language": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "From the sidecar"
                },
                "accent": {
                  "type": "string",
                  "description": "From the sidecar"
                },
                "mode": {
                  "type": "string",
                  "description": "Redub mode (from the sidecar)",
                  "enum": [
                    "dub",
                    "convert",
                    "respeak",
                    "subtitles"
                  ]
                },
                "source_name": {
                  "type": "string",
                  "description": "Redub: the source file name (from the sidecar)"
                },
                "to": {
                  "type": "string",
                  "description": "Redub: the language spoken (from the sidecar)"
                }
              },
              "required": [
                "id",
                "kind",
                "legacy",
                "name",
                "created",
                "path",
                "path_play",
                "duration_s",
                "format"
              ]
            },
            "description": "Saved results, newest first"
          },
          "more": {
            "type": "boolean",
            "description": "Older results exist"
          }
        },
        "required": [
          "results",
          "more"
        ]
      }
    },
    {
      "name": "outputs.play",
      "summary": "Get a playable WAV for a saved result",
      "description": "Returns path_play: path itself for a WAV, else a decoded copy in <data>/tmp/play reused for the session. path must be absolute and inside <data>/outputs (bad_request); a missing file is not_found; an undecodable one bad_request or internal.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the saved result (audio or video)"
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The requested path"
          },
          "path_play": {
            "type": "string",
            "description": "Absolute path of a 16-bit 44.1 kHz WAV to play"
          }
        },
        "required": [
          "path",
          "path_play"
        ]
      }
    },
    {
      "name": "presets.list",
      "summary": "List the reading presets of a language",
      "description": "Returns the quick, standard and pro presets of a language and every language that has presets (English first). A code without presets or an unsupported code is bad_request; a missing presets folder is not_found.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preset language (ISO 639-1); \"auto\" and null mean \"en\"",
            "default": "en"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "description": "Language of the presets"
          },
          "languages": {
            "type": "array",
            "description": "Languages with presets, English first",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "ISO 639-1 code"
                },
                "name": {
                  "type": "string",
                  "description": "Name in English"
                },
                "native": {
                  "type": "string",
                  "description": "Native name"
                }
              },
              "required": [
                "code",
                "name",
                "native"
              ]
            }
          },
          "presets": {
            "type": "array",
            "description": "Presets in the order quick, standard, pro",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Preset id",
                  "enum": [
                    "quick",
                    "standard",
                    "pro"
                  ]
                },
                "title": {
                  "type": "string",
                  "description": "UI title (English)"
                },
                "description": {
                  "type": "string",
                  "description": "UI description (English)"
                },
                "target_minutes": {
                  "type": "number",
                  "description": "Target recording minutes"
                },
                "trains_rvc": {
                  "type": "boolean",
                  "description": "The preset trains RVC"
                },
                "language": {
                  "type": "string",
                  "description": "Preset language"
                },
                "parts": {
                  "type": "array",
                  "description": "Parts to read",
                  "items": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "integer",
                        "description": "Part index (from 1)"
                      },
                      "title": {
                        "type": "string",
                        "description": "Part title in the preset language"
                      },
                      "text": {
                        "type": "string",
                        "description": "Text to read"
                      },
                      "est_seconds": {
                        "type": "number",
                        "description": "Estimated reading time, seconds"
                      }
                    },
                    "required": [
                      "index",
                      "title",
                      "text",
                      "est_seconds"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "title",
                "description",
                "target_minutes",
                "trains_rvc",
                "language",
                "parts"
              ]
            }
          }
        },
        "required": [
          "language",
          "languages",
          "presets"
        ]
      }
    },
    {
      "name": "recording.check",
      "summary": "Check the quality of a recording",
      "description": "Measures level, clipping, noise and silence of any audio or video file and gives a verdict with plain-language issues. Errors: not_found (no such file), bad_request (unreadable or empty audio).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of an audio or video file"
          },
          "expected_s": {
            "type": "number",
            "description": "Estimated reading time; under 60 percent of it adds a warning"
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "duration_s": {
            "type": "number",
            "description": "Duration, seconds"
          },
          "peak": {
            "type": "number",
            "description": "Peak level"
          },
          "clipping_pct": {
            "type": "number",
            "description": "Percent of clipped samples"
          },
          "rms_db": {
            "type": "number",
            "description": "RMS level, dB"
          },
          "noise_floor_db": {
            "type": "number",
            "description": "Noise floor, dB"
          },
          "snr_db": {
            "type": "number",
            "description": "Signal-to-noise ratio, dB"
          },
          "silence_pct": {
            "type": "number",
            "description": "Percent of silence"
          },
          "verdict": {
            "type": "string",
            "description": "Verdict",
            "enum": [
              "ok",
              "warn",
              "bad"
            ]
          },
          "issues": {
            "type": "array",
            "description": "Plain-language issues",
            "items": {
              "type": "string",
              "description": "Issue"
            }
          }
        },
        "required": [
          "duration_s",
          "peak",
          "clipping_pct",
          "rms_db",
          "noise_floor_db",
          "snr_db",
          "silence_pct",
          "verdict",
          "issues"
        ]
      }
    },
    {
      "name": "redub.cancel",
      "summary": "Cancel a Redub job",
      "description": "Cancels any Redub job; it ends with redub.error code cancelled.",
      "job": false,
      "events": [
        "redub.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          }
        },
        "required": [
          "job"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "redub.dub",
      "summary": "Transcribe, translate and dub a file in one job",
      "description": "Transcribes, translates to target_language and speaks the result in a voice at the original times, or stops after the translation for review (review true, ends with redub.transcript). Errors at start: bad_request, not_found, not_ready, busy.",
      "job": true,
      "events": [
        "redub.progress",
        "redub.transcript",
        "redub.done",
        "redub.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the media file"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice to speak with"
          },
          "source_language": {
            "type": "string",
            "description": "auto or the code of the speech",
            "default": "auto"
          },
          "target_language": {
            "type": "string",
            "description": "Language to dub into; any language the speech model speaks",
            "default": "en"
          },
          "translator": {
            "type": [
              "string",
              "null"
            ],
            "description": "nllb-1.3b (better), nllb-600m (faster) or null for the best one installed",
            "enum": [
              "nllb-1.3b",
              "nllb-600m",
              null
            ]
          },
          "review": {
            "type": "boolean",
            "description": "Stop after the translation so the user can edit it",
            "default": false
          },
          "expressiveness": {
            "type": "number",
            "description": "Sampling freedom (0.1-1.5)",
            "minimum": 0.1,
            "maximum": 1.5,
            "default": 0.8
          },
          "voice_match": {
            "type": "number",
            "description": "RVC index rate (0-1); 0 skips RVC",
            "minimum": 0,
            "maximum": 1,
            "default": 1
          },
          "quality": {
            "type": "string",
            "description": "best (32 decoding steps) or fast (16 steps)",
            "enum": [
              "best",
              "fast"
            ],
            "default": "best"
          },
          "speed": {
            "type": "number",
            "description": "Speaking speed (0.8-1.3), clamped",
            "minimum": 0.8,
            "maximum": 1.3,
            "default": 1
          },
          "accent": {
            "type": "string",
            "description": "own (the voice's reference) or native-us (a native US speaker, converted to the voice's timbre); applies to English speech",
            "enum": [
              "own",
              "native-us"
            ],
            "default": "own"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker for native-us: auto picks by pitch",
            "enum": [
              "auto",
              "male",
              "female"
            ],
            "default": "auto"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the saved result",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ],
            "default": "wav"
          },
          "output": {
            "type": "string",
            "description": "audio, or video (needs a source with a picture track)",
            "enum": [
              "audio",
              "video"
            ],
            "default": "audio"
          },
          "keep_background": {
            "type": "boolean",
            "description": "Keep the original music and sounds under the new voice (default true with output video, else false)"
          },
          "subtitles": {
            "type": "boolean",
            "description": "With output video: burn the spoken text into the picture, timed to the new voice, and add it as a subtitle track",
            "default": false
          },
          "subtitle_position": {
            "type": "string",
            "description": "Where burned subtitles go",
            "enum": [
              "bottom",
              "top"
            ],
            "default": "bottom"
          },
          "timing": {
            "type": "string",
            "description": "keep fits clips into the original timing; natural speaks at the user's pace",
            "enum": [
              "keep",
              "natural"
            ],
            "default": "keep"
          },
          "model": {
            "type": "string",
            "description": "Voice-cloning model, as for tts.generate: auto, or an installed one in hello speech_models (omnivoice, voxcpm, chatterbox) that speaks target_language",
            "default": "auto"
          }
        },
        "required": [
          "path",
          "voice_id"
        ]
      },
      "result": {
        "type": "object",
        "description": "The job id; for a speaking job also the accent and reference fields",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "redub.prepare",
      "summary": "Warm up transcription for a dropped file",
      "description": "Starts the speech worker and loads Whisper in the background (and optionally separates voice and background); answers at once and later emits redub.prepared when warming. Errors: not_found, bad_request.",
      "job": false,
      "events": [
        "redub.prepared"
      ],
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the media file"
          },
          "separate": {
            "type": "boolean",
            "description": "Also split voice and background (default: the file has a picture track and the model is installed)"
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "warming": {
            "type": "boolean",
            "description": "Whisper is being loaded; redub.prepared follows"
          },
          "separating": {
            "type": "boolean",
            "description": "Voice and background are being separated"
          },
          "reason": {
            "type": "string",
            "description": "Why nothing is warmed",
            "enum": [
              "unavailable",
              "paused",
              "busy"
            ]
          }
        },
        "required": [
          "warming",
          "separating"
        ]
      }
    },
    {
      "name": "redub.probe",
      "summary": "Probe a media file for Redub",
      "description": "Reads duration and tracks of an audio or video file and decodes a 44.1 kHz WAV preview. Errors: not_found, bad_request (not a readable media file), not_ready (no ffprobe).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the media file"
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "duration_s": {
            "type": "number",
            "description": "Duration, seconds"
          },
          "sample_rate": {
            "type": "integer",
            "description": "Sample rate (0 without audio)"
          },
          "channels": {
            "type": "integer",
            "description": "Channels (0 without audio)"
          },
          "has_audio": {
            "type": "boolean",
            "description": "The file has an audio track"
          },
          "has_video": {
            "type": "boolean",
            "description": "The file has a picture track (cover art does not count)"
          },
          "format": {
            "type": "string",
            "description": "Extension-style format name"
          },
          "preview_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mono 16-bit 44.1 kHz WAV of the source; null without audio"
          }
        },
        "required": [
          "duration_s",
          "has_audio",
          "has_video"
        ]
      }
    },
    {
      "name": "redub.render",
      "summary": "Convert, re-speak or subtitle a file",
      "description": "convert runs the voice's RVC model over the source (trained voice only); respeak speaks the given segments at their times; subtitles burns the given segments into the picture (for a sound file a black one, or the images) with the original sound, no voice. Ends with redub.done or redub.error. Errors at start: bad_request, not_found, not_ready, busy.",
      "job": true,
      "events": [
        "redub.progress",
        "redub.done",
        "redub.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice to use (convert, respeak; ignored by subtitles)"
          },
          "path": {
            "type": "string",
            "description": "Absolute path of the media file"
          },
          "mode": {
            "type": "string",
            "description": "convert, respeak or subtitles",
            "enum": [
              "convert",
              "respeak",
              "subtitles"
            ]
          },
          "segments": {
            "type": "array",
            "description": "Segments to speak (respeak) or to show (subtitles); at most 5000",
            "items": {
              "type": "object",
              "properties": {
                "start": {
                  "type": "number",
                  "description": "Start, seconds"
                },
                "end": {
                  "type": "number",
                  "description": "End, seconds"
                },
                "text": {
                  "type": "string",
                  "description": "Text to speak"
                },
                "words": {
                  "type": "array",
                  "description": "Whisper's words of the line, [start, end, word] in seconds (from redub.transcript): subtitles are timed by them, also after the text was edited",
                  "items": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 3,
                    "maxItems": 3
                  }
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ]
            }
          },
          "language": {
            "type": "string",
            "description": "Language of the transcript (respeak, subtitles)"
          },
          "translated": {
            "type": "boolean",
            "description": "Segment texts are translations into target_language",
            "default": false
          },
          "target_language": {
            "type": "string",
            "description": "Language the translated segments are spoken in",
            "default": "en"
          },
          "expressiveness": {
            "type": "number",
            "description": "Sampling freedom (0.1-1.5), respeak only",
            "minimum": 0.1,
            "maximum": 1.5,
            "default": 0.8
          },
          "voice_match": {
            "type": "number",
            "description": "RVC index rate (0-1); 0 skips RVC",
            "minimum": 0,
            "maximum": 1,
            "default": 1
          },
          "quality": {
            "type": "string",
            "description": "best (32 decoding steps) or fast (16 steps)",
            "enum": [
              "best",
              "fast"
            ],
            "default": "best"
          },
          "speed": {
            "type": "number",
            "description": "Speaking speed (0.8-1.3), clamped",
            "minimum": 0.8,
            "maximum": 1.3,
            "default": 1
          },
          "accent": {
            "type": "string",
            "description": "own (the voice's reference) or native-us (a native US speaker, converted to the voice's timbre); applies to English speech",
            "enum": [
              "own",
              "native-us"
            ],
            "default": "own"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker for native-us: auto picks by pitch",
            "enum": [
              "auto",
              "male",
              "female"
            ],
            "default": "auto"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the saved result",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ],
            "default": "wav"
          },
          "output": {
            "type": "string",
            "description": "audio, or video (needs a source with a picture track)",
            "enum": [
              "audio",
              "video"
            ],
            "default": "audio"
          },
          "keep_background": {
            "type": "boolean",
            "description": "Keep the original music and sounds under the new voice (default true with output video, else false)"
          },
          "subtitles": {
            "type": "boolean",
            "description": "With output video: burn the spoken text into the picture, timed to the new voice, and add it as a subtitle track",
            "default": false
          },
          "subtitle_position": {
            "type": "string",
            "description": "Where burned subtitles go (output video, or mode subtitles)",
            "enum": [
              "bottom",
              "top"
            ],
            "default": "bottom"
          },
          "images": {
            "type": "array",
            "description": "Mode subtitles: pictures shown over the sound, in place of black for a sound file or of a video's own picture; empty or absent: black, or the video's picture",
            "items": {
              "type": "object",
              "description": "A picture",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Absolute path of the picture"
                },
                "start": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Seconds; give it to every picture (the first 0, ascending) or to none (evenly spaced)"
                }
              },
              "required": [
                "path"
              ]
            }
          },
          "picture": {
            "type": "string",
            "enum": [
              "own",
              "black"
            ],
            "default": "own",
            "description": "Mode subtitles, without images: a video's picture, its own or black"
          },
          "transitions": {
            "type": "boolean",
            "default": false,
            "description": "The pictures fade in from black and into each other, over 0.6 s each"
          },
          "timing": {
            "type": "string",
            "description": "keep fits clips into the original timing; natural speaks at the user's pace",
            "enum": [
              "keep",
              "natural"
            ],
            "default": "keep"
          },
          "result_mode": {
            "type": "string",
            "description": "dub records a respeak as a dub in the result sidecar",
            "enum": [
              "dub"
            ]
          },
          "model": {
            "type": "string",
            "description": "Voice-cloning model, as for tts.generate: auto, or an installed one in hello speech_models (omnivoice, voxcpm, chatterbox) that speaks the language (respeak)",
            "default": "auto"
          }
        },
        "required": [
          "path",
          "mode"
        ]
      },
      "result": {
        "type": "object",
        "description": "The job id; for a speaking job also the accent and reference fields",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "redub.transcribe",
      "summary": "Transcribe a file, optionally translating it",
      "description": "Transcribes the speech in its own language with Whisper turbo and optionally translates every segment with NLLB; ends with redub.transcript or redub.error. Errors at start: bad_request, not_found, not_ready, busy.",
      "job": true,
      "events": [
        "redub.progress",
        "redub.transcript",
        "redub.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the media file"
          },
          "language": {
            "type": "string",
            "description": "auto or a two/three letter language code of the speech",
            "default": "auto"
          },
          "translate_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language code to translate every segment to; null does not translate",
            "default": null
          },
          "translate_to_en": {
            "type": "boolean",
            "description": "Old spelling of translate_to: \"en\""
          },
          "translator": {
            "type": [
              "string",
              "null"
            ],
            "description": "nllb-1.3b (better), nllb-600m (faster) or null for the best one installed",
            "enum": [
              "nllb-1.3b",
              "nllb-600m",
              null
            ]
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "text.analyze",
      "summary": "Analyse a user's own reading text",
      "description": "Detects or takes the language, estimates reading time, measures phoneme coverage and splits the text into parts of about 60-90 s. An unsupported language code is bad_request.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Text to read"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language code; omitted, null or \"auto\" detects it"
          }
        },
        "required": [
          "text"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "language_detected": {
            "type": "boolean",
            "description": "The language was detected"
          },
          "phonemes_total": {
            "type": "integer",
            "description": "Phonemes in the language inventory"
          },
          "words": {
            "type": "integer",
            "description": "Word count"
          },
          "unit": {
            "type": "string",
            "description": "What words counts: letters in a language written without spaces",
            "enum": [
              "words",
              "characters"
            ]
          },
          "est_minutes": {
            "type": "number",
            "description": "Estimated reading minutes"
          },
          "phoneme_coverage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Share of the inventory the text contains; null for a language without one",
            "minimum": 0,
            "maximum": 1
          },
          "missing_phonemes": {
            "type": "array",
            "description": "Missing phonemes in inventory order",
            "items": {
              "type": "string",
              "description": "Phoneme symbol"
            }
          },
          "level": {
            "type": "string",
            "description": "What the text is good for",
            "enum": [
              "too_short",
              "zero_shot",
              "trainable",
              "great"
            ]
          },
          "message": {
            "type": "string",
            "description": "Plain-language message"
          },
          "parts": {
            "type": "array",
            "description": "Parts to read",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Part index (from 1)"
                },
                "title": {
                  "type": "string",
                  "description": "Part title in the preset language"
                },
                "text": {
                  "type": "string",
                  "description": "Text to read"
                },
                "est_seconds": {
                  "type": "number",
                  "description": "Estimated reading time, seconds"
                }
              },
              "required": [
                "index",
                "title",
                "text",
                "est_seconds"
              ]
            }
          }
        },
        "required": [
          "language",
          "language_detected",
          "phonemes_total",
          "words",
          "est_minutes",
          "phoneme_coverage",
          "missing_phonemes",
          "level",
          "message",
          "parts"
        ]
      }
    },
    {
      "name": "text.import",
      "summary": "Read a document into chapters",
      "description": "Reads a text document (txt, md, html, epub, docx, odt, rtf, fb2, pdf text layer, srt, vtt) and returns clean chapter texts, a suggested split and file metadata. Errors: bad_request (unsupported, damaged, DRM or scanned file, no text, over 300 MB), not_ready (pypdf missing).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the document"
          },
          "language": {
            "type": "string",
            "description": "auto (detect) or a language code",
            "default": "auto"
          },
          "split": {
            "type": "string",
            "description": "auto applies the suggested split to chapters; any other value is bad_request",
            "enum": [
              "auto"
            ]
          }
        },
        "required": [
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The document"
          },
          "name": {
            "type": "string",
            "description": "File name"
          },
          "format": {
            "type": "string",
            "description": "Format id"
          },
          "format_label": {
            "type": "string",
            "description": "Format display name"
          },
          "title": {
            "type": "string",
            "description": "Document title"
          },
          "encoding": {
            "type": [
              "string",
              "null"
            ],
            "description": "Text encoding used (plain text)"
          },
          "language": {
            "type": "string",
            "description": "Detected or given language code"
          },
          "language_detected": {
            "type": [
              "string",
              "boolean",
              "null"
            ],
            "description": "Detection result"
          },
          "words": {
            "type": "integer",
            "description": "Words"
          },
          "chars": {
            "type": "integer",
            "description": "Characters"
          },
          "est_s": {
            "type": "number",
            "description": "Reading time at speed 1.0, seconds"
          },
          "chapters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "Chapter title"
                },
                "text": {
                  "type": "string",
                  "description": "Clean chapter text"
                },
                "words": {
                  "type": "integer",
                  "description": "Words"
                },
                "chars": {
                  "type": "integer",
                  "description": "Characters"
                },
                "est_s": {
                  "type": "number",
                  "description": "Reading time, seconds"
                }
              }
            }
          },
          "parts": {
            "type": [
              "object",
              "null"
            ],
            "description": "Suggested split of chapters longer than 4,000 words, else null",
            "properties": {
              "how": {
                "type": "string",
                "description": "Rule used",
                "enum": [
                  "headings",
                  "breaks",
                  "length",
                  "mixed"
                ]
              },
              "chapters": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "The chapters after the split"
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "meta": {
            "type": "object",
            "description": "What the file says about itself",
            "properties": {
              "authors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Description as plain text"
              },
              "language_tag": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Language as written in the file"
              },
              "date": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Date as written (EPUB, FB2)"
              },
              "cover": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Cover image written to the engine tmp folder",
                "properties": {
                  "path": {
                    "type": "string",
                    "description": "Absolute path of the cover image"
                  },
                  "media_type": {
                    "type": "string",
                    "description": "Image type",
                    "enum": [
                      "image/jpeg",
                      "image/png",
                      "image/gif",
                      "image/webp"
                    ]
                  }
                }
              }
            }
          }
        },
        "required": [
          "path",
          "chapters"
        ]
      }
    },
    {
      "name": "text.stress",
      "summary": "Show Ukrainian word stress as HolosTTS speaks it",
      "description": "Returns the text with U+0301 after each stressed vowel (numbers and abbreviations spelled out) and the words of two or more syllables that got no stress. not_ready without the ukrainian component; bad_request for an empty text or more than 200,000 characters.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Ukrainian text (at most 200,000 characters)",
            "maxLength": 200000
          }
        },
        "required": [
          "text"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "stressed": {
            "type": "string",
            "description": "The text with U+0301 after each stressed vowel"
          },
          "unsure": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Words of two or more syllables that got no stress"
          }
        },
        "required": [
          "stressed",
          "unsure"
        ]
      }
    },
    {
      "name": "train.cancel",
      "summary": "Cancel a training or discard a paused run",
      "description": "With job: cancels a running training (its checkpoints are discarded; the job ends with train.error cancelled). With voice_id instead: discards the paused run of that voice; busy when that voice is training right now.",
      "job": false,
      "params": {
        "type": "object",
        "description": "Send either job or voice_id",
        "properties": {
          "job": {
            "type": "string",
            "description": "Running training job to cancel"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice whose paused run is discarded"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "train.pause",
      "summary": "Pause a running training at a checkpoint",
      "description": "Answers {pausing:true} at once; the job ends with train.paused once a checkpoint is safely on disk (or train.done in the last epoch). Only in the train stage: not_ready before that, not_found for an unknown or finished job.",
      "job": true,
      "events": [
        "train.paused",
        "train.done"
      ],
      "params": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "The training job id"
          }
        },
        "required": [
          "job"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "pausing": {
            "type": "boolean",
            "description": "Always true"
          }
        },
        "required": [
          "pausing"
        ]
      }
    },
    {
      "name": "train.resume",
      "summary": "Resume a paused or interrupted training",
      "description": "Hands the GPU over again and continues from the saved checkpoint epoch, answering {job} at once; progress comes as train.* events. Errors: not_found, bad_request (no paused run, or the recordings changed since the pause), not_ready, busy.",
      "job": true,
      "events": [
        "train.progress",
        "train.done",
        "train.error",
        "train.paused"
      ],
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice with a paused training"
          }
        },
        "required": [
          "voice_id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id (job-1, job-2, ...) carried by the job events"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "train.start",
      "summary": "Start training a voice model",
      "description": "Starts an RVC training of the voice (needs at least 1 minute of dataset) and answers {job} at once; progress comes as train.* events. The speech models are handed over to training until it ends. Errors: bad_request, not_found, not_ready, busy (a training or generation is running), paused (a paused run exists and restart is not true).",
      "job": true,
      "events": [
        "train.progress",
        "train.done",
        "train.error",
        "train.paused"
      ],
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice to train"
          },
          "epochs": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Epochs 1..2000; null = auto (recommended_epochs of the dataset minutes)",
            "minimum": 1,
            "maximum": 2000,
            "default": null
          },
          "restart": {
            "type": "boolean",
            "description": "Discard a paused run of this voice and start from scratch",
            "default": false
          }
        },
        "required": [
          "voice_id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id (job-1, job-2, ...) carried by the job events"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "tts.cancel",
      "summary": "Cancel a speech generation",
      "description": "Cancels the generation job; it ends with tts.error code cancelled.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "The generation job id"
          }
        },
        "required": [
          "job"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "tts.generate",
      "summary": "Generate speech from text with a voice",
      "description": "Cuts the text into segments and answers {job, segments, segment_chars} at once; audio arrives as tts.chunk events, then tts.done or tts.error. Only one generation at a time (busy). Errors: bad_request, not_found (voice or its reference.wav), not_ready (models not ready, or output_format cannot be written), busy, no_memory.",
      "job": true,
      "events": [
        "tts.chunk",
        "tts.done",
        "tts.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Voice to speak with"
          },
          "text": {
            "type": "string",
            "description": "Text to speak (non-empty)"
          },
          "expressiveness": {
            "type": "number",
            "description": "Sampling freedom 0.1-1.5; out-of-range values are clamped",
            "minimum": 0.1,
            "maximum": 1.5,
            "default": 0.8
          },
          "voice_match": {
            "type": "number",
            "description": "RVC index rate 0-1 (capped at 0.3 in other languages than the voice language); 0 skips RVC",
            "minimum": 0,
            "maximum": 1,
            "default": 1
          },
          "quality": {
            "type": "string",
            "description": "best (32 decoding steps) or fast (16 steps)",
            "enum": [
              "best",
              "fast"
            ],
            "default": "best"
          },
          "speed": {
            "type": "number",
            "description": "Speaking speed 0.8-1.3 relative to the reference clip; clamped",
            "minimum": 0.8,
            "maximum": 1.3,
            "default": 1
          },
          "language": {
            "type": "string",
            "description": "ISO 639-1 language of the text",
            "default": "en"
          },
          "output_format": {
            "type": "string",
            "description": "Format the finished result is saved in",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ],
            "default": "wav"
          },
          "accent": {
            "type": "string",
            "description": "own: the voice reference; native-us: native American English accent in the user timbre",
            "enum": [
              "own",
              "native-us"
            ],
            "default": "own"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker for native-us",
            "enum": [
              "auto",
              "male",
              "female"
            ],
            "default": "auto"
          },
          "exact_stress": {
            "type": "boolean",
            "description": "false speaks Ukrainian with OmniVoice even when HolosTTS is installed",
            "default": true
          },
          "model": {
            "type": "string",
            "description": "Voice-cloning model: auto (OmniVoice, or an installed model for a language OmniVoice does not speak), or the id of an installed one in hello speech_models (omnivoice, voxcpm, chatterbox)",
            "default": "auto"
          }
        },
        "required": [
          "voice_id",
          "text"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          },
          "segments": {
            "type": "integer",
            "description": "Number of text segments"
          },
          "segment_chars": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Characters per segment, to estimate remaining speech"
          },
          "model": {
            "type": "string",
            "description": "The model that spoke",
            "enum": [
              "omnivoice",
              "voxcpm",
              "chatterbox",
              "holos"
            ]
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "Converter used with native-us",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us was asked but not used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user on why native-us was not used"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when the speaking clip is known to be in another language than the text"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user about the carried-over accent"
          }
        },
        "required": [
          "job",
          "segments",
          "segment_chars"
        ]
      }
    },
    {
      "name": "tts.languages",
      "summary": "List the languages the speech model speaks",
      "description": "Returns the same language list as hello: common languages first, then the rest by English name.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "languages": {
            "type": "array",
            "description": "Speech languages",
            "items": {
              "type": "object",
              "description": "A language the speech model speaks",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "ISO 639-1 code"
                },
                "name": {
                  "type": "string",
                  "description": "Name in English"
                },
                "native": {
                  "type": "string",
                  "description": "Name in the language itself"
                },
                "common": {
                  "type": "boolean",
                  "description": "A common language (listed first)"
                }
              },
              "required": [
                "code",
                "name",
                "native"
              ]
            }
          }
        },
        "required": [
          "languages"
        ]
      }
    },
    {
      "name": "video.cancel",
      "summary": "Cancel a video export",
      "description": "Stops the video export job (without job: the one running); it ends with video.error code cancelled.",
      "job": false,
      "events": [
        "video.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "cancelled": {
            "type": "boolean",
            "description": "False when no such export runs"
          }
        },
        "required": [
          "cancelled"
        ]
      }
    },
    {
      "name": "video.export",
      "summary": "Export a result as a video",
      "description": "Starts a job that makes an MP4, MKV, WebM or MOV video of a result, or of several sound files joined in order (parts, such as a book's chapters, each with its own picture and subtitle lines): the audio over black or over pictures (evenly spaced, from given starts, or from each part's start), or the video of a Redub result copied, remuxed or re-encoded; subtitles from given segments, a segment file, the sidecar's recorded segments or estimated from its text can be drawn in. H.264 uses a hardware encoder when one works on this machine. Answers {job} at once and reports through video.* events; video.done tells where each part starts. Errors at start: bad_request (format, dest, subtitles, images, starts, parts, segments, a part with a picture), not_found (path, a part, a picture, a segment file or the sidecar), not_ready (no ffmpeg or no encoder for the format), busy (another video export runs).",
      "job": true,
      "events": [
        "video.progress",
        "video.done",
        "video.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the result: its audio, or the video of a Redub result; give path or parts"
          },
          "parts": {
            "type": "array",
            "description": "Sound files joined in order into one video, in place of path",
            "items": {
              "type": "object",
              "description": "A sound file of the video",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Absolute path of the sound file"
                },
                "segments": {
                  "type": "array",
                  "description": "Subtitle lines in seconds of the part; win over its segments_path and sidecar",
                  "items": {
                    "type": "object",
                    "description": "A subtitle line",
                    "properties": {
                      "start": {
                        "type": "number",
                        "description": "Seconds"
                      },
                      "end": {
                        "type": "number",
                        "description": "Seconds"
                      },
                      "text": {
                        "type": "string",
                        "description": "The words"
                      }
                    },
                    "required": [
                      "start",
                      "end",
                      "text"
                    ]
                  }
                },
                "segments_path": {
                  "type": "string",
                  "description": "A book's segment file or a .result.json with segments, in seconds of the part"
                },
                "image": {
                  "type": "string",
                  "description": "Absolute path of the picture shown from the part's start until the next picture"
                }
              },
              "required": [
                "path"
              ]
            }
          },
          "dest": {
            "type": "string",
            "description": "Absolute path of the video to write; its extension is the format's"
          },
          "format": {
            "type": "string",
            "description": "Container",
            "enum": [
              "mp4",
              "mkv",
              "webm",
              "mov"
            ]
          },
          "subtitles": {
            "type": [
              "object",
              "null"
            ],
            "description": "null: no subtitles; else drawn into the picture",
            "properties": {
              "position": {
                "type": "string",
                "enum": [
                  "bottom",
                  "top"
                ],
                "default": "bottom",
                "description": "Where they are drawn"
              }
            }
          },
          "images": {
            "type": "array",
            "description": "Pictures shown over the audio; empty or absent: black (with parts: merged with the parts' pictures by time)",
            "items": {
              "type": "object",
              "description": "A picture",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Absolute path of the picture"
                },
                "start": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Seconds; give it to every picture (the first 0, unless with parts, ascending) or to none (evenly spaced)"
                }
              },
              "required": [
                "path"
              ]
            }
          },
          "transitions": {
            "type": "boolean",
            "default": false,
            "description": "The pictures fade in from black and into each other, over 0.6 s each"
          },
          "sidecar": {
            "type": "string",
            "description": "Sidecar with the text (a Design take's take.json); default <name>.result.json next to path"
          },
          "segments": {
            "type": "array",
            "description": "Subtitle lines in seconds of the file; win over segments_path and the sidecar",
            "items": {
              "type": "object",
              "description": "A subtitle line",
              "properties": {
                "start": {
                  "type": "number",
                  "description": "Seconds"
                },
                "end": {
                  "type": "number",
                  "description": "Seconds"
                },
                "text": {
                  "type": "string",
                  "description": "The words"
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ]
            }
          },
          "segments_path": {
            "type": "string",
            "description": "A book's segment file or a .result.json with segments; with path only"
          }
        },
        "required": [
          "dest",
          "format"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          }
        },
        "required": [
          "job"
        ]
      }
    },
    {
      "name": "subtitles.export",
      "summary": "Save timed lines as a subtitle file",
      "description": "Writes SRT, WebVTT or SBV (YouTube's own format) to dest, in UTF-8, with the cues of a burned video: sentences of at most two lines of 42 characters, never overlapping. The lines come from segments, segments_path, or a result file's sidecar (its segments, else its text laid over the speech, as video.export does); an existing dest is replaced. Errors: bad_request (format, dest, segments, no lines or none with a length), not_found (path, segments_path or sidecar missing).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "description": "Subtitle format; dest ends in .<format>",
            "enum": [
              "srt",
              "vtt",
              "sbv"
            ]
          },
          "dest": {
            "type": "string",
            "description": "Absolute path of the file to write, ending in .<format>"
          },
          "segments": {
            "type": "array",
            "description": "Timed lines, such as a redub.transcribe transcript; win over segments_path and path",
            "items": {
              "type": "object",
              "description": "A subtitle line",
              "properties": {
                "start": {
                  "type": "number",
                  "description": "Seconds"
                },
                "end": {
                  "type": "number",
                  "description": "Seconds"
                },
                "text": {
                  "type": "string",
                  "description": "The words"
                },
                "words": {
                  "type": "array",
                  "description": "Whisper's words of the line, [start, end, word] in seconds (from redub.transcript): subtitles are timed by them, also after the text was edited",
                  "items": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 3,
                    "maxItems": 3
                  }
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ]
            }
          },
          "segments_path": {
            "type": "string",
            "description": "A book's segment file or any JSON object with a segments list, such as a .result.json"
          },
          "path": {
            "type": "string",
            "description": "A result file (a Speak take, a Redub result, a book chapter): the lines of its sidecar"
          },
          "sidecar": {
            "type": "string",
            "description": "With path: the sidecar to read instead of <name>.result.json (a Design take's take.json)"
          }
        },
        "required": [
          "format",
          "dest"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the written file"
          },
          "cues": {
            "type": "integer",
            "description": "Subtitles written"
          },
          "source": {
            "type": "string",
            "description": "Where the lines came from",
            "enum": [
              "given",
              "recorded",
              "estimated"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "description": "Size of the written file in bytes"
          }
        },
        "required": [
          "path",
          "cues",
          "source",
          "size_bytes"
        ]
      }
    },
    {
      "name": "voices.add_reference",
      "summary": "Add a reference clip for another language",
      "description": "Cleans, trims and normalises an audio file and stores it as reference_<language>.wav (replacing an existing one) for speech in that language. Needs 3-40 s of speech. Errors: bad_request, not_found (voice or file), busy.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "language": {
            "type": "string",
            "description": "A language the speech model speaks (ISO 639-1)"
          },
          "path": {
            "type": "string",
            "description": "Absolute path of any importable audio file"
          }
        },
        "required": [
          "id",
          "language",
          "path"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "duration_s": {
            "type": "number",
            "description": "Clip length after trimming, seconds"
          },
          "references": {
            "type": "array",
            "description": "Languages with their own reference clip",
            "items": {
              "type": "string",
              "description": "Language code"
            }
          }
        },
        "required": [
          "language",
          "duration_s",
          "references"
        ]
      }
    },
    {
      "name": "voices.clear_media",
      "summary": "Delete a voice's media pool",
      "description": "Deletes reference_media.wav and the pool in meta.json; references already cut from it stay. Errors: not_found (voice), busy (a media job runs for this voice).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "voices.create",
      "summary": "Create an empty voice",
      "description": "Creates a voice with no dataset and no reference. An unsupported language is bad_request.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Voice name (trimmed to 80 characters)"
          },
          "preset": {
            "type": "string",
            "description": "Preset id the voice is recorded with",
            "enum": [
              "quick",
              "standard",
              "pro"
            ]
          },
          "language": {
            "type": "string",
            "description": "Recording language (ISO 639-1, any case, region allowed); \"auto\" means \"en\"",
            "default": "en"
          }
        },
        "required": [
          "name"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "object",
            "description": "A voice as in voices.list",
            "properties": {
              "id": {
                "type": "string",
                "description": "Voice id"
              },
              "name": {
                "type": "string",
                "description": "Voice name (at most 80 characters)"
              },
              "created": {
                "type": "string",
                "description": "Creation time, UTC ISO 8601 (...Z)",
                "format": "date-time"
              },
              "preset": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Preset id the voice was recorded with, or null"
              },
              "language": {
                "type": "string",
                "description": "Recording language (ISO 639-1); \"en\" for voices made before languages existed"
              },
              "dataset_minutes": {
                "type": "number",
                "description": "Minutes of recorded dataset"
              },
              "parts": {
                "type": "integer",
                "description": "Number of recorded parts"
              },
              "trained": {
                "type": "boolean",
                "description": "The voice has an RVC model"
              },
              "trained_epochs": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Epochs trained; null without an RVC model or when unknown"
              },
              "trained_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Local time without zone of the training; null without an RVC model"
              },
              "training_paused": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "A paused or interrupted training of this voice, or null",
                "properties": {
                  "epoch": {
                    "type": "integer",
                    "description": "Epoch of the saved checkpoint where train.resume continues"
                  },
                  "total_epochs": {
                    "type": "integer",
                    "description": "Total epochs of the run"
                  },
                  "paused_at": {
                    "type": "string",
                    "description": "When it was paused"
                  },
                  "interrupted": {
                    "type": "boolean",
                    "description": "Interrupted by a closed or crashed app"
                  }
                }
              },
              "references": {
                "type": "array",
                "description": "Languages with their own reference clip (reference_<lang>.wav)",
                "items": {
                  "type": "string",
                  "description": "Language code"
                }
              },
              "reference_language": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Language detected in reference.wav; null until transcribed"
              },
              "reference_languages": {
                "type": "object",
                "description": "Detected language of every reference_<lang>.wav, {lang: detected or null}",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            "required": [
              "id",
              "name",
              "created",
              "language"
            ]
          }
        },
        "required": [
          "voice"
        ]
      }
    },
    {
      "name": "voices.delete",
      "summary": "Delete a voice",
      "description": "Removes the whole voice folder. not_found for an unknown id.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "voices.export",
      "summary": "Export a voice bundle",
      "description": "Writes a voice bundle (a stored zip with a manifest) to dest or to <data>/tmp/export/<id>-<sha256[:12]>.mimvoice. The archive hash depends only on the voice content. Errors: not_found (voice), bad_request (no reference.wav yet, dest relative or a folder, a file over the import limits).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "dest": {
            "type": "string",
            "description": "Absolute file path for the archive (replaced when it exists)"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Archive path"
          },
          "sha256": {
            "type": "string",
            "description": "SHA-256 of the archive file"
          },
          "bytes": {
            "type": "integer",
            "description": "Archive size in bytes"
          },
          "files": {
            "type": "array",
            "description": "Voice files in the archive",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Path inside the voice folder"
                },
                "bytes": {
                  "type": "integer",
                  "description": "Size in bytes"
                },
                "sha256": {
                  "type": "string",
                  "description": "SHA-256"
                }
              },
              "required": [
                "path",
                "bytes",
                "sha256"
              ]
            }
          },
          "engine": {
            "type": "string",
            "description": "Engine version"
          }
        },
        "required": [
          "path",
          "sha256",
          "bytes",
          "files",
          "engine"
        ]
      }
    },
    {
      "name": "voices.import",
      "summary": "Import a voice from files or a bundle",
      "description": "Creates a voice from existing recordings, a reference clip and/or an RVC model (no retraining), or from a voice bundle given as bundle (not combinable with the paths). Needs reference_path or dataset_dir; rvc_index needs rvc_model. Errors: bad_request, not_found; a half-made voice is removed on failure.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Voice name; with bundle it renames the imported voice"
          },
          "reference_path": {
            "type": "string",
            "description": "Absolute path of a reference clip (any importable format), used as it is"
          },
          "dataset_dir": {
            "type": "string",
            "description": "Absolute folder with part<N>.<ext> files, each added through dataset.add"
          },
          "rvc_model": {
            "type": "string",
            "description": "Absolute path of an RVC v1/v2 or Applio voice model (.pth)"
          },
          "rvc_index": {
            "type": "string",
            "description": "Absolute path of the RVC index; needs rvc_model"
          },
          "preset": {
            "type": "string",
            "description": "Preset id",
            "enum": [
              "quick",
              "standard",
              "pro"
            ]
          },
          "language": {
            "type": "string",
            "description": "Recording language (ISO 639-1)"
          },
          "book": {
            "type": "string",
            "description": "The book this voice was made for (Book's character voices)"
          },
          "book_role": {
            "type": "string",
            "description": "Its role in that book: narrator, men or women"
          },
          "bundle": {
            "type": "string",
            "description": "Absolute path of a voice bundle (.mimvoice) to import instead of the paths"
          },
          "into": {
            "type": "string",
            "description": "A voice whose reference is replaced, keeping its id"
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "object",
            "description": "A voice as in voices.list",
            "properties": {
              "id": {
                "type": "string",
                "description": "Voice id"
              },
              "name": {
                "type": "string",
                "description": "Voice name (at most 80 characters)"
              },
              "created": {
                "type": "string",
                "description": "Creation time, UTC ISO 8601 (...Z)",
                "format": "date-time"
              },
              "preset": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Preset id the voice was recorded with, or null"
              },
              "language": {
                "type": "string",
                "description": "Recording language (ISO 639-1); \"en\" for voices made before languages existed"
              },
              "dataset_minutes": {
                "type": "number",
                "description": "Minutes of recorded dataset"
              },
              "parts": {
                "type": "integer",
                "description": "Number of recorded parts"
              },
              "trained": {
                "type": "boolean",
                "description": "The voice has an RVC model"
              },
              "trained_epochs": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Epochs trained; null without an RVC model or when unknown"
              },
              "trained_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Local time without zone of the training; null without an RVC model"
              },
              "training_paused": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "A paused or interrupted training of this voice, or null",
                "properties": {
                  "epoch": {
                    "type": "integer",
                    "description": "Epoch of the saved checkpoint where train.resume continues"
                  },
                  "total_epochs": {
                    "type": "integer",
                    "description": "Total epochs of the run"
                  },
                  "paused_at": {
                    "type": "string",
                    "description": "When it was paused"
                  },
                  "interrupted": {
                    "type": "boolean",
                    "description": "Interrupted by a closed or crashed app"
                  }
                }
              },
              "references": {
                "type": "array",
                "description": "Languages with their own reference clip (reference_<lang>.wav)",
                "items": {
                  "type": "string",
                  "description": "Language code"
                }
              },
              "reference_language": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Language detected in reference.wav; null until transcribed"
              },
              "reference_languages": {
                "type": "object",
                "description": "Detected language of every reference_<lang>.wav, {lang: detected or null}",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            "required": [
              "id",
              "name",
              "created",
              "language"
            ]
          }
        },
        "required": [
          "voice"
        ]
      }
    },
    {
      "name": "voices.design",
      "summary": "Make a take in a new voice from a description",
      "description": "Speaks text in a new voice made from a description, with no reference clip, and keeps it as a take in <data>/design (the last 40; see voices.design_takes). voices.import with the take's reference as reference_path keeps it as a voice. Ukrainian with exact_stress (and HolosTTS installed) is read again by HolosTTS in the new voice, as Speak reads it. Errors: bad_request (a model that cannot design, a language it does not speak, empty text, OmniVoice terms it does not know), not_ready (the model is not installed or still loading), busy (another generation is running), no_memory.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model that makes the voice; absent or auto: the first installed that speaks the language (OmniVoice before VoxCPM2)",
            "enum": [
              "auto",
              "omnivoice",
              "voxcpm"
            ]
          },
          "language": {
            "type": "string",
            "description": "ISO 639-1 code the model speaks"
          },
          "text": {
            "type": "string",
            "description": "What the new voice says"
          },
          "description": {
            "type": "string",
            "description": "The voice (at most 400 characters): for voxcpm any words; for omnivoice comma-separated terms from gender (male, female), age (child, teenager, young adult, middle-aged, elderly), pitch (very low pitch ... very high pitch), whisper and, for English, an accent (american accent, british accent, ...). Empty lets the model choose.",
            "default": ""
          },
          "exact_stress": {
            "type": "boolean",
            "description": "Ukrainian: HolosTTS reads the text in the new voice with exact word stress",
            "default": true
          },
          "loudness": {
            "type": "number",
            "description": "LUFS every take is brought to (less where a peak would pass -1 dBFS)",
            "minimum": -40,
            "maximum": -10,
            "default": -23
          }
        },
        "required": [
          "language",
          "text"
        ]
      },
      "result": {
        "type": "object",
        "description": "A take: the clip to play and the clip to keep",
        "properties": {
          "id": {
            "type": "string",
            "description": "Take id (its folder name under <data>/design)"
          },
          "path": {
            "type": "string",
            "description": "The WAV to play"
          },
          "reference": {
            "type": "string",
            "description": "The designed voice's WAV: voices.import keeps it as reference_path"
          },
          "duration_s": {
            "type": "number",
            "description": "Length of path in seconds"
          },
          "model": {
            "type": "string",
            "description": "Model that made the voice"
          },
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "description": {
            "type": "string",
            "description": "The description as given"
          },
          "text": {
            "type": "string",
            "description": "What the voice says"
          },
          "exact_stress": {
            "type": "boolean",
            "description": "HolosTTS read path (Ukrainian with exact stress)"
          },
          "created": {
            "type": "string",
            "description": "UTC ISO 8601 (...Z)",
            "format": "date-time"
          },
          "when": {
            "type": "string",
            "description": "Local date and time it was made (YYYY-MM-DD HH:MM:SS)"
          },
          "clear": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whisper heard the text in an OmniVoice take (else after 3 tries the last take is kept); null for VoxCPM2, not checked"
          }
        },
        "required": [
          "id",
          "path",
          "reference",
          "duration_s",
          "model",
          "language",
          "description",
          "text",
          "exact_stress",
          "created",
          "when"
        ]
      }
    },
    {
      "name": "voices.design_cancel",
      "summary": "Stop the take being made",
      "description": "Stops the take voices.design is making; that call then answers cancelled and keeps nothing.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "cancelled": {
            "type": "boolean",
            "description": "False when no take was being made"
          }
        },
        "required": [
          "cancelled"
        ]
      }
    },
    {
      "name": "voices.design_takes",
      "summary": "List the kept design takes",
      "description": "The takes voices.design made, newest first (at most 40).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "takes": {
            "type": "array",
            "description": "Newest first",
            "items": {
              "type": "object",
              "description": "A take: the clip to play and the clip to keep",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Take id (its folder name under <data>/design)"
                },
                "path": {
                  "type": "string",
                  "description": "The WAV to play"
                },
                "reference": {
                  "type": "string",
                  "description": "The designed voice's WAV: voices.import keeps it as reference_path"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Length of path in seconds"
                },
                "model": {
                  "type": "string",
                  "description": "Model that made the voice"
                },
                "language": {
                  "type": "string",
                  "description": "Language code"
                },
                "description": {
                  "type": "string",
                  "description": "The description as given"
                },
                "text": {
                  "type": "string",
                  "description": "What the voice says"
                },
                "exact_stress": {
                  "type": "boolean",
                  "description": "HolosTTS read path (Ukrainian with exact stress)"
                },
                "created": {
                  "type": "string",
                  "description": "UTC ISO 8601 (...Z)",
                  "format": "date-time"
                },
                "when": {
                  "type": "string",
                  "description": "Local date and time it was made (YYYY-MM-DD HH:MM:SS)"
                },
                "clear": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Whisper heard the text in an OmniVoice take (else after 3 tries the last take is kept); null for VoxCPM2, not checked"
                }
              },
              "required": [
                "id",
                "path",
                "reference",
                "duration_s",
                "model",
                "language",
                "description",
                "text",
                "exact_stress",
                "created",
                "when"
              ]
            }
          }
        },
        "required": [
          "takes"
        ]
      }
    },
    {
      "name": "voices.design_delete",
      "summary": "Delete design takes",
      "description": "Deletes one take (id) or every take (all: true) from <data>/design. Voices kept from them stay. Errors: not_found (no such take).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Take id, as in voices.design_takes"
          },
          "all": {
            "type": "boolean",
            "description": "Delete every take",
            "default": false
          }
        }
      },
      "result": {
        "type": "object",
        "properties": {
          "takes": {
            "type": "array",
            "description": "Newest first",
            "items": {
              "type": "object",
              "description": "A take: the clip to play and the clip to keep",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Take id (its folder name under <data>/design)"
                },
                "path": {
                  "type": "string",
                  "description": "The WAV to play"
                },
                "reference": {
                  "type": "string",
                  "description": "The designed voice's WAV: voices.import keeps it as reference_path"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Length of path in seconds"
                },
                "model": {
                  "type": "string",
                  "description": "Model that made the voice"
                },
                "language": {
                  "type": "string",
                  "description": "Language code"
                },
                "description": {
                  "type": "string",
                  "description": "The description as given"
                },
                "text": {
                  "type": "string",
                  "description": "What the voice says"
                },
                "exact_stress": {
                  "type": "boolean",
                  "description": "HolosTTS read path (Ukrainian with exact stress)"
                },
                "created": {
                  "type": "string",
                  "description": "UTC ISO 8601 (...Z)",
                  "format": "date-time"
                },
                "when": {
                  "type": "string",
                  "description": "Local date and time it was made (YYYY-MM-DD HH:MM:SS)"
                },
                "clear": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Whisper heard the text in an OmniVoice take (else after 3 tries the last take is kept); null for VoxCPM2, not checked"
                }
              },
              "required": [
                "id",
                "path",
                "reference",
                "duration_s",
                "model",
                "language",
                "description",
                "text",
                "exact_stress",
                "created",
                "when"
              ]
            }
          }
        },
        "required": [
          "takes"
        ]
      }
    },
    {
      "name": "voices.list",
      "summary": "List voices",
      "description": "Lists every voice, oldest first, with its dataset, training and reference languages.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {
          "voices": {
            "type": "array",
            "description": "Voices, oldest first",
            "items": {
              "type": "object",
              "description": "A voice as in voices.list",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Voice id"
                },
                "name": {
                  "type": "string",
                  "description": "Voice name (at most 80 characters)"
                },
                "created": {
                  "type": "string",
                  "description": "Creation time, UTC ISO 8601 (...Z)",
                  "format": "date-time"
                },
                "preset": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Preset id the voice was recorded with, or null"
                },
                "language": {
                  "type": "string",
                  "description": "Recording language (ISO 639-1); \"en\" for voices made before languages existed"
                },
                "dataset_minutes": {
                  "type": "number",
                  "description": "Minutes of recorded dataset"
                },
                "parts": {
                  "type": "integer",
                  "description": "Number of recorded parts"
                },
                "trained": {
                  "type": "boolean",
                  "description": "The voice has an RVC model"
                },
                "trained_epochs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Epochs trained; null without an RVC model or when unknown"
                },
                "trained_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Local time without zone of the training; null without an RVC model"
                },
                "training_paused": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "A paused or interrupted training of this voice, or null",
                  "properties": {
                    "epoch": {
                      "type": "integer",
                      "description": "Epoch of the saved checkpoint where train.resume continues"
                    },
                    "total_epochs": {
                      "type": "integer",
                      "description": "Total epochs of the run"
                    },
                    "paused_at": {
                      "type": "string",
                      "description": "When it was paused"
                    },
                    "interrupted": {
                      "type": "boolean",
                      "description": "Interrupted by a closed or crashed app"
                    }
                  }
                },
                "references": {
                  "type": "array",
                  "description": "Languages with their own reference clip (reference_<lang>.wav)",
                  "items": {
                    "type": "string",
                    "description": "Language code"
                  }
                },
                "reference_language": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Language detected in reference.wav; null until transcribed"
                },
                "reference_languages": {
                  "type": "object",
                  "description": "Detected language of every reference_<lang>.wav, {lang: detected or null}",
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "name",
                "created",
                "language"
              ]
            }
          }
        },
        "required": [
          "voices"
        ]
      }
    },
    {
      "name": "voices.media_cancel",
      "summary": "Cancel a reference-from-media job",
      "description": "Cancels the job; it ends with voices.media.error cancelled.",
      "job": false,
      "events": [
        "voices.media.error"
      ],
      "params": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          }
        },
        "required": [
          "job"
        ]
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "voices.reference_candidates",
      "summary": "List candidate reference clips",
      "description": "Returns the best 5 windows over all parts (best first, the first recommended) plus the media pool's best windows, with preview WAVs, the current reference and the detected reference language. Errors: bad_request, not_found (voice).",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "description": "Part windows best first, then media pool windows",
            "items": {
              "type": "object",
              "description": "A candidate reference window",
              "properties": {
                "source": {
                  "type": "string",
                  "description": "Where the window comes from",
                  "enum": [
                    "part",
                    "media"
                  ]
                },
                "file": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "1-based file index in the media pool; null for part candidates"
                },
                "part": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Part index; null for media candidates or an unexplained file"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Reading-text title of the part, or the file name for media"
                },
                "start_s": {
                  "type": "number",
                  "description": "Start, seconds"
                },
                "end_s": {
                  "type": "number",
                  "description": "End, seconds"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Length, seconds"
                },
                "rate": {
                  "type": "number",
                  "description": "Syllables per second"
                },
                "pauses": {
                  "type": "number",
                  "description": "Fraction in pauses of 400 ms or more (0.12 or more is many pauses)"
                },
                "snr_db": {
                  "type": "number",
                  "description": "Signal-to-noise ratio, dB"
                },
                "hint": {
                  "type": "string",
                  "description": "Rate compared with the median",
                  "enum": [
                    "natural",
                    "slow",
                    "fast"
                  ]
                },
                "recommended": {
                  "type": "boolean",
                  "description": "The automatic pick"
                },
                "is_current": {
                  "type": "boolean",
                  "description": "This window is the current reference"
                },
                "preview_path": {
                  "type": "string",
                  "description": "Preview WAV path under <data>/tmp/refcand/<id>/"
                }
              }
            }
          },
          "current": {
            "type": [
              "object",
              "null"
            ],
            "description": "reference.wav with the candidate keys plus manual (preview_path is reference.wav itself); null without one"
          },
          "rate_median": {
            "type": "number",
            "description": "Median speaking rate of the voice, syllables per second"
          },
          "media": {
            "type": [
              "object",
              "null"
            ],
            "description": "The media pool, or null without one",
            "properties": {
              "files": {
                "type": "integer",
                "description": "Files in the pool"
              },
              "duration_s": {
                "type": "number",
                "description": "Pool length, seconds"
              },
              "language": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Pool language or null"
              },
              "target": {
                "type": "string",
                "description": "reference.wav or reference_<code>.wav"
              },
              "created": {
                "type": "string",
                "description": "When the pool was made"
              },
              "skipped": {
                "description": "Files skipped when the pool was made"
              }
            }
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Detected language of reference.wav"
          }
        },
        "required": [
          "candidates",
          "current",
          "rate_median",
          "media",
          "reference_language"
        ]
      }
    },
    {
      "name": "voices.reference_from_media",
      "summary": "Build a reference from many media files",
      "description": "Starts a job that cleans and joins many media files of the speaker into a pool and writes its best 8-12 s window to reference.wav or reference_<language>.wav. Answers {job} at once and reports through voices.media.* events; a cancelled or failed job changes nothing. Errors at start: bad_request, not_found (voice), busy (a generation or a media job for this voice runs).",
      "job": true,
      "events": [
        "voices.media.progress",
        "voices.media.done",
        "voices.media.error",
        "voice.warm"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "paths": {
            "type": "array",
            "description": "1 to 500 files of the same speaker",
            "items": {
              "type": "string",
              "description": "Absolute path of an audio or video file"
            }
          },
          "language": {
            "type": "string",
            "description": "Omitted, \"\", \"auto\" or the voice language: reference.wav; another speech language: reference_<language>.wav"
          },
          "remove_music": {
            "type": [
              "boolean",
              "string",
              "null"
            ],
            "enum": [
              true,
              false,
              "auto",
              null
            ],
            "default": "auto",
            "description": "Remove background music: true (every file), false (never) or \"auto\" (null too): video files with an SNR under 35 dB, only on CUDA with no training holding the GPU"
          }
        },
        "required": [
          "id",
          "paths"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "job": {
            "type": "string",
            "description": "Job id"
          },
          "files": {
            "type": "integer",
            "description": "Number of files"
          }
        },
        "required": [
          "job",
          "files"
        ]
      }
    },
    {
      "name": "voices.remove_reference",
      "summary": "Remove a per-language reference clip",
      "description": "Deletes reference_<language>.wav and its sidecar. Errors: bad_request, not_found (voice or no such reference), busy.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "language": {
            "type": "string",
            "description": "Language code of the clip"
          }
        },
        "required": [
          "id",
          "language"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "references": {
            "type": "array",
            "description": "Languages that still have their own reference clip",
            "items": {
              "type": "string",
              "description": "Language code"
            }
          }
        },
        "required": [
          "references"
        ]
      }
    },
    {
      "name": "voices.rename",
      "summary": "Rename a voice or change its language",
      "description": "Renames a voice and/or changes its recording language; at least one of name and language is needed. not_found for an unknown id.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "name": {
            "type": "string",
            "description": "New name (trimmed to 80 characters)"
          },
          "language": {
            "type": "string",
            "description": "New recording language (ISO 639-1)"
          },
          "book_role": {
            "type": "string",
            "enum": [
              "narrator",
              "men",
              "women"
            ],
            "description": "The role a book voice reads"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "object",
            "description": "A voice as in voices.list",
            "properties": {
              "id": {
                "type": "string",
                "description": "Voice id"
              },
              "name": {
                "type": "string",
                "description": "Voice name (at most 80 characters)"
              },
              "created": {
                "type": "string",
                "description": "Creation time, UTC ISO 8601 (...Z)",
                "format": "date-time"
              },
              "preset": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Preset id the voice was recorded with, or null"
              },
              "language": {
                "type": "string",
                "description": "Recording language (ISO 639-1); \"en\" for voices made before languages existed"
              },
              "dataset_minutes": {
                "type": "number",
                "description": "Minutes of recorded dataset"
              },
              "parts": {
                "type": "integer",
                "description": "Number of recorded parts"
              },
              "trained": {
                "type": "boolean",
                "description": "The voice has an RVC model"
              },
              "trained_epochs": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Epochs trained; null without an RVC model or when unknown"
              },
              "trained_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Local time without zone of the training; null without an RVC model"
              },
              "training_paused": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "A paused or interrupted training of this voice, or null",
                "properties": {
                  "epoch": {
                    "type": "integer",
                    "description": "Epoch of the saved checkpoint where train.resume continues"
                  },
                  "total_epochs": {
                    "type": "integer",
                    "description": "Total epochs of the run"
                  },
                  "paused_at": {
                    "type": "string",
                    "description": "When it was paused"
                  },
                  "interrupted": {
                    "type": "boolean",
                    "description": "Interrupted by a closed or crashed app"
                  }
                }
              },
              "references": {
                "type": "array",
                "description": "Languages with their own reference clip (reference_<lang>.wav)",
                "items": {
                  "type": "string",
                  "description": "Language code"
                }
              },
              "reference_language": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Language detected in reference.wav; null until transcribed"
              },
              "reference_languages": {
                "type": "object",
                "description": "Detected language of every reference_<lang>.wav, {lang: detected or null}",
                "additionalProperties": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            "required": [
              "id",
              "name",
              "created",
              "language"
            ]
          }
        },
        "required": [
          "voice"
        ]
      }
    },
    {
      "name": "voices.set_reference",
      "summary": "Pick the reference clip by hand",
      "description": "Cuts a 3-40 s range of a part (or of the media pool with source \"media\") into the reference as a manual choice, drops the conditioning cache and starts voices.warm. Errors: bad_request, not_found (voice, part or media pool), busy (a generation is running).",
      "job": false,
      "events": [
        "voice.warm"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "part": {
            "type": "integer",
            "description": "Part index to cut from (from 1); not with source \"media\"",
            "minimum": 1
          },
          "source": {
            "type": "string",
            "description": "Cut from the media pool instead of a part",
            "enum": [
              "media"
            ]
          },
          "start_s": {
            "type": "number",
            "description": "Start, seconds"
          },
          "end_s": {
            "type": "number",
            "description": "End, seconds"
          }
        },
        "required": [
          "id",
          "start_s",
          "end_s"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "reference": {
            "description": "The new clip",
            "oneOf": [
              {
                "type": "object",
                "description": "The reference clip cut from a part",
                "properties": {
                  "part": {
                    "type": "integer",
                    "description": "Part index the clip was cut from"
                  },
                  "start_s": {
                    "type": "number",
                    "description": "Start in the part, seconds"
                  },
                  "end_s": {
                    "type": "number",
                    "description": "End in the part, seconds"
                  },
                  "duration_s": {
                    "type": "number",
                    "description": "Clip length, seconds"
                  },
                  "manual": {
                    "type": "boolean",
                    "description": "Picked by hand"
                  },
                  "rate": {
                    "type": "number",
                    "description": "Syllables per second"
                  },
                  "pauses": {
                    "type": "number",
                    "description": "Fraction of the clip in long pauses (0-1)"
                  }
                }
              },
              {
                "type": "object",
                "description": "A reference clip cut from the media pool",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Always \"media\"",
                    "enum": [
                      "media"
                    ]
                  },
                  "start_s": {
                    "type": "number",
                    "description": "Start in the pool, seconds"
                  },
                  "end_s": {
                    "type": "number",
                    "description": "End in the pool, seconds"
                  },
                  "duration_s": {
                    "type": "number",
                    "description": "Clip length, seconds"
                  },
                  "manual": {
                    "type": "boolean",
                    "description": "Always true"
                  },
                  "pool": {
                    "description": "Identifies the media pool the clip was cut from"
                  },
                  "file": {
                    "type": "integer",
                    "description": "1-based index of the source file in the pool request"
                  },
                  "title": {
                    "type": "string",
                    "description": "File name"
                  },
                  "rate": {
                    "type": "number",
                    "description": "Syllables per second"
                  },
                  "pauses": {
                    "type": "number",
                    "description": "Fraction in long pauses (0-1)"
                  },
                  "snr_db": {
                    "type": "number",
                    "description": "Signal-to-noise ratio, dB"
                  }
                },
                "required": [
                  "source",
                  "start_s",
                  "end_s",
                  "duration_s"
                ]
              }
            ]
          },
          "warming": {
            "type": "boolean",
            "description": "voices.warm was started"
          },
          "target": {
            "type": "string",
            "description": "With source \"media\": reference.wav or reference_<code>.wav"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "With source \"media\": the pool language, or null"
          }
        },
        "required": [
          "reference",
          "warming"
        ]
      }
    },
    {
      "name": "voices.warm",
      "summary": "Warm a voice up in the background",
      "description": "Precomputes the speaker conditioning of reference.wav (and loads a trained voice's RVC model) in the background, ending with the voice.warm event. Errors: not_found (voice or no reference.wav), not_ready, no_memory.",
      "job": false,
      "events": [
        "voice.warm"
      ],
      "params": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "accent": {
            "type": "string",
            "description": "Accent to warm for",
            "enum": [
              "own",
              "native-us"
            ],
            "default": "own"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker for native-us",
            "enum": [
              "auto",
              "male",
              "female"
            ],
            "default": "auto"
          }
        },
        "required": [
          "id"
        ]
      },
      "result": {
        "type": "object",
        "properties": {
          "warming": {
            "type": "boolean",
            "description": "The warm-up started"
          },
          "reason": {
            "type": "string",
            "description": "Why it did not start (only when warming is false); busy means a generation is running",
            "enum": [
              "already_warm",
              "busy"
            ]
          }
        },
        "required": [
          "warming"
        ]
      }
    },
    {
      "name": "shutdown",
      "summary": "Shut the engine down",
      "description": "Answers {} and then the engine exits.",
      "job": false,
      "params": {
        "type": "object",
        "properties": {}
      },
      "result": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "events": [
    {
      "name": "ready",
      "job": false,
      "description": "Sent once at start when the engine can answer requests; data is the hello result.",
      "data": {
        "type": "object",
        "description": "Engine info",
        "properties": {
          "version": {
            "type": "string",
            "description": "Engine version"
          },
          "device": {
            "type": "object",
            "description": "Compute device",
            "properties": {
              "backend": {
                "type": "string",
                "description": "Compute backend",
                "enum": [
                  "cuda",
                  "mps",
                  "cpu"
                ]
              },
              "name": {
                "type": "string",
                "description": "Device name, e.g. \"NVIDIA GeForce RTX 4070\" or \"CPU\""
              },
              "vram_gb": {
                "type": "number",
                "description": "Total VRAM rounded to 0.1; 0.0 for MPS and CPU"
              },
              "vendor": {
                "type": "string",
                "description": "GPU vendor from runtime.toml; left out when not set",
                "enum": [
                  "nvidia",
                  "amd"
                ]
              }
            },
            "required": [
              "backend",
              "name",
              "vram_gb"
            ]
          },
          "models": {
            "type": "object",
            "description": "Model states",
            "properties": {
              "tts": {
                "type": "string",
                "description": "Speech model state",
                "enum": [
                  "ready",
                  "loading",
                  "paused",
                  "missing",
                  "no_memory"
                ]
              },
              "rvc": {
                "type": "string",
                "description": "RVC model state",
                "enum": [
                  "ready",
                  "loading",
                  "paused",
                  "missing"
                ]
              },
              "tts_message": {
                "type": "string",
                "description": "Why the speech model is not loaded; only with tts no_memory"
              }
            },
            "required": [
              "tts",
              "rvc"
            ]
          },
          "languages": {
            "type": "array",
            "description": "Every language the speech model speaks, common ones first, then the rest by English name",
            "items": {
              "type": "object",
              "description": "A language the speech model speaks",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "ISO 639-1 code"
                },
                "name": {
                  "type": "string",
                  "description": "Name in English"
                },
                "native": {
                  "type": "string",
                  "description": "Name in the language itself"
                },
                "common": {
                  "type": "boolean",
                  "description": "A common language (listed first)"
                }
              },
              "required": [
                "code",
                "name",
                "native"
              ]
            }
          },
          "translators": {
            "type": "array",
            "description": "Installed Redub translation models, best first; empty when none",
            "items": {
              "type": "string",
              "description": "Translator id",
              "enum": [
                "nllb-1.3b",
                "nllb-600m"
              ]
            }
          },
          "zero_shot_vc": {
            "type": "boolean",
            "description": "The zero-shot voice converter (Seed-VC) is installed and on"
          },
          "components": {
            "type": "array",
            "description": "Installed runtime parts that are not turned off",
            "items": {
              "type": "string",
              "description": "Component",
              "enum": [
                "speech",
                "training",
                "translation",
                "better_translation",
                "native_accent",
                "music_removal",
                "ukrainian",
                "voxcpm",
                "chatterbox"
              ]
            }
          },
          "components_off": {
            "type": "array",
            "description": "Installed parts the user turned off",
            "items": {
              "type": "string",
              "description": "Component"
            }
          },
          "speech_models": {
            "type": "array",
            "description": "Installed voice-cloning models a request may name in model, OmniVoice first",
            "items": {
              "type": "object",
              "description": "A voice-cloning model",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Model id",
                  "enum": [
                    "omnivoice",
                    "voxcpm",
                    "chatterbox"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "Display name"
                },
                "languages": {
                  "type": "array",
                  "description": "ISO 639-1 codes it speaks",
                  "items": {
                    "type": "string",
                    "description": "ISO 639-1 code"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "languages"
              ]
            }
          }
        },
        "required": [
          "version",
          "device",
          "models",
          "languages",
          "translators",
          "zero_shot_vc",
          "components",
          "components_off",
          "speech_models"
        ]
      }
    },
    {
      "name": "models",
      "job": false,
      "description": "Sent every time a model state changes (start-up, training hand-over, reload).",
      "data": {
        "type": "object",
        "description": "Model states",
        "properties": {
          "tts": {
            "type": "string",
            "description": "Speech model state",
            "enum": [
              "ready",
              "loading",
              "paused",
              "missing",
              "no_memory"
            ]
          },
          "rvc": {
            "type": "string",
            "description": "RVC model state",
            "enum": [
              "ready",
              "loading",
              "paused",
              "missing"
            ]
          },
          "tts_message": {
            "type": "string",
            "description": "Why the speech model is not loaded; only with tts no_memory"
          }
        },
        "required": [
          "tts",
          "rvc"
        ]
      }
    },
    {
      "name": "voice.warm",
      "job": false,
      "description": "Sent when a voices.warm finished, successfully or not.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "ok": {
            "type": "boolean",
            "description": "The warm-up succeeded"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Seconds taken (ok true)"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Detected language of reference.wav (ok true)"
          },
          "message": {
            "type": "string",
            "description": "Why it failed, in plain words (ok false)"
          }
        },
        "required": [
          "id",
          "ok"
        ]
      }
    },
    {
      "name": "redub.prepared",
      "job": false,
      "description": "Sent when a redub.prepare that answered warming true has finished.",
      "data": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "Whisper is loaded"
          },
          "device": {
            "type": "string",
            "description": "Device",
            "enum": [
              "cuda",
              "cpu"
            ]
          },
          "model": {
            "type": "string",
            "description": "Whisper model",
            "enum": [
              "turbo"
            ]
          },
          "elapsed_s": {
            "type": "number",
            "description": "Load time"
          },
          "message": {
            "type": "string",
            "description": "Why it failed (ok false)"
          },
          "separated": {
            "type": "boolean",
            "description": "Voice and background were separated"
          },
          "separation_s": {
            "type": "number",
            "description": "Separation time"
          },
          "separation_device": {
            "type": "string",
            "description": "Device of the separation"
          },
          "separation_note": {
            "type": "string",
            "description": "Why the separation was not done"
          }
        },
        "required": [
          "ok"
        ]
      }
    },
    {
      "name": "job.error",
      "job": true,
      "description": "Last resort: sent when a job crashes without reporting itself.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "internal"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "voices.media.progress",
      "job": true,
      "description": "Progress of a voices.reference_from_media job.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "stage": {
            "type": "string",
            "description": "Current stage",
            "enum": [
              "decode",
              "separate",
              "combine",
              "analyse",
              "apply"
            ]
          },
          "pct": {
            "type": "number",
            "description": "Overall progress",
            "minimum": 0,
            "maximum": 100
          },
          "files": {
            "type": "integer",
            "description": "Number of files"
          },
          "file": {
            "type": "integer",
            "description": "1-based file being decoded, separated or cleaned"
          },
          "name": {
            "type": "string",
            "description": "Name of that file"
          }
        },
        "required": [
          "id",
          "stage",
          "pct",
          "files"
        ]
      }
    },
    {
      "name": "voices.media.done",
      "job": true,
      "description": "Sent when a voices.reference_from_media job finished; the pool and the reference are installed.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Voice id"
          },
          "files": {
            "type": "integer",
            "description": "Files used"
          },
          "duration_s": {
            "type": "number",
            "description": "Pool length, seconds"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Target language or null for the voice's own"
          },
          "target": {
            "type": "string",
            "description": "reference.wav or reference_<code>.wav"
          },
          "applied": {
            "type": "boolean",
            "description": "The best window was written to the target; false (with message) when a generation started meanwhile or no 8-12 s window was found"
          },
          "reference": {
            "type": [
              "object",
              "null"
            ],
            "description": "The new clip as in voices.set_reference with source \"media\", or null"
          },
          "warming": {
            "type": "boolean",
            "description": "voices.warm was started"
          },
          "preview_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Path of the target, or null"
          },
          "skipped": {
            "type": "array",
            "description": "Skipped files",
            "items": {
              "type": "object",
              "description": "A skipped file",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "File name"
                },
                "path": {
                  "type": "string",
                  "description": "File path"
                },
                "reason": {
                  "type": "string",
                  "description": "Why it was skipped"
                }
              },
              "required": [
                "name",
                "path",
                "reason"
              ]
            }
          },
          "unused": {
            "type": "array",
            "description": "Files past the 20-minute limit",
            "items": {
              "type": "string",
              "description": "File name"
            }
          },
          "truncated": {
            "type": "array",
            "description": "Files cut at the limit",
            "items": {
              "type": "string",
              "description": "File name"
            }
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Note for the user, e.g. why it was not applied"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Seconds taken"
          },
          "music_removed": {
            "type": "boolean",
            "description": "Background music was removed from at least one file"
          },
          "music_files": {
            "type": "integer",
            "description": "Number of files separated"
          },
          "music_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no file was separated, e.g. \"turned off\", \"no background sound found under the voice\", \"the music-removal model is not installed (run setup again)\""
          },
          "music_device": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cuda",
              "cpu",
              null
            ],
            "description": "Device the separation ran on"
          }
        },
        "required": [
          "id",
          "files",
          "duration_s",
          "target",
          "applied",
          "warming",
          "skipped",
          "unused",
          "truncated",
          "elapsed_s",
          "music_removed"
        ]
      }
    },
    {
      "name": "voices.media.error",
      "job": true,
      "description": "Sent when a voices.reference_from_media job failed or was cancelled; nothing is changed.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "cancelled",
              "bad_request",
              "not_found",
              "internal"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          },
          "skipped": {
            "type": "array",
            "description": "Skipped files (with bad_request \"None of the files has usable speech.\")",
            "items": {
              "type": "object",
              "description": "A skipped file",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "File name"
                },
                "path": {
                  "type": "string",
                  "description": "File path"
                },
                "reason": {
                  "type": "string",
                  "description": "Why it was skipped"
                }
              },
              "required": [
                "name",
                "path",
                "reason"
              ]
            }
          },
          "music_removed": {
            "type": "boolean",
            "description": "Background music was removed from at least one file"
          },
          "music_files": {
            "type": "integer",
            "description": "Number of files separated"
          },
          "music_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no file was separated, e.g. \"turned off\", \"no background sound found under the voice\", \"the music-removal model is not installed (run setup again)\""
          },
          "music_device": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cuda",
              "cpu",
              null
            ],
            "description": "Device the separation ran on"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "train.progress",
      "job": true,
      "description": "Sent about every 0.5 s and at each stage change while a training runs.",
      "data": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "description": "Training stage",
            "enum": [
              "preprocess",
              "extract",
              "train",
              "index"
            ]
          },
          "epoch": {
            "type": "integer",
            "description": "1-based epoch while training; 0 outside train/index"
          },
          "total_epochs": {
            "type": "integer",
            "description": "Planned epoch count"
          },
          "pct": {
            "type": "number",
            "description": "Overall progress 0-100 (preprocess 0-5, extract 5-15, train 15-95, index 95-100)",
            "minimum": 0,
            "maximum": 100
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated seconds left; null until three epochs are measured and outside the train stage"
          }
        },
        "required": [
          "stage",
          "epoch",
          "total_epochs",
          "pct",
          "eta_s"
        ]
      }
    },
    {
      "name": "train.done",
      "job": true,
      "description": "Sent when a training finished and the model was saved.",
      "data": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Trained voice"
          },
          "epochs": {
            "type": "integer",
            "description": "Epochs done"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Wall time in seconds"
          }
        },
        "required": [
          "voice_id",
          "epochs",
          "elapsed_s"
        ]
      }
    },
    {
      "name": "train.error",
      "job": true,
      "description": "Sent when a training fails or is cancelled.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "cancelled or internal",
            "enum": [
              "cancelled",
              "internal"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human text (out of memory in plain words)"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "train.paused",
      "job": true,
      "description": "Ends the job after train.pause once a checkpoint is safely on disk.",
      "data": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "description": "Paused voice"
          },
          "epoch": {
            "type": "integer",
            "description": "Epoch of the saved checkpoint, where a resume continues"
          },
          "total_epochs": {
            "type": "integer",
            "description": "Planned epoch count"
          },
          "paused_at": {
            "type": "string",
            "description": "When it was paused (local time)"
          },
          "reached_epoch": {
            "type": "integer",
            "description": "How far the training had got"
          }
        },
        "required": [
          "voice_id",
          "epoch",
          "total_epochs",
          "paused_at",
          "reached_epoch"
        ]
      }
    },
    {
      "name": "tts.chunk",
      "job": true,
      "description": "Sent once per segment of a generation, in order; the audio can be played at once.",
      "data": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "Segment index (0-based)"
          },
          "path": {
            "type": "string",
            "description": "Absolute path of the chunk WAV (44.1 kHz, pause after it included), in <data>/tmp/<job>/, deleted after an hour"
          },
          "duration_s": {
            "type": "number",
            "description": "Chunk duration in seconds"
          },
          "segments": {
            "type": "integer",
            "description": "Total number of segments"
          },
          "ready_s": {
            "type": "number",
            "description": "Wall time from the start of the job to this chunk"
          },
          "rtf": {
            "type": "number",
            "description": "Wall time since the previous chunk (or the start) divided by this chunk speech seconds"
          }
        },
        "required": [
          "index",
          "path",
          "duration_s",
          "segments",
          "ready_s",
          "rtf"
        ]
      }
    },
    {
      "name": "tts.done",
      "job": true,
      "description": "Sent when a generation finished and its result was saved in <data>/outputs.",
      "data": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path of the saved result file"
          },
          "path_play": {
            "type": "string",
            "description": "Absolute path of a WAV of the same audio (path itself for wav)"
          },
          "format": {
            "type": "string",
            "description": "Format actually saved (wav when the encoder failed)"
          },
          "duration_s": {
            "type": "number",
            "description": "Speech duration in seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Wall time of the job in seconds"
          },
          "model": {
            "type": "string",
            "description": "The model that spoke",
            "enum": [
              "omnivoice",
              "voxcpm",
              "chatterbox",
              "holos"
            ]
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "Converter used with native-us",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us was asked but not used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user on why native-us was not used"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when the speaking clip is known to be in another language than the text"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user about the carried-over accent"
          },
          "native_voice": {
            "type": "string",
            "description": "Native speaker used, with native-us",
            "enum": [
              "male",
              "female"
            ]
          },
          "pitch": {
            "type": "integer",
            "description": "RVC transpose in semitones with native-us (0 with the zero-shot converter)"
          }
        },
        "required": [
          "path",
          "path_play",
          "format",
          "duration_s",
          "elapsed_s"
        ]
      }
    },
    {
      "name": "tts.error",
      "job": true,
      "description": "Sent when a generation fails or is cancelled; the generation slot is free again.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code: cancelled after tts.cancel, no_memory when RAM is too small or full, or another engine code"
          },
          "message": {
            "type": "string",
            "description": "Human text"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "book.progress",
      "job": true,
      "description": "Sent when a chapter starts and after every segment of a book.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "chapter": {
            "type": "integer",
            "description": "Current chapter index"
          },
          "chapters": {
            "type": "integer",
            "description": "Chapters"
          },
          "title": {
            "type": "string",
            "description": "Chapter title"
          },
          "segment": {
            "type": "integer",
            "description": "Segments of this chapter done"
          },
          "segments": {
            "type": "integer",
            "description": "Segments in this chapter"
          },
          "chapter_audio_s": {
            "type": "number",
            "description": "Audio of this chapter, seconds"
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          },
          "segment_rtf": {
            "type": "number",
            "description": "Real-time factor of the last segment"
          },
          "stage": {
            "type": "string",
            "description": "m4b while the M4B is made; memory while waiting for RAM or VRAM",
            "enum": [
              "m4b",
              "memory"
            ]
          },
          "retry_in_s": {
            "type": "number",
            "description": "With stage memory: seconds until the retry"
          },
          "stage_pct": {
            "type": "number",
            "description": "With stage m4b: 0-100"
          },
          "stage_eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "With stage m4b: time left"
          }
        },
        "required": [
          "id",
          "chapter",
          "chapters",
          "percent"
        ]
      }
    },
    {
      "name": "book.chapter",
      "job": true,
      "description": "Sent when a chapter file is finished.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "index": {
            "type": "integer",
            "description": "Chapter index"
          },
          "title": {
            "type": "string",
            "description": "Chapter title"
          },
          "path": {
            "type": "string",
            "description": "Chapter file"
          },
          "segments_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Segment timing file; null when the records were incomplete"
          },
          "duration_s": {
            "type": "number",
            "description": "Chapter length, seconds"
          },
          "level": {
            "type": "object",
            "properties": {
              "lufs_in": {
                "type": "number",
                "description": "Loudness before"
              },
              "gain_db": {
                "type": "number",
                "description": "Gain applied"
              },
              "peak_dbfs": {
                "type": "number",
                "description": "Peak"
              }
            }
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "Real-time factor of this chapter"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          }
        },
        "required": [
          "id",
          "index",
          "path"
        ]
      }
    },
    {
      "name": "book.done",
      "job": true,
      "description": "Sent when the whole book is read; the slot is free.",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "folder": {
            "type": "string",
            "description": "Output folder"
          },
          "m4b": {
            "type": [
              "string",
              "null"
            ],
            "description": "M4B path; null when not made"
          },
          "m4b_requested": {
            "type": "boolean",
            "description": "An M4B was asked for"
          },
          "chapters": {
            "type": "integer",
            "description": "Chapters"
          },
          "retries": {
            "type": "integer",
            "description": "Memory retries"
          },
          "session_elapsed_s": {
            "type": "number",
            "description": "Generation time this session"
          },
          "session_audio_s": {
            "type": "number",
            "description": "Audio made this session"
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          },
          "native_voice": {
            "type": "string",
            "description": "With native-us: the native speaker used",
            "enum": [
              "male",
              "female"
            ]
          },
          "pitch": {
            "type": "integer",
            "description": "With native-us: the RVC transpose in semitones (0 with the zero-shot converter)"
          }
        },
        "required": [
          "id",
          "folder"
        ]
      }
    },
    {
      "name": "book.paused",
      "job": true,
      "description": "Sent after book.pause stopped the job; data is the book summary.",
      "data": {
        "type": "object",
        "description": "Book summary",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "title": {
            "type": "string",
            "description": "Book title"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source file the text came from"
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source format"
          },
          "language": {
            "type": "string",
            "description": "Language code"
          },
          "voice_id": {
            "type": "string",
            "description": "Voice that reads the book"
          },
          "status": {
            "type": "string",
            "description": "Book status",
            "enum": [
              "new",
              "running",
              "paused",
              "done",
              "error",
              "cancelled"
            ]
          },
          "interrupted": {
            "type": "boolean",
            "description": "True for a book recorded as running whose job is not running in this engine (reported paused)"
          },
          "job": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job id while it is read, else null"
          },
          "chapters": {
            "type": "integer",
            "description": "Number of chapters"
          },
          "chapters_done": {
            "type": "integer",
            "description": "Chapters finished"
          },
          "current": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Index of the current chapter"
          },
          "folder": {
            "type": "string",
            "description": "Output folder of the chapter files"
          },
          "m4b": {
            "type": [
              "string",
              "null"
            ],
            "description": "Path of the M4B audiobook, when made"
          },
          "output_format": {
            "type": "string",
            "description": "Format of the chapter files",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "ogg",
              "opus",
              "m4a",
              "aiff"
            ]
          },
          "words": {
            "type": "integer",
            "description": "Words in the book"
          },
          "ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's own name for the project"
          },
          "created": {
            "type": "number",
            "description": "Creation time (unix seconds)"
          },
          "updated": {
            "type": "number",
            "description": "Last change (unix seconds)"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "description": "Last error, or null",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Message"
              }
            }
          },
          "percent": {
            "type": "number",
            "description": "Progress by characters (0-100)"
          },
          "audio_s": {
            "type": "number",
            "description": "Audio made so far, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Generation time over all sessions, seconds"
          },
          "rtf": {
            "type": [
              "number",
              "null"
            ],
            "description": "elapsed_s / audio_s"
          },
          "eta_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "Time left at the measured pace; null until the first segment"
          },
          "est_audio_s": {
            "type": [
              "number",
              "null"
            ],
            "description": "The whole book's length extrapolated, seconds"
          },
          "chars": {
            "type": "integer",
            "description": "Characters in the book"
          },
          "chars_done": {
            "type": "integer",
            "description": "Characters read so far"
          }
        },
        "required": [
          "id",
          "title",
          "status"
        ]
      }
    },
    {
      "name": "book.error",
      "job": true,
      "description": "Sent when a book fails or is cancelled (code cancelled after book.cancel, no_memory when memory retries did not help).",
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Book id"
          },
          "code": {
            "type": "string",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Message"
          }
        },
        "required": [
          "id",
          "code",
          "message"
        ]
      }
    },
    {
      "name": "book.cast_progress",
      "job": true,
      "description": "Progress of book.cast.",
      "data": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The cast's key: the chapters, language and mode"
          },
          "pct": {
            "type": "number",
            "description": "0-100"
          }
        }
      }
    },
    {
      "name": "book.cast_done",
      "job": true,
      "description": "book.cast found the speakers.",
      "data": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The cast's key: the chapters, language and mode"
          },
          "mode": {
            "type": "string",
            "description": "fast or careful"
          },
          "narrator": {
            "type": "object",
            "properties": {
              "first_person": {
                "type": "boolean",
                "description": "The book is told by an I who is a character"
              },
              "name": {
                "type": "string",
                "description": "That narrator's name"
              }
            }
          },
          "characters": {
            "type": "array",
            "description": "The speaking characters, most lines first (at most 30)",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name"
                },
                "gender": {
                  "type": "string",
                  "enum": [
                    "m",
                    "f"
                  ],
                  "description": "m or f"
                },
                "lines": {
                  "type": "integer",
                  "description": "Lines"
                }
              }
            }
          },
          "lines": {
            "type": "object",
            "properties": {
              "men": {
                "type": "integer",
                "description": "Lines read by the men's voice"
              },
              "women": {
                "type": "integer",
                "description": "Lines read by the women's voice"
              },
              "narrator": {
                "type": "integer",
                "description": "Speech lines left to the narrator"
              }
            }
          },
          "voices": {
            "type": "object",
            "description": "OmniVoice design terms for a voice of each role (voices.design description)",
            "properties": {
              "narrator": {
                "type": "string",
                "description": "The narrator's voice"
              },
              "men": {
                "type": "string",
                "description": "The men's voice"
              },
              "women": {
                "type": "string",
                "description": "The women's voice"
              }
            }
          }
        }
      }
    },
    {
      "name": "book.cast_error",
      "job": true,
      "description": "book.cast failed or was cancelled.",
      "data": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The cast's key: the chapters, language and mode"
          },
          "code": {
            "type": "string",
            "description": "Error code (cancelled, not_ready, internal)"
          },
          "message": {
            "type": "string",
            "description": "What went wrong"
          }
        }
      }
    },
    {
      "name": "redub.progress",
      "job": true,
      "description": "Sent while a Redub job runs; pct is overall for the job and never decreases.",
      "data": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "description": "Current stage",
            "enum": [
              "decode",
              "load_model",
              "transcribe",
              "translate",
              "separate",
              "convert",
              "speak",
              "mix",
              "save",
              "mux",
              "subtitles",
              "encode"
            ]
          },
          "pct": {
            "type": "number",
            "description": "Overall progress 0-100",
            "minimum": 0,
            "maximum": 100
          },
          "segment": {
            "type": "integer",
            "description": "0-based index of the chunk or segment just finished (convert, speak)"
          },
          "segments": {
            "type": "integer",
            "description": "Total chunks or segments (convert, speak)"
          }
        },
        "required": [
          "stage",
          "pct"
        ]
      }
    },
    {
      "name": "redub.transcript",
      "job": true,
      "description": "Terminal event of redub.transcribe and of redub.dub with review true: the transcript, translated when asked.",
      "data": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "description": "Language of the speech"
          },
          "source_language": {
            "type": "string",
            "description": "Language of the speech"
          },
          "duration_s": {
            "type": "number",
            "description": "Duration, seconds"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Segment index"
                },
                "start": {
                  "type": "number",
                  "description": "Start, seconds"
                },
                "end": {
                  "type": "number",
                  "description": "End, seconds"
                },
                "text": {
                  "type": "string",
                  "description": "Text (the translation when translated)"
                },
                "source_text": {
                  "type": "string",
                  "description": "Original text (only when translated)"
                },
                "words": {
                  "type": "array",
                  "description": "Whisper's words of the line with their times, [start, end, word] in seconds",
                  "items": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 3,
                    "maxItems": 3
                  }
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ]
            },
            "description": "May be empty for a file without speech"
          },
          "model": {
            "type": "string",
            "description": "Transcription model"
          },
          "translated": {
            "type": "boolean",
            "description": "Segment texts are translations"
          },
          "target_language": {
            "type": "string",
            "description": "Translation target (when translated)"
          },
          "translation_model": {
            "type": "string",
            "description": "Model that translated",
            "enum": [
              "nllb-200-distilled-1.3B",
              "nllb-200-distilled-600M"
            ]
          },
          "review": {
            "type": "boolean",
            "description": "True for a redub.dub review stop"
          },
          "timings_s": {
            "type": "object",
            "description": "Seconds per stage (redub.dub review stop)",
            "additionalProperties": {
              "type": "number"
            }
          }
        },
        "required": [
          "language",
          "segments",
          "translated"
        ]
      }
    },
    {
      "name": "redub.done",
      "job": true,
      "description": "Terminal success event of redub.dub and redub.render: the saved result.",
      "data": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "The saved result"
          },
          "path_play": {
            "type": "string",
            "description": "A WAV of the same audio"
          },
          "format": {
            "type": "string",
            "description": "Format saved"
          },
          "duration_s": {
            "type": "number",
            "description": "Result length, seconds"
          },
          "elapsed_s": {
            "type": "number",
            "description": "Job time, seconds"
          },
          "mode": {
            "type": "string",
            "description": "What was done",
            "enum": [
              "dub",
              "convert",
              "respeak",
              "subtitles"
            ]
          },
          "timings_s": {
            "type": "object",
            "description": "Seconds per stage",
            "additionalProperties": {
              "type": "number"
            }
          },
          "language": {
            "type": "string",
            "description": "Language spoken (respeak, dub); the text language (subtitles)"
          },
          "target_language": {
            "type": "string",
            "description": "Dub target language"
          },
          "translated": {
            "type": "boolean",
            "description": "The text was translated (dub)"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "Segment index"
                },
                "start": {
                  "type": "number",
                  "description": "Start, seconds"
                },
                "end": {
                  "type": "number",
                  "description": "End, seconds"
                },
                "text": {
                  "type": "string",
                  "description": "Text (the translation when translated)"
                },
                "source_text": {
                  "type": "string",
                  "description": "Original text (only when translated)"
                },
                "words": {
                  "type": "array",
                  "description": "Whisper's words of the line, as sent (subtitles)",
                  "items": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 3,
                    "maxItems": 3
                  }
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ]
            },
            "description": "The transcript segments (dub); the lines shown (subtitles)"
          },
          "timing": {
            "type": "string",
            "description": "Timing mode used",
            "enum": [
              "keep",
              "natural"
            ]
          },
          "timing_forced": {
            "type": "boolean",
            "description": "True when a video output overrode timing natural"
          },
          "stretched": {
            "type": "integer",
            "description": "Clips time-stretched"
          },
          "overrun": {
            "type": "integer",
            "description": "Clips still longer than their room"
          },
          "pushed": {
            "type": "integer",
            "description": "Clips pushed later"
          },
          "drift_s": {
            "type": "number",
            "description": "How much longer the output is than the source"
          },
          "max_push_s": {
            "type": "number",
            "description": "Largest delay of any segment's start"
          },
          "accent": {
            "type": "string",
            "description": "What the job does",
            "enum": [
              "own",
              "native-us"
            ]
          },
          "accent_converter": {
            "type": "string",
            "description": "With native-us: the converter used",
            "enum": [
              "rvc",
              "zero-shot"
            ]
          },
          "accent_fallback": {
            "type": "string",
            "description": "Why native-us could not be used",
            "enum": [
              "not_english",
              "no_converter",
              "unavailable"
            ]
          },
          "accent_note": {
            "type": "string",
            "description": "A sentence for the user about the accent fallback"
          },
          "reference_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the clip that speaks; null while unknown"
          },
          "reference_foreign": {
            "type": "boolean",
            "description": "True when that clip is known to be in another language than the spoken one"
          },
          "reference_note": {
            "type": "string",
            "description": "Only when foreign: a sentence for the user"
          },
          "native_voice": {
            "type": "string",
            "description": "With native-us: the native speaker used",
            "enum": [
              "male",
              "female"
            ]
          },
          "pitch": {
            "type": "integer",
            "description": "With native-us: the RVC transpose in semitones (0 with the zero-shot converter)"
          },
          "output": {
            "type": "string",
            "description": "Kind of result",
            "enum": [
              "video",
              "audio"
            ]
          },
          "video_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The video with the new voice, or with the subtitles; null for audio"
          },
          "keep_background": {
            "type": "boolean",
            "description": "Whether the background is in the result"
          },
          "background_note": {
            "type": "string",
            "description": "Why the background could not be kept"
          },
          "separation_s": {
            "type": "number",
            "description": "How long the job waited for the stems (0 when ready)"
          },
          "separation_cached": {
            "type": "boolean",
            "description": "Stems came from the cache"
          },
          "separation_device": {
            "type": "string",
            "description": "Device of the separation"
          },
          "mix_s": {
            "type": "number",
            "description": "Mixing time, seconds"
          },
          "mix": {
            "type": "object",
            "description": "Mix measurements",
            "properties": {
              "voice_lufs": {
                "type": "number",
                "description": "Voice loudness"
              },
              "target_lufs": {
                "type": "number",
                "description": "Target loudness"
              },
              "voice_gain_db": {
                "type": "number",
                "description": "Voice gain"
              },
              "background_lufs": {
                "type": "number",
                "description": "Background loudness"
              },
              "duck_db": {
                "type": "number",
                "description": "Ducking applied"
              },
              "duck_measured_db": {
                "type": "number",
                "description": "Ducking measured in the original"
              },
              "limited_db": {
                "type": "number",
                "description": "Limiter reduction"
              }
            }
          },
          "mux_s": {
            "type": "number",
            "description": "Mux time, seconds"
          },
          "video_audio_codec": {
            "type": "string",
            "description": "Audio codec of the video output"
          },
          "subtitles_burned": {
            "type": "boolean",
            "description": "With subtitles: whether the text is drawn into the picture"
          },
          "subtitle_lines": {
            "type": "integer",
            "description": "With subtitles: subtitle cues written"
          },
          "subtitle_note": {
            "type": "string",
            "description": "Why the subtitles are not drawn into the picture, or not in the video at all; mode subtitles: also that a video's own picture was kept instead of the images"
          }
        },
        "required": [
          "path",
          "path_play",
          "format",
          "duration_s",
          "mode"
        ]
      }
    },
    {
      "name": "redub.error",
      "job": true,
      "description": "Terminal failure event of a Redub job (cancelled after redub.cancel, bad_request, not_ready, internal).",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "video.progress",
      "job": true,
      "description": "Progress of a video.export job.",
      "data": {
        "type": "object",
        "properties": {
          "stage": {
            "type": "string",
            "description": "Current stage",
            "enum": [
              "prepare",
              "encode"
            ]
          },
          "pct": {
            "type": "number",
            "description": "Overall progress (prepare 0-10, encode 10-100)",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "stage",
          "pct"
        ]
      }
    },
    {
      "name": "video.done",
      "job": true,
      "description": "Sent when a video.export job wrote the video.",
      "data": {
        "type": "object",
        "properties": {
          "dest": {
            "type": "string",
            "description": "Path of the video"
          },
          "duration_s": {
            "type": "number",
            "description": "Length of the video, seconds"
          },
          "copied": {
            "type": "boolean",
            "description": "The source video was copied as it is"
          },
          "subtitles": {
            "type": [
              "object",
              "null"
            ],
            "description": "The subtitles drawn in, or null",
            "properties": {
              "lines": {
                "type": "integer",
                "description": "Cues drawn"
              },
              "source": {
                "type": "string",
                "enum": [
                  "recorded",
                  "estimated",
                  "given"
                ],
                "description": "Timings given, recorded with the result or in a segment file, or estimated from its text"
              }
            },
            "required": [
              "lines",
              "source"
            ]
          },
          "subtitle_note": {
            "type": "string",
            "description": "Why the subtitles asked for are not there"
          },
          "parts": {
            "type": "array",
            "description": "Where each part (or the one path) starts in the video",
            "items": {
              "type": "object",
              "description": "A part",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The part's file"
                },
                "start": {
                  "type": "number",
                  "description": "Start in the video, seconds (3 decimals)"
                },
                "duration_s": {
                  "type": "number",
                  "description": "Length, seconds (3 decimals)"
                }
              },
              "required": [
                "path",
                "start",
                "duration_s"
              ]
            }
          }
        },
        "required": [
          "dest",
          "duration_s",
          "copied",
          "subtitles",
          "parts"
        ]
      }
    },
    {
      "name": "video.error",
      "job": true,
      "description": "Sent when a video.export job failed or was cancelled; no video is written.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "cancelled",
              "bad_request",
              "not_ready",
              "internal"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          }
        },
        "required": [
          "code",
          "message"
        ]
      }
    },
    {
      "name": "engine.exited",
      "job": false,
      "description": "Sent by the API server, not the engine: the engine exited; a new ready follows when it starts again.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Exit code"
          }
        }
      }
    },
    {
      "name": "api.lagged",
      "job": false,
      "description": "Sent by the API server: this client fell 4096 events behind and missed some.",
      "data": {
        "type": "object",
        "properties": {
          "missed": {
            "type": "integer",
            "description": "Events missed"
          }
        }
      }
    }
  ]
}