IDOL Speech Server can recommend language packs to use with a particular audio file, if provided with the file and a language code. This is helpful if multiple languages are defined for a single language code, or if you are not sure whether to use a broadband or telephony pack.
For IDOL Speech Server to recommend a language pack:
To find language packs to use with a file
Send the ResourceSelection
action to IDOL Speech Server, and set the following action parameters:
File
|
The audio file to find a language pack for. |
Lang
|
The language code. You can search using the base language code (for example, EN ) or the full code (for example, ENUS ). |
For example:
http://localhost:15000/action=ResourceSelection&Lang=ENUK&File=C:\data\sample.wav
This action requests the recommended British English language packs that you can use with the sample.wav
file.
The action returns a list of language packs that you can use in tasks that process the specified file. For example:
<autnresponse> <action>RESOURCESELECTION</action> <response>SUCCESS</response> <responsedata> <audioRate>16000</audioRate> <resourceRate>16000</resourceRate> <resources> <resource>enuk</resource> <resource>enuk-news</resource> </resources> </responsedata> </autnresponse>
In this example, IDOL Speech Server suggests the standard ENUK
language pack and a pack that contains the custom news
language model.
If you use the base code, IDOL Speech Server returns all language packs that cover the base language that you specified.
For example:
http://localhost:15000/action=ResourceSelection&Lang=EN&File=C:\data\sample.wav
This action requests the recommended language packs that cover the base language EN
that you can use with the sample.wav
file. For example:
<resources> <resource>enau</resource> <resource>enca</resource> <resource>enuk</resource> <resource>enus</resource> </resources>
The tasks configuration file contains language sections for each of the suggested resources.
The names of the resource configuration sections might be in a different case to the names returned by the ResourceSelection
action.
If IDOL Speech Server cannot find any suitable language packs, it still returns a SUCCESS
response (the action itself did not fail) but includes an explanatory message. For example:
<autnresponse> <action>RESOURCESELECTION</action> <response>SUCCESS</response> <responsedata> <audioRate>16000</audioRate> <details> No suitable language packs found (lang code zhtw, with sample rate 16000) </details> </responsedata> </autnresponse>
Similarly, IDOL Speech Server provides details if it finds appropriate language packs, but they are unavailable for use (for example, unlicensed packs). If IDOL Speech Server finds appropriate language packs, but they are for the wrong sample frequency (for example, 8 kHz telephony packs for a 16 kHz audio file), IDOL Speech Server lists the packs but includes a warning in the details
section.
If the action fails (for example, because the audio is missing or in the wrong format), IDOL Speech Server returns an error message.
|