-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from harmony-one/voicehk
Added voicehk and voicehkf commands
- Loading branch information
Showing
5 changed files
with
72 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import axios, { type AxiosInstance } from 'axios' | ||
|
||
export class ElevenlabsClient { | ||
private readonly _token: string | ||
private readonly _httpClient: AxiosInstance | ||
constructor (apiKey: string) { | ||
this._token = apiKey | ||
|
||
this._httpClient = axios.create({ | ||
baseURL: 'https://api.elevenlabs.io', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Accept: 'audio/mpeg', | ||
'xi-api-key': apiKey | ||
} | ||
}) | ||
} | ||
|
||
public async textToSpeech ({ text, voiceId }: { text: string, voiceId: string }): Promise<string | Uint8Array | null | undefined> { | ||
return await this._httpClient.post(`/v1/text-to-speech/${voiceId}`, { | ||
text: 'string', | ||
model_id: 'eleven_monolingual_v1', | ||
voice_settings: { | ||
stability: 0.5, | ||
similarity_boost: 0.5 | ||
} | ||
}) | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters