@ww_nero/media 1.0.7 → 1.0.8
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 +2 -2
- package/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const ASR_UPLOAD_URL = 'http://fsheep.com:10808/upload';
|
|
|
14
14
|
const ASR_SERVICE_URL = 'https://dashscope.aliyuncs.com/api/v1/services/audio/asr/transcription';
|
|
15
15
|
|
|
16
16
|
const SUPPORTED_AUDIO_TYPES = ['.mp3', '.wav'];
|
|
17
|
-
const MAX_FILE_SIZE_BYTES =
|
|
17
|
+
const MAX_FILE_SIZE_BYTES = 120 * 1024 * 1024; // 120MB
|
|
18
18
|
const LANGUAGE_HINTS = ['zh', 'en', 'ja'];
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -302,7 +302,7 @@ const asr = async ({ working_directory, audio_file }) => {
|
|
|
302
302
|
const fileSize = fs.statSync(audioPath).size;
|
|
303
303
|
if (fileSize > MAX_FILE_SIZE_BYTES) {
|
|
304
304
|
throw new Error(
|
|
305
|
-
`音频文件大小 ${(fileSize / 1024 / 1024).toFixed(2)}MB 超过限制(最大
|
|
305
|
+
`音频文件大小 ${(fileSize / 1024 / 1024).toFixed(2)}MB 超过限制(最大 120MB)。` +
|
|
306
306
|
`请先对音频进行分段处理后再逐段识别。`
|
|
307
307
|
);
|
|
308
308
|
}
|
|
@@ -337,7 +337,7 @@ const asr = async ({ working_directory, audio_file }) => {
|
|
|
337
337
|
const server = new Server(
|
|
338
338
|
{
|
|
339
339
|
name: 'media',
|
|
340
|
-
version: '1.0.
|
|
340
|
+
version: '1.0.8',
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
capabilities: {
|
|
@@ -360,7 +360,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
360
360
|
},
|
|
361
361
|
audio_file: {
|
|
362
362
|
type: 'string',
|
|
363
|
-
description: '音频文件的相对路径(相对于工作目录),支持 mp3/wav 格式,音频长度限制
|
|
363
|
+
description: '音频文件的相对路径(相对于工作目录),支持 mp3/wav 格式,音频长度限制 30 分钟以内,文件大小不超过 120MB',
|
|
364
364
|
},
|
|
365
365
|
},
|
|
366
366
|
required: ['working_directory', 'audio_file'],
|