工具
取得已下載的語音模型名稱
取得所有已下載語音模型的名稱
- Blueprint
- C++

TArray<FName> DownloadedVoiceModelNames = URuntimeTTSLibrary::GetDownloadedVoiceModelNames();
從名稱獲取語音模型
從名稱獲取語音模型物件
- Blueprint
- C++

FName VoiceModelName = TEXT("English (United States) - Ryan (High)"); // Assuming this is a valid voice model name
TSoftObjectPtr<URuntimeTTSModel> VoiceModel;
if (URuntimeTTSLibrary::GetVoiceModelFromName(VoiceModelName, VoiceModel))
{
// VoiceModel is now a valid voice model object
}
從模型獲取語音元數據
獲取特定語音模型的元數據
- Blueprint
- C++

URuntimeTTSModel* VoiceModel; // Assuming this is a valid voice model object
FTTSVoiceMetadata VoiceMetadata;
if (URuntimeTTSLibrary::GetVoiceMetadataFromModel(VoiceModel, VoiceMetadata))
{
// VoiceMetadata is now populated with the metadata of the voice model
}
從名稱獲取語音元數據
使用語音模型的名稱來獲取其元數據
- Blueprint
- C++

FName VoiceModelName = TEXT("English (United States) - Ryan (High)");
FTTSVoiceMetadata VoiceMetadata;
if (URuntimeTTSLibrary::GetVoiceMetadataFromName(VoiceModelName, VoiceMetadata))
{
// VoiceMetadata is now populated with the metadata of the voice model
}
從元數據獲取語音模型名稱
將語音元數據轉換為對應的模型名稱
- Blueprint
- C++

FTTSVoiceMetadata VoiceMetadata; // Assuming this is a populated voice metadata struct
FName VoiceModelName;
if (URuntimeTTSLibrary::GetVoiceModelNameFromMetadata(VoiceMetadata, VoiceModelName))
{
// VoiceModelName is now populated with the name of the voice model
}
從語音模型獲取說話者數量
獲取語音模型中可用的說話者數量
- Blueprint
- C++

URuntimeTTSModel* VoiceModel; // Assuming this is a valid voice model object
int32 NumOfSpeakers;
if (URuntimeTTSLibrary::GetSpeakerCountFromVoiceModel(VoiceModel, NumOfSpeakers))
{
// NumOfSpeakers is now populated with the number of speakers in the voice model
}
從模型名稱獲取說話者數量
使用語音模型的名稱獲取其中可用的說話者數量
- Blueprint
- C++

FName VoiceModelName = TEXT("English (United States) - Ryan (High)");
int32 NumOfSpeakers;
if (URuntimeTTSLibrary::GetSpeakerCountFromModelName(VoiceModelName, NumOfSpeakers))
{
// NumOfSpeakers is now populated with the number of speakers in the voice model
}