fix: WeChat login Content-Type header, ASR tiny model, re-upload mini-program v1.0.11
This commit is contained in:
@@ -19,7 +19,7 @@ export class TtsController {
|
||||
throw new HttpException('文本不能为空且不超过500字', HttpStatus.BAD_REQUEST)
|
||||
}
|
||||
const result = await this.ttsService.synthesize(text, voice)
|
||||
return { hash: result.hash, durationMs: result.durationMs }
|
||||
return { hash: result.hash, durationMs: result.durationMs, amplitudeData: result.amplitudeData }
|
||||
}
|
||||
|
||||
@Public()
|
||||
@@ -59,8 +59,7 @@ export class TtsController {
|
||||
const parsed = JSON.parse(result)
|
||||
if (parsed.text) return { text: parsed.text.trim() }
|
||||
}
|
||||
const whisperBin = '/root/.local/bin/whisper'
|
||||
const whisperResult = execSync(`${whisperBin} "${dest}" --language zh --output_format txt 2>/dev/null`, { encoding: 'utf8', timeout: 60000 })
|
||||
const whisperResult = execSync(`python3 -c 'import sys, whisper; model = whisper.load_model("tiny"); print(model.transcribe(sys.argv[1], language="zh")["text"].strip())' "${dest}"`, { encoding: 'utf8', timeout: 60000 })
|
||||
if (whisperResult && whisperResult.trim()) {
|
||||
return { text: whisperResult.trim() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user