melotts
Text-to-Speech • MyShell • HostedMeloTTS is a high-quality multi-lingual text-to-speech library by MyShell.ai.
| Model Info | |
|---|---|
| Unit Pricing | $0.0002 per audio minute |
Usage
export interface Env { AI: Ai;}
export default { async fetch(request, env): Promise<Response> { const { audio } = await env.AI.run('@cf/myshell-ai/melotts', { prompt: 'Hello world', lang: 'en', }); // Returns the base64 encoded MP3 audio return Response.json({ audio }); },} satisfies ExportedHandler<Env>;Parameters
prompt
stringrequiredminLength: 1A text description of the audio you want to generatelang
stringdefault: enThe speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified▶Option 1{}
objectcontentType: application/json
Option 2
stringcontentType: audio/mpegformat: binary
The generated audio in MP3 format