Bytez home pagelight logodark logo
  • Discord
  • Get support
  • Bytez-com/docs
  • Bytez-com/docs
Tasks
Text-to-Speech
Docs
HTTP Reference
Integrations
API status
Model API
  • Welcome
  • Get started
  • Understand the API
  • Tasks
    • Audio Classification
    • Automatic Speech Recognition
    • Chat
    • Depth Estimation
    • Document Question Answering
    • Feature Extraction
    • Fill Mask
    • Image Classification
    • Image Feature Extraction
    • Image Segmentation
    • Image-to-Text
    • Mask Generation
    • Object Detection
    • Question Answering
    • Sentence Similarity
    • Summarization
    • Text Classification
    • Text Generation
    • Image Generation
    • Text-to-Speech
    • Text-to-Text Generation
    • Text-to-Video
    • Token Classification
    • Translation
    • Unconditional Image Generation
    • Video Classification
    • Visual Question Answering
    • Zero Shot Classification
    • Zero Shot Image Classification
    • Zero Shot Object Detection
Tasks

Text-to-Speech

Convert text into natural-sounding speech for applications like virtual assistants, accessibility features, and content creation

Send a text input to generate an audio output:

import Bytez from "bytez.js";

const sdk = new Bytez("BYTEZ_KEY");
const model = sdk.model("suno/bark-small");

const { error, output } = await model.run("Hello, how are you today?");

console.log({ error, output });

Instead receiving an audio file in JSON format, you opt to stream back the data URL:

import Bytez from "bytez.js";

const sdk = new Bytez("BYTEZ_KEY");
const model = sdk.model("suno/bark-small");
const text = "Hello, how are you today?"
const stream = true

const readStream = await model.run(text, stream);

// the stream returns the base64 data url
for await (const chunk of readStream) {
  console.log(chunk)
}
Image GenerationText-to-Text Generation
xgithublinkedindiscord
Powered by Mintlify