-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hi, I can't generate audio using standard version
It said bad request.
Could you please check if I missed any information?
Error generating audio: { message: 'Request failed with status code 400', code: 'ERR_BAD_REQUEST', statusCode: undefined, statusMessage: undefined }
My code is below:
`
// Import the PlayHT SDK
const PlayHT = require('playht');
// Initialize PlayHT with API credentials
PlayHT.init({
apiKey: 'key',
userId: 'userId',
});
// Function to generate audio
async function generateAudio() {
try {
const text = '在中国,传统节日和美食文化丰富多彩。每年农历新年,人们都会和家人团聚,吃饺子、年糕等传统食品,以庆祝新的一年。';
// Generate audio from text
const generated = await PlayHT.generate(text, {
voiceEngine: 'Standard',
voiceId: 'zh-CN-XiaoshuangNeural',
quality: 'low',
speed: 0.8,
});
// Grab the generated file URL
const { audioUrl } = generated;
console.log('The url for the audio file is', audioUrl);
} catch (error) {
console.error('Error generating audio:', error);
}
}
// Run the function to generate audio
generateAudio();
`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels