Share via


Managing Prompt Databases

  Microsoft Speech Technologies Homepage

Use either the Visual Studio .NET 2003 graphical user interface (GUI) or the command line utility, BuildPrompts.exe, to build prompt projects. When building from the GUI, build either as part of a WebApplication solution, or separately as a prompt project. Additionally, there is command-line utility, PromptEdit.exe, for automated maintenance of .promptdb files in production environments. This topic describes the methods for building prompts and the use of the command-line utility for editing .promptdb files.

A prompt project consists of three file types.

  • The .prproj file is the prompt project file. This file contains the project settings and a list of the source files for the project. To add scripting files, the file types must match. That is, they must be either all .js (JScript) or all .vbs (VBScript) files. If the project contains both JScript and VBScript files, an error occurs during a build. The script files contain text normalization functions that modify the way prompts are spoken.
  • The .promptdb file is a working file containing transcription text, extraction data, and archived versions of the .wav files in their original recorded format.
  • JScript or VBScript script files

The product of a prompt project is a prompt database that is contained in a .prompts file. The build process creates a prompt database from the contents of the .promptdb files, .wav segments, and any JScript or VBScript files. The .prompts file is a binary file supported by the Microsoft Prompt Engine, version 5.2. A .prompts file uses only one wave format. During compilation, the build process converts all .wav files to the format selected in the project properties page. The default wave format is 8000Hz u-law.

A .prompts database is a single "compound" file. The file is binary, and contains all of the prompt information plus all of the audio data. The compile process copies wave segments from the .promptdb files and any added script files into the .prompts file and stores them. A .prompts file has no dependencies on any other files after compile time. All digital signal processing (DSP) occurs at compile time, when the .promptdb files convert to the .prompts files. DSP includes compression, resampling, and volume normalization.

In a newly created prompt project, the .promptdb file is in the same directory as the project's .prproj file. The build process places the compiled .prompts file in the Release directory, beneath the directory that contains the .prproj file. For example, a prompt project created in C:\MyPromptProj contains the file C:\MyPromptProj\MyPromptProj.promptdb, and after compilation, the build process creates the file C:\MyPromptProj\Release\MyPromptProj.prompts.

Note  Update the output location of the .prompts file at any time using the ProjectName Property Pages dialog box.

To build a prompt project

  1. In Solution Explorer, right-click the project.
  2. On the shortcut menu, select Build.

To build a WebApplication solution containing a prompt project

  1. In Solution Explorer, right-click the WebApplication solution.
  2. On the shortcut menu, select Build Solution.

Building from the Command Line

Build from the command line using BuildPrompts.exe, which is located in the SDKTools folder. If the Microsoft Speech Application SDK Version 1.1 (SASDK) is installed in the default location, the SDKTools folder can be found at:

%system drive%:\Program Files\Microsoft Speech Application SDK 1.1\SDKTools

Syntax

  BuildPrompts inputfile [/out:outputfile] [/format:format] [/freq:freq] [/filler] [/norm:options]
Option Parameter Definition
inputfile Specifies a text file listing full paths to .promptdb, .js, and .vbs files. This file must be in Unicode format.
out Specifies the name of the output file. By default, the output file has the same name as the .prproj file, but with a .prompts extension.
format Specifies the audio sample format. Options: pcm8, pcm16, a-law, or u-law. The default is a-law.
freq Specifies the audio sample frequency in Hz. For example, 22050. The default is 8000.
filler Generates placeholder wave data for entries without prerecorded audio.
norm Specifies volume normalization options. The default is none.
  • none performs no volume normalization.
  • max adjusts volume to maximize the highest peak.
  • file name.promptdb<recording.wav> matches volume to the indicated .wav file.

To build a prompt database using BuildPrompts.exe

  1. In a text editor, enter path information for the .promptdb files to be included in the build.
  2. Save the text file with Unicode encoding.
  3. On the taskbar, click Start, point to All Programs, point to Microsoft Speech Application SDK Version 1.1, point to Debugging Tools, and then on the shortcut menu, click Microsoft Speech Application SDK Command Prompt.
  4. Enter the appropriate BuildPrompts.exe syntax, and then press ENTER.

Choosing Build Settings

Use the Property Pages dialog box to change build settings, such as choice of build platform and selection of debug or release builds.

To open the Project Properties dialog box

  1. In Solution Explorer, select the prompt project name.
  2. On the Project menu, select Properties.

The build process converts all .wav files to the format selected in the Project Properties dialog box. For example, a project contains original recordings made at 44.1kHz PCM, but the project properties are set to produce 8kHz a-law. In this case, the build process places the converted versions in the compiled .prompts file. The original recordings remain untouched in the .promptdb file.

Select the Use filler for missing waveforms check box to generate placeholder wave data for entries without prerecorded audio.

Select a volume normalization option from the radio buttons in the Project Properties dialog box.

  • None applies no volume normalization.
  • Maximize peak per waveform adjusts volume to maximize the highest peak.
  • Match to promptdb recording matches volume to a specific .wav file in a .promptdb file. Enter the name of the .promptdb file in the promptdb name text box, and enter the name of the .wav file in the recording wave name text box.

Editing Prompt Databases from the Command Line

In production environments, it is often necessary to add or remove entries from prompt databases on a recurring basis—sometimes daily or even hourly—or on short notice, due to transient or emergency conditions. In such environments, automated methods for changes are preferable. The command-line utility, PromptEdit.exe, is applicable in such environments. It adds and deletes .wav files with corresponding extractions, as well as deleting prompts by ID. It can add or delete single extractions, or using lists in text files as input, it can add or delete multiple extractions.

This utility is located in the SDKTools folder. If the Microsoft Speech Application SDK Version 1.1 (SASDK) is installed in the default location, the SDKTools folder can be found at:

%system drive%:\Program Files\Microsoft Speech Application SDK 1.1\SDKTools

Syntax

  PromptEdit promptdbfile 
	[[/?] |
	[/add:"transcription"] [/wave:file.wav] [/remdup [/delrec]] [/noalignfail] |
	[/addfile:file.txt] [/remdup [/delrec]] [/noalignfail] |
	[/del:ID [/delrec]] |
	[/delfile:file.txt [/delrec]] 
	[enum:flags] [log:log.txt]]
Option Parameter Definition
promptdbfile Specifies the .promptdb file to modify.
add Specifies an extraction, enclosed in quotes, to add. For example, "one [two {tag}<ID>] three". The ID is the Extraction ID for the extraction. This value is displayed in the Extraction ID column in the Extractions pane. The entries in this column are editable from the Extractions pane.
wave Specifies a file in .wav format, containing the audio corresponding to the extraction. If necessary, the file name may be in quotes.
addfile Specifies a text file in ANSI or Unicode format containing extractions and corresponding audio files to add to the database. The text file has two tab-delimited entries per line, with each line ending in CRLF. The entries on each line are the extraction to add and the name of the corresponding .wav file. If necessary, the file name may be in quotes.
del Specifies the ID of an extraction to delete from the database.
delfile Specifies a text file in ANSI or Unicode format containing Extraction IDs for extractions to delete from the database. The text file has one ID per line, with each line ending in CRLF. If necessary, the file name may be in quotes.
remdup Specifies removal of any extractions already in the database that have Extraction IDs matching the IDs of any extractions being added.
delrec Specifies the deletion of the entire recording from the .promptdb file if deletion of an extraction results in an unused recording.
noalignfail Specifies that if alignment fails on the waveform being imported, the recording should not be added to the database, and to send the results to the console or log file. If not specified, the speech recognition (SR) engine creates alignments. If the SR engine fails to provide alignments, no alignments are added. Alignment cannot be specified manually.
enum Enumerates the extractions in the .promptdb file to the standard output device or to the log file. The flags consist of ID and/or text and/or tag in any order joined by the plus (+) sign. Enumeration will be tab-separated in the order specified with CRLF separation. For example: ID+tag
log Specifies the name of the log file. If necessary, the file name may be in quotes.

To edit a prompt database using PromptEdit.exe

  1. If necessary, in a text editor, create either a list of IDs to delete, or a tab-delimited list of extractions and corresponding .wav files, one per line.
  2. Save the text file with Unicode encoding.
  3. On the taskbar, click Start, point to Programs, point to Microsoft Speech Application SDK Version 1.1, point to Debugging Tools, and then on the shortcut menu, click Microsoft Speech Application SDK Command Prompt.
  4. Enter the appropriate PromptEdit.exe syntax, and then press ENTER.

Examples

The following command line adds the transcription "[one {digit}<1>] two three" with its marked extraction with Extraction ID 1 and the file 1.wav to myfile.promptdb. The command removes any other extraction with Extraction ID 1, and if the transcription has no extractions after the removal of the specified ID, it deletes the transcription and associated .wav file. If alignment fails on the waveform being added, the recording is not added to the prompt database.

  Promptedit myfile.promptdb /add:"[one {digit}<1>] two three" /wave:1.wav /remdup /delrec /noalignfail

The following command line adds the extraction [one {digit}<1>] with Extraction ID 1 from the file Recording One.wav to myfile.promptdb. The command removes any other extraction with ID 1.

  Promptedit myfile.promptdb /add:"[one {digit}<1>]" /wave:"Recording One.wav" /remdup

The following command line adds the extraction and corresponding .wav files as specified, one pair per line, in the file some text file.txt to myfile.promptdb. The command specifies that the Extraction ID for each extraction, followed by the extraction text, is written to logfile.txt.

  Promptedit myfile.promptdb /addfile:"some text file.txt" /enum:ID+text /log:logfile.txt

The following command line deletes the extraction with Extraction ID 1 from myfile.promptdb. If the transcription has no extractions after removal of the specified ID, the transcription and associated .wav file are deleted.

  Promptedit myfile.promptdb /del:1 /delrec

The following command line deletes the extractions specified, one per line, in the file ItemsToDelete.txt from myfile.promptdb. The command specifies that the Extraction ID for each extraction in the file is written to the standard output device.

  Promptedit myfile.promptdb /delfile:ItemsToDelete.txt /enum:ID

See Also

Prompting the User | Creating Prompts | Prompts | Managing Application Resources