我正在使用 Polly 生成文本转语音 MP3 文件。我想在每个文件的末尾添加 1 秒的暂停。我该怎么做?
这是我正在使用的:
// Load the SDK
const AWS = require('aws-sdk')
const Fs = require('fs')
AWS.config.loadFromPath('config.json');
// Create an Polly client
const Polly = new AWS.Polly({
signatureVersion: 'v4',
region: 'us-east-1'
})
let params = {
'Text': "This is the string I'm converting to MP3" ,
'OutputFormat': 'mp3',
'VoiceId': 'Kimberly'
}
Polly.synthesizeSpeech(params, (err, data) => {
if (err) {
console.log(err.code)
} else if (data) {
if (data.AudioStream instanceof Buffer) {
Fs.writeFile("./myverse.mp3", data.AudioStream, function(err) {
if (err) {
return console.log(err)
}
console.log("The file was saved!")
})
}
}
})