generated from tailored/router-template
tts for cosyvoice and funasr and aliyun
This commit is contained in:
28
src/tts/provider/cosyvoice/test/tts.ts
Normal file
28
src/tts/provider/cosyvoice/test/tts.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Client } from '@gradio/client';
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
|
||||
// const videoTestPath = path.join(process.cwd(), 'videos/asr_example.wav');
|
||||
// const videoTestPath = path.join(process.cwd(), 'videos/asr_example2.wav');
|
||||
// const videoTestPath = path.join(process.cwd(), 'videos/tts_mix.mp3');
|
||||
const videoTestPath = path.join(process.cwd(), 'videos/my_speech_text.wav');
|
||||
const name = 'output-1746007775571.mp3';
|
||||
const videoTestPath2 = path.join(process.cwd(), 'build', name);
|
||||
const exampleAudio = fs.readFileSync(videoTestPath);
|
||||
// const exampleAudio = await response_0.blob();
|
||||
|
||||
const client = await Client.connect('http://192.168.31.220:50000/');
|
||||
const result = await client.predict('/generate_audio', {
|
||||
tts_text: '梦里的一天结束了一个新的轮m,回梦里的一天结束了一个新的轮回梦里的一,,天结束了一个新的轮回,梦里的一天结束了一个新的轮回',
|
||||
mode_checkbox_group: '3s极速复刻',
|
||||
sft_dropdown: '',
|
||||
prompt_text: '在一无所知中,梦里的一天结束了一个新的轮回,便会开始。',
|
||||
prompt_wav_upload: exampleAudio,
|
||||
prompt_wav_record: null,
|
||||
instruct_text: '',
|
||||
seed: 3,
|
||||
stream: false,
|
||||
speed: 1,
|
||||
});
|
||||
|
||||
console.log(result.data);
|
||||
Reference in New Issue
Block a user