elevenlabs-m2k
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -15,8 +15,16 @@ export declare class ElevenlabsAPI { | ||
/** | ||
* Get all preset voices | ||
* @returns A json array of models | ||
*/ | ||
getModels(): Promise<Array<any>>; | ||
/** | ||
* | ||
* @param {*} text The text you want to convert to an audio file | ||
* @param {*} voiceID The voice id. You can get voices by called the 'getVoices' function. | ||
* @param {*} voiceID The voice id. You can get voices by calling the 'getVoices' function. | ||
* @param stability | ||
* @param similarity_boost | ||
* @param model_id Identifier of the model that will be used, You can get models by calling the 'getModels' function. | ||
* @returns Audio file | ||
*/ | ||
getAudio(text: string, voiceID: string): Promise<any>; | ||
getAudio(text: string, voiceID: string, stability?: number, similarity_boost?: number, model_id?: string): Promise<any>; | ||
} |
@@ -37,2 +37,12 @@ "use strict"; | ||
const url = `${BASE_URL}/voices`; | ||
return (yield instance.get(url, this.headers)).data.voices; | ||
}); | ||
} | ||
/** | ||
* Get all preset voices | ||
* @returns A json array of models | ||
*/ | ||
getModels() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const url = `${BASE_URL}/models`; | ||
return (yield instance.get(url, this.headers)).data; | ||
@@ -44,6 +54,9 @@ }); | ||
* @param {*} text The text you want to convert to an audio file | ||
* @param {*} voiceID The voice id. You can get voices by called the 'getVoices' function. | ||
* @param {*} voiceID The voice id. You can get voices by calling the 'getVoices' function. | ||
* @param stability | ||
* @param similarity_boost | ||
* @param model_id Identifier of the model that will be used, You can get models by calling the 'getModels' function. | ||
* @returns Audio file | ||
*/ | ||
getAudio(text, voiceID) { | ||
getAudio(text, voiceID, stability = 0.5, similarity_boost = 0.75, model_id = "eleven_monolingual_v1") { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -53,6 +66,6 @@ const url = `${BASE_URL}/text-to-speech/${voiceID}`; | ||
"text": text, | ||
"model_id": "eleven_monolingual_v1", | ||
"model_id": model_id, | ||
"voice_settings": { | ||
"stability": 0.5, | ||
"similarity_boost": 0.75 | ||
"stability": stability, | ||
"similarity_boost": similarity_boost | ||
} | ||
@@ -59,0 +72,0 @@ }; |
{ | ||
"name": "elevenlabs-m2k", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "The Nodes KS API for ElevenLabs text-to-speech.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
24152
103