Skip to content

Commit

Permalink
add: Microsoft Edge TTS
Browse files Browse the repository at this point in the history
  • Loading branch information
BANKA2017 committed Feb 22, 2024
1 parent 1b1e15a commit c84b976
Show file tree
Hide file tree
Showing 11 changed files with 4,318 additions and 16 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ To know more, view files in [~/src/source](https://github.com/BANKA2017/translat

## TTS

`google`/`microsoft_tts`/`baidu`/`sogou`
`google`/`microsoft_tts`/`microsoft_edge_tts`/`baidu`/`sogou`

```javascript
import { BaiduTTS, GetMicrosoftTranslatorToken, MicrosoftTTS, GoogleTTS, SogouTTS } from '@kdwnil/translator-util'
import { BaiduTTS, GetMicrosoftTranslatorToken, MicrosoftTTS, MicrosoftBrowserTTS, GoogleTTS, SogouTTS } from '@kdwnil/translator-util'

// google
console.log(await GoogleTTS('en', 'hi'))
Expand All @@ -92,6 +92,10 @@ console.log(await GoogleTTS('en', 'hi'))
const msToken = await GetMicrosoftTranslatorToken()
console.log(await MicrosoftTTS('en', 'hi', { IG: msToken.IG, token: msToken.token, key: msToken.key }))

// ms edge
// You can use MicrosoftBrowserTTS in cli and browser
console.log(await MicrosoftBrowserTTS('en-US', 'hi', { optput_format: 'webm-24khz-16bit-mono-opus', voice: 'en-US-AvaNeural' }))

// baidu & sogou
// * baidu always returns an empty response
console.log(await BaiduTTS('en', 'hi'))
Expand Down
Loading

0 comments on commit c84b976

Please sign in to comment.