mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 09:15:41 +08:00
fix: 修复导出的音频文件变调、变速的问题
This commit is contained in:
1 parent
517e650942
commit
5e268cd8f4
2 files changed
+25
-41
No files matched your search
@@ -125,7 +125,11 @@ export class VoiceService {
|
||||
codec: 'silk',
|
||||
sourceHash: createHash('sha256').update(silkData).digest('hex')
|
||||
})
|
||||
const wavData = this.createWavBuffer(decoded.pcm, 24000)
|
||||
const wavData = this.createWavBuffer(
|
||||
decoded.pcm,
|
||||
decoded.sampleRate,
|
||||
decoded.channels
|
||||
)
|
||||
const data = wavData.toString('base64')
|
||||
const cacheKey = this.buildCacheKey(
|
||||
reference.sessionId,
|
||||
@@ -239,7 +243,7 @@ export class VoiceService {
|
||||
|
||||
private createWavBuffer(
|
||||
pcmData: Buffer,
|
||||
sampleRate: number = 24000,
|
||||
sampleRate: number = 16000,
|
||||
channels: number = 1
|
||||
): Buffer {
|
||||
const pcmLength = pcmData.length
|
||||
|
||||
Reference in new issue
Block a user