Skip to content

Commit

Permalink
more parameter for elevenlabs
Browse files Browse the repository at this point in the history
  • Loading branch information
stc1988 authored and mkellner committed Nov 24, 2023
1 parent 77e10f4 commit e95cde0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import MP3Streamer from "mp3streamer";

export default class {
constructor(options) {
const {key, voice, latency, text, model, ...o} = options;
const {key, voice, latency, format, text, model, voice_settings, ...o} = options;
const body = ArrayBuffer.fromString(JSON.stringify({
text,
model_id: model ?? "eleven_monolingual_v1",
voice_settings: {
voice_settings: voice_settings ?? {
stability: 0,
similarity_boost: 0
}
Expand All @@ -53,7 +53,7 @@ export default class {
},
port: 443,
host: "api.elevenlabs.io",
path: `/v1/text-to-speech/${voice}/stream?optimize_streaming_latency=${latency ?? 0}`,
path: `/v1/text-to-speech/${voice}/stream?optimize_streaming_latency=${latency ?? 0}&output_format=${format ?? 'mp3_44100_128'}`,
})
}
}

0 comments on commit e95cde0

Please sign in to comment.