实用工具
获取已下载语音模型名称
获取所有已下载语音模型的名称
- 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
}