mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
support google voice cloning (#956)
* support google voice cloning * wip
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Task = require('./task');
|
||||
const { TaskPreconditions } = require('../utils/constants');
|
||||
const { SpeechCredentialError } = require('../utils/error');
|
||||
const dbUtils = require('../utils/db-utils');
|
||||
|
||||
class TtsTask extends Task {
|
||||
|
||||
@@ -95,6 +96,18 @@ class TtsTask extends Task {
|
||||
} else if (vendor === 'playht') {
|
||||
credentials = credentials || {};
|
||||
credentials.voice_engine = this.options.voice_engine || credentials.voice_engine;
|
||||
} else if (vendor === 'google' && voice.startsWith('custom_')) {
|
||||
const {lookupGoogleCustomVoice} = dbUtils(this.logger, cs.srf);
|
||||
const arr = /custom_(.*)/.exec(voice);
|
||||
if (arr) {
|
||||
const google_custom_voice_sid = arr[1];
|
||||
const [custom_voice] = await lookupGoogleCustomVoice(google_custom_voice_sid);
|
||||
if (custom_voice.use_voice_cloning_key) {
|
||||
voice = {
|
||||
voice_cloning_key: custom_voice.voice_cloning_key,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user