mirror of
https://github.com/pstrueb/piper.git
synced 2026-04-23 00:04:49 +00:00
Add multispeaker
This commit is contained in:
@@ -53,6 +53,15 @@ void synthesize(SynthesisConfig &synthesisConfig, ModelSession &session,
|
||||
Ort::Value::CreateTensor<float>(memoryInfo, scales.data(), scales.size(),
|
||||
scalesShape.data(), scalesShape.size()));
|
||||
|
||||
if (synthesisConfig.speakerId) {
|
||||
// Add speaker id
|
||||
vector<int64_t> speakerId{(int64_t)synthesisConfig.speakerId.value()};
|
||||
vector<int64_t> speakerIdShape{1};
|
||||
inputTensors.push_back(Ort::Value::CreateTensor<int64_t>(
|
||||
memoryInfo, speakerId.data(), speakerId.size(), speakerIdShape.data(),
|
||||
speakerIdShape.size()));
|
||||
}
|
||||
|
||||
// Infer
|
||||
auto startTime = chrono::steady_clock::now();
|
||||
auto outputTensors =
|
||||
|
||||
Reference in New Issue
Block a user