如何使用函数 GetStorageFileName 将训练文件添加到注册表? [英] How to use the function GetStorageFileName for adding training files to registry?
问题描述
我正在使用 sapi 5.4,我能够保留用于训练的音频,但可以将其添加到注册表项中,如本 使用 SAPI 5.3 Speech API 进行声学训练 我无法理解用于 ISpObjectToken::GetStorageFileName 的参数有人可以帮助我它吗?
I am using sapi 5.4 and I am able to retain the audio for training but for adding it to registry entries as given in this Acoustic training using SAPI 5.3 Speech API I am not able to understand the arguments to be used for ISpObjectToken::GetStorageFileName can somebody help me out with it?
推荐答案
ISpObjectToken::GetStorageFileName
并不是世界上记录最完整的 API.幸运的是,我有一些有用的示例来帮助改进文档.
ISpObjectToken::GetStorageFileName
isn't the best documented API in the world. Luckily, I have some worked examples to help improve the documentation.
clsidCaller
如果您需要与对象标记关联的文件名,请设置此项.对于训练,这应该是 CLSID_NULL
.(如果您要更新与引擎相关的数据,那么它将是引擎的 CLSID.)
Set this if you need the file name associated with the object token. For training, this should be CLSID_NULL
. (If you're updating engine-related data, then it would be the CLSID of the engine.)
pszValueName
用于存储文件名的注册表子项的名称.对于训练,这应该是 L"TrainingAudio-
,其中 locale 应该是引擎的 4 位区域设置 ID.
The name of the registry subkey to store the filename in. For training, this should be L"TrainingAudio-<locale>"
, where locale should be the 4 digit locale ID for the engine.
pszFileNameSpecifier
要创建的文件名.
如果以X:\"或\"开头,则假定为完整路径.
If this starts with "X:\" or "\" it is assumed to be a full path.
否则,它被假定为相对于 nFolder 参数中给定的特殊文件夹 ID.
Otherwise it is assumed to be relative to the special folder ID given in the nFolder parameter.
如果 pszFileNameSpecifier 以 '\' 结尾,或者为 NULL,则将创建唯一的文件名.
If pszFileNameSpecifier ends with a '\', or is NULL a unique file name will be created.
如果名称包含 %d,则 %d 将替换为数字以给出唯一的文件名.
If the name contains a %d the %d is replaced by a number to give a unique file name.
对于训练,您应该指定类似 L"TrainingAudio\\TR_%d.wav" 的内容.
For training, you should specify something like L"TrainingAudio\\TR_%d.wav".
nFolder
标识要检索其路径的文件夹的 CSIDL 值.用户可以通过将文件夹的 CSIDL 与 CSIDL_FLAG_CREATE 结合来强制创建文件夹.如果 pszFileNameSpecifier 为 NULL 或\",如果用户想要强制创建文件,nFolder 必须具有指定的 CSIDL 文件夹和 CSIDL_FLAG_CREATE.
A CSIDL value that identifies the folder whose path is to be retrieved. The user can force the creation of a folder by combining the folder's CSIDL with CSIDL_FLAG_CREATE. If pszFileNameSpecifier is NULL or "\", nFolder must have a specified CSIDL folder combined with CSIDL_FLAG_CREATE if the user wants to force to create the file.
对于训练,这应该是 CSIDL_LOCAL_APPDATA |CSIDL_FLAG_CREATE
.
For training, this should be CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE
.
ppszFilePath
指向接收文件路径信息的以空字符结尾的字符串的指针的地址.完成后使用 CoTaskMemFree 释放字符串.
Address of a pointer to the null-terminated string that receives the file path information. Use CoTaskMemFree to release the string when done.
这篇关于如何使用函数 GetStorageFileName 将训练文件添加到注册表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!