@ww_nero/media 1.0.10 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,12 +27,9 @@
27
27
  **参数:**
28
28
  - `working_directory`: 工作目录的绝对路径,合成的音频文件将保存到此目录
29
29
  - `text`: 需要合成语音的文本内容
30
- - `voice`: (可选)音色模型,默认 `sambert-zhimiao-emo-v1`
31
- - `format`: (可选)输出音频格式,可选 mp3(默认)、wav、pcm
32
- - `sample_rate`: (可选)采样率,默认 16000
33
30
 
34
31
  **输出:**
35
- - 合成结果保存到工作目录下的 `tts_<timestamp>.<format>` 文件
32
+ - 合成结果保存到工作目录下的 `tts_<timestamp>.mp3` 文件
36
33
 
37
34
  ## 环境变量
38
35
 
package/index.js CHANGED
@@ -114,7 +114,7 @@ const resolveAudioFile = (workingDir, rawPath) => {
114
114
  const server = new Server(
115
115
  {
116
116
  name: 'media',
117
- version: '1.0.10',
117
+ version: '1.1.0',
118
118
  },
119
119
  {
120
120
  capabilities: {
@@ -157,18 +157,6 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
157
157
  type: 'string',
158
158
  description: '需要合成语音的文本内容',
159
159
  },
160
- voice: {
161
- type: 'string',
162
- description: '音色模型,可选值如 sambert-zhimiao-emo-v1(默认)、sambert-zhichu-v1 等',
163
- },
164
- format: {
165
- type: 'string',
166
- description: '输出音频格式,可选 mp3(默认)、wav、pcm',
167
- },
168
- sample_rate: {
169
- type: 'number',
170
- description: '采样率,默认 16000',
171
- },
172
160
  },
173
161
  required: ['working_directory', 'text'],
174
162
  },
@@ -192,7 +180,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
192
180
  }
193
181
 
194
182
  if (name === 'tts') {
195
- const { working_directory, text, voice, format, sample_rate } = args;
183
+ const { working_directory, text } = args;
196
184
  if (!working_directory || !text) {
197
185
  throw new Error('必须同时提供 working_directory 和 text 参数');
198
186
  }
@@ -201,9 +189,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
201
189
  workingDir,
202
190
  text,
203
191
  apiKey: DASHSCOPE_API_KEY,
204
- voice: voice || 'sambert-zhimiao-emo-v1',
205
- format: format || 'mp3',
206
- sampleRate: sample_rate || 16000,
207
192
  });
208
193
  return { content: [{ type: 'text', text: `语音合成完成,音频文件已保存到工作目录下:${filename}` }] };
209
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ww_nero/media",
3
- "version": "1.0.10",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for media processing, including ASR speech recognition and TTS speech synthesis",
5
5
  "main": "index.js",
6
6
  "bin": {
package/utils/tts.js CHANGED
@@ -8,7 +8,12 @@ const TTS_WS_URL = 'wss://dashscope.aliyuncs.com/api-ws/v1/inference/';
8
8
  /**
9
9
  * TTS 语音合成
10
10
  */
11
- const tts = async ({ workingDir, text, apiKey, voice = 'sambert-zhimiao-emo-v1', format = 'mp3', sampleRate = 16000 }) => {
11
+ const tts = async ({ workingDir, text, apiKey }) => {
12
+ // 固定参数
13
+ const voice = 'sambert-zhimiao-emo-v1';
14
+ const format = 'mp3';
15
+ const sampleRate = 16000;
16
+
12
17
  // 验证 API Key
13
18
  if (!apiKey) {
14
19
  throw new Error('请配置 DASHSCOPE_API_KEY 环境变量');