node-edge-tts
Advanced tools
Comparing version 1.2.2 to 1.2.3
10
bin.js
@@ -13,2 +13,5 @@ #!/usr/bin/env node | ||
outputFormat: { type: 'string', alias: 'o', describe: 'The output format' }, | ||
pitch: { type: 'string', describe: 'The pitch of the voice' }, | ||
rate: { type: 'string', alias: 'r', describe: 'The rate of the voice' }, | ||
volume: { type: 'string', describe: 'The volume of the voice'}, | ||
saveSubtitles: { type: 'boolean', alias: 's', describe: 'Whether to save subtitles' }, | ||
@@ -22,2 +25,5 @@ proxy: { type: 'string', alias: 'p', describe: 'example: http://localhost:7890' }, | ||
outputFormat: 'audio-24khz-48kbitrate-mono-mp3', | ||
pitch: 'default', | ||
rate: 'default', | ||
volume: 'default', | ||
saveSubtitles: false | ||
@@ -28,4 +34,4 @@ }) | ||
const { text, filepath, voice, lang, outputFormat, saveSubtitles, proxy } = argv | ||
const tts = new EdgeTTS({ voice, lang, outputFormat, saveSubtitles, proxy }) | ||
const { text, filepath, voice, lang, outputFormat, pitch, rate, volume, saveSubtitles, proxy } = argv | ||
const tts = new EdgeTTS({ voice, lang, outputFormat, pitch, rate, volume, saveSubtitles, proxy }) | ||
@@ -32,0 +38,0 @@ ;(async () => { |
@@ -13,2 +13,5 @@ import { WebSocket } from 'ws'; | ||
proxy?: string; | ||
rate?: string; | ||
pitch?: string; | ||
volume?: string; | ||
}; | ||
@@ -21,3 +24,6 @@ declare class EdgeTTS { | ||
private proxy; | ||
constructor({ voice, lang, outputFormat, saveSubtitles, proxy }?: configure); | ||
private rate; | ||
private pitch; | ||
private volume; | ||
constructor({ voice, lang, outputFormat, saveSubtitles, proxy, rate, pitch, volume }?: configure); | ||
_connectWebSocket(): Promise<WebSocket>; | ||
@@ -24,0 +30,0 @@ _saveSubFile(subFile: subLine[], text: string, audioPath: string): void; |
@@ -18,3 +18,3 @@ "use strict"; | ||
class EdgeTTS { | ||
constructor({ voice = 'zh-CN-XiaoyiNeural', lang = 'zh-CN', outputFormat = 'audio-24khz-48kbitrate-mono-mp3', saveSubtitles = false, proxy } = {}) { | ||
constructor({ voice = 'zh-CN-XiaoyiNeural', lang = 'zh-CN', outputFormat = 'audio-24khz-48kbitrate-mono-mp3', saveSubtitles = false, proxy, rate = 'default', pitch = 'default', volume = 'default' } = {}) { | ||
this.voice = voice; | ||
@@ -25,2 +25,5 @@ this.lang = lang; | ||
this.proxy = proxy; | ||
this.rate = rate; | ||
this.pitch = pitch; | ||
this.volume = volume; | ||
} | ||
@@ -126,3 +129,5 @@ _connectWebSocket() { | ||
<voice name="${this.voice}"> | ||
${text} | ||
<prosody rate="${this.rate}" pitch="${this.pitch}" volume="${this.volume}"> | ||
${text} | ||
</prosody> | ||
</voice> | ||
@@ -129,0 +134,0 @@ </speak>`); |
{ | ||
"name": "node-edge-tts", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "node-edge-tts is a module that using Microsoft Edge's online TTS (Text-to-Speech) service on the Node.js", | ||
@@ -21,3 +21,5 @@ "keywords": [ | ||
"homepage": "https://github.com/SchneeHertz/node-edge-tts", | ||
"scripts": {}, | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"author": "SchneeHertz", | ||
@@ -24,0 +26,0 @@ "license": "MIT", |
@@ -32,2 +32,5 @@ # node-edge-tts | ||
[string] [default: "audio-24khz-48kbitrate-mono-mp3"] | ||
--pitch The pitch of the voice [string] [default: "default"] | ||
-r, --rate The rate of the voice [string] [default: "default"] | ||
--volume The volume of the voice [string] [default: "default"] | ||
-s, --saveSubtitles Whether to save subtitles [boolean] [default: false] | ||
@@ -64,5 +67,8 @@ -p, --proxy example: http://localhost:7890 [string] | ||
proxy: 'http://localhost:7890', | ||
pitch: '-10%', | ||
rate: '+10%', | ||
volumn: '-50%' | ||
}) | ||
``` | ||
You can find the available options for speechconfig at [voice/lang](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)|[outputFormat](https://learn.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.speechsynthesisoutputformat?view=azure-dotnet), but not all options are accessible due to limitations of the services provided by Microsoft Edge. | ||
You can find the available options for speechconfig at [voice/lang](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)|[outputFormat](https://learn.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.speechsynthesisoutputformat?view=azure-dotnet)|[pitch/rate/volume](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup-voice), but not all options are accessible due to limitations of the services provided by Microsoft Edge. | ||
@@ -69,0 +75,0 @@ ### subtitles |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14884
207
96