forked from lobehub/lobe-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Add new files, import modules, configure themes, and update A…
…PI endpoints The changes include adding new files, importing modules, defining configurations, setting environment variables, configuring themes, and updating API endpoints. A new JSON file called "azureVoiceListFull.json" is added, which contains a list of voice names and locale names for different languages. The data in the file includes language codes, voice options, and neural voice models for different locales. The code also includes hooks and functions for speech synthesis and recognition, as well as a demo component. The tsconfig.json file is updated with configuration options for the TypeScript compiler.
- Loading branch information
1 parent
2088ee2
commit 9930472
Showing
47 changed files
with
4,034 additions
and
71 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,68 @@ | ||
import { defineConfig } from 'dumi'; | ||
|
||
import { description, homepage, name } from './package.json'; | ||
|
||
const isProduction = process.env.NODE_ENV === 'production'; | ||
const isWin = process.platform === 'win32'; | ||
|
||
const themeConfig = { | ||
actions: [ | ||
{ | ||
link: homepage, | ||
openExternal: true, | ||
text: 'Github', | ||
}, | ||
{ | ||
link: '/components/use-speech-recognition', | ||
text: 'Get Started', | ||
type: 'primary', | ||
}, | ||
], | ||
apiHeader: { | ||
docUrl: `{github}/tree/master/src/{atomId}/index.md`, | ||
match: ['/components'], | ||
pkg: name, | ||
sourceUrl: `{github}/tree/master/src/{atomId}/index.tsx`, | ||
}, | ||
description: description, | ||
footer: 'Made with 🤯 by LobeHub', | ||
giscus: { | ||
category: 'Q&A', | ||
categoryId: 'DIC_kwDOJloKoM4CXsCu', | ||
repo: 'lobehub/lobe-ui', | ||
repoId: 'R_kgDOJloKoA', | ||
}, | ||
name: 'TTS', | ||
socialLinks: { | ||
discord: 'https://discord.gg/AYFPHvv2jT', | ||
github: homepage, | ||
}, | ||
title: 'Lobe TTS', | ||
}; | ||
|
||
export default defineConfig({ | ||
apiParser: isProduction ? {} : false, | ||
base: '/', | ||
define: { | ||
'process.env': process.env, | ||
}, | ||
favicons: ['https://npm.elemecdn.com/@lobehub/assets-favicons/assets/favicon.ico'], | ||
locales: [{ id: 'en-US', name: 'English' }], | ||
mfsu: isWin ? undefined : {}, | ||
npmClient: 'pnpm', | ||
publicPath: '/', | ||
resolve: isProduction | ||
? { | ||
entryFile: './src/index.ts', | ||
} | ||
: undefined, | ||
styles: [ | ||
`html, body { background: transparent; } | ||
@media (prefers-color-scheme: dark) { | ||
html, body { background: #000; } | ||
}`, | ||
], | ||
themeConfig, | ||
title: 'Lobe TTS', | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { defineConfig } from 'father'; | ||
|
||
export default defineConfig({ | ||
cjs: { output: 'dist' }, | ||
esm: { output: 'es' }, | ||
}); |
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 |
---|---|---|
|
@@ -30,3 +30,4 @@ jobs: | |
run: bun run release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
Empty file.
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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
import { type SsmlOptions, genSSML } from './genSSML'; | ||
|
||
const API = | ||
'https://southeastasia.api.speech.microsoft.com/accfreetrial/texttospeech/acc/v3.0-beta1/vcg/speak'; | ||
|
||
export const postMicrosoftSpeech = (text: string, options: SsmlOptions): [any, any] => { | ||
const data = JSON.stringify({ | ||
offsetInPlainText: 0, | ||
properties: { | ||
SpeakTriggerSource: 'AccTuningPagePlayButton', | ||
}, | ||
ssml: genSSML(text, options), | ||
ttsAudioFormat: 'audio-24khz-160kbitrate-mono-mp3', | ||
}); | ||
|
||
const DEFAULT_HEADERS = { | ||
'accept': '*/*', | ||
'accept-language': 'zh-CN,zh;q=0.9', | ||
'authority': 'southeastasia.api.speech.microsoft.com', | ||
'content-type': 'application/json', | ||
'customvoiceconnectionid': uuidv4(), | ||
'origin': 'https://speech.microsoft.com', | ||
'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"', | ||
'sec-ch-ua-mobile': '?0', | ||
'sec-ch-ua-platform': '"Windows"', | ||
'sec-fetch-dest': 'empty', | ||
'sec-fetch-mode': 'cors', | ||
'sec-fetch-site': 'same-site', | ||
'user-agent': | ||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', | ||
}; | ||
|
||
return [ | ||
API, | ||
{ | ||
body: data, | ||
headers: DEFAULT_HEADERS, | ||
method: 'POST', | ||
responseType: 'arraybuffer', | ||
}, | ||
]; | ||
}; |
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,9 @@ | ||
--- | ||
title: Changelog | ||
description: New updates and improvements to @lobehub/ui | ||
nav: | ||
title: Changelog | ||
order: 999 | ||
--- | ||
|
||
<embed src="../CHANGELOG.md"></embed> |
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,7 @@ | ||
--- | ||
hero: | ||
title: LobeHub <b>TTS</b> | ||
description: A high-quality & reliable TTS React Hooks library | ||
--- | ||
|
||
<code src="./index.tsx" inline></code> |
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,11 @@ | ||
import { Snippet } from '@lobehub/ui'; | ||
import { Center } from 'react-layout-kit'; | ||
|
||
export default () => { | ||
return ( | ||
<Center style={{ marginTop: -88 }}> | ||
<h2 style={{ fontSize: 20 }}>To install Lobe TTS, run the following command:</h2> | ||
<Snippet language={'bash'}>{'$ bun add @lobehub/tts'}</Snippet> | ||
</Center> | ||
); | ||
}; |
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 was deleted.
Oops, something went wrong.
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,13 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"automerge": false, | ||
"dependencyDashboard": true, | ||
"ignoreDeps": [], | ||
"labels": ["dependencies"], | ||
"postUpdateOptions": ["yarnDedupeHighest"], | ||
"prConcurrentLimit": 30, | ||
"prHourlyLimit": 0, | ||
"rebaseWhen": "conflicted", | ||
"schedule": "on sunday before 6:00am", | ||
"timezone": "UTC" | ||
} |
Oops, something went wrong.