Welcome to GotSpeech.NET Sign in | Join | Help

Quickly Creating Prompt Databases Using PromptEdit.exe

The Process:

When a new speech project comes in I receive a Voice User Interface (VUI) specification. One of the things this document contains is a list of all possible messages and their message numbers. Here is a sample of what that message list might look for a zip code collection application:

Application Messages From VUI Specification:

(*Note: We always start message numbers at 500 but you can choose something else)

  • Message: "Hi! Thanks for calling the sample zip code collector application." Message Number: 500
  • Message: "Please say or enter your five digit zip code." Message Number: 501
  • Message: "I didn't catch that. Please say or enter your five digit zip code, one digit at a time." Message 502
  • Message: "I still didn't get that. Please use your telephone keypad to enter your 5 digit zip code." Message 503
  • Message: "I seem to be having some trouble collecting your zip code at this time." Message 504
  • Message: "That zip code was" Message 505
  • Message: "Is that correct?" Message 506
  • Message: "Sorry about that." Message 507
  • Message: "Thank you for calling!" Message 508

System Messages (Messages that are common across all applications):

(These are not usually in the VUI specification)

  • Message: "one" Message 1
  • Message: "two" Message 2
  • Message: "three" Message 3
  • Message: "four" Message 4
  • Message: "five" Message 5
  • Message: "six" Message 6
  • Message: "seven" Message 7
  • Message: "eight" Message 8
  • Message: "nine" Message 9

The Problem:

The prompt databases for my applications always seem to be changing. Throughout the development and testing process we are tweaking the message list to make the application sound just right to the caller and meet the requirements of the customer.

Until I receive the professional recordings I will usually record my own voice messages for testing then drop in the professional recordings when they are finished. When the customer listens to the application there may be more changes or the customer may decide on a completely different Persona (voice talent). As you listen to the application sometimes you will notice that a message is too loud or too soft. You can normalize the prompts or edit them individually.

The prompt database editor is a great tool that allows you to manually perform all these changes. However, after several rounds of changes the prompt database evolves into a creative soup of edited wave files and their extractions that is not easy to reproduce if you needed to start from scratch with new wave files.

The Dream:

What I would like to do is to just drop the new messages in a directory run a script and have it create my new prompt database from scratch any time I wanted.

The Solution:

PromptEdit.exe

According to the MSDN documentation:

"Command Line Tool for Editing Prompt Databases

A new command line utility, PromptEdit.exe, enables developers to manipulate .promptdb files outside of the Visual Studio .NET 2003 environment. Using this tool, developers can add or delete .wav files, single extractions, or multiple extractions, as well as delete prompts by ID.

PromptEdit.exe is a cool utility found in C:\Program Files\Microsoft Speech Application SDK 1.1\SDKTools directory. It takes as its main input a text file that contains a listing of wav file locations and their extraction text. Typically what I do is create a wav file directory and place all my wav files in that directory. Then create a PromptImport.txt file that contains the listing of all the wav files and their extractions. Then I create a batch file that calls the PromptEdit.exe utility with the correct command line parameters.

Contents of my batch file buildpromptdb.bat:

  • REM This batch file will create a prompt database file named ApplicationPrompts.promptdb.
  • REM *** Change the SDKTOOLS environment variable to your location ***
  • SET SDKTOOLS=C:\Program Files\Microsoft Speech Application SDK 1.1\SDKTools
  • ECHO Calling PromptEdit.exe in SDK Tools Directory: %SDKTOOLS%
  • "%SDKTOOLS%\PromptEdit.exe" ApplicationPrompts.promptdb /addfile:PromptList.txt /remdup /delrec /log:PromptUpdate.txt

Explanation of PromptEdit.exe parameters:

/addfile:PromptList.txt

From MSDN: 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.

Sample Contents of PromptImport.txt (These must be tab delimited, mine are not here):

  • [That zip code was{male;english}<505>]     wav\505.wav
  • [Is that correct?{male;english}<506>]      wav\506.wav
  • [Sorry about that{male;english}<507>]      wav\507.wav
  • [Thank you for calling{male;english}<508>] wav\508.wav
  • [one{male;english}<1>]                     wav\1.wav
  • [two{male;english}<2>]                     wav\2.wav
  • [three{male;english}<3>]                   wav\3.wav
  • [four{male;english}<4>]                    wav\4.wav
  • [five{male;english}<5>]                    wav\5.wav
  • [six{male;english}<6>]                     wav\6.wav
  • [seven{male;english}<7>]                   wav\7.wav
  • [eight{male;english}<8>]                   wav\8.wav
  • [nine{male;english}<9>]                    wav\9.wav
  • [zero{male;english}<10>]                   wav\10.wav

For more information on extractions see the MSDN documentation:

The extraction text [one{male;english}<1>] indicates that this wav file is a recording of the word "one" with two tags of "male" and "english" and an extraction id of <1> (This makes me think you could do a multilingual and persona changes dynamically by switching the tags. Hmm, I will have to investigate this...). I use the name of the wav file as the extraction id but you can use a naming method that is better suited to you.

*A special note on extraction text from MSDN that can help you in determining why your application is playing TTS instead of the recorded prompts:

Some punctuation does not appear in the extractions, even though it appears in the display text. If the punctuation does not appear in the transcription or extraction, using it in prompt text results in the text-to-speech (TTS) engine playing the prompt. For instance, if "A - B" is entered in the Transcription field, it appears as "A B", even though the Display Text field shows "A - B", and it appears in the Extraction pane as "A B", with no hyphen. If "A - B" is used in prompt text, the TTS engine renders it as "A B".

/remdup

Specifies removal of any extractions already in the database that have Extraction IDs matching the IDs of any extractions being added. I make sure that I have this option because I want to rebuild my prompt database every time I run the batch script. If I didn't have this I would have duplicate extractions in my prompt database.

/delrec

Specifies the deletion of the entire recording from the .promptdb file if deletion of an extraction results in an unused recording. Again this keeps your prompt database clean on a rebuild.

/log:PromptUpdate.txt

Specifies the name of a log file that will contain the results of the PromptEdit.exe operation. If necessary, the file name may be in quotes.

Using PromptEdit.exe in Production

According to the MSDN documentation: This is particularly useful in a production environment where it is often necessary to edit prompt databases on a recurring basis or on short notice due to transient or emergency conditions."

One of the things that confuses me about this statement is that for this to work you would either have to install the SpeechSDK on the WebServer or copy the PromptEdit.exe to the WebServer. I am not even sure this is allowed in the EULA. On the Web Server I only install the Speech Controls not the entire SpeechSDK and Visual Studio 2003. Also, the PromptEdit.exe utility only creates/edits .promptdb files which still have to be built into .prompts file to be used by Speech Server. You can use the utility BuildPrompts.exe or just build your prompt project inside Visual Studio to create the .prompts file.

To me the PromptEdit.exe is better suited for the developer in the day to day routine of building prompts and helps save tons of time later in the project when you finally receive the professionally recorded prompts.

Once you reach production if someone needs to remove an abstraction or make a change this is still done on the development machine (laptop) and the new .prompts are sent over to the production server.

And also According to the MSDN documentation:

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.

If you need to give a customer the ability to change wave files like an introductory message or special campaign (like a gold credit card member) then the best way to do this is for your application to reference actual wave files (using the content salt tag) and not the prompt database. Then the customer can simply replace the wave file on the web server and the application will pick up the new wav file.

Building and Using the Prompt Database

Once I have this prompt database that is created by the batch script I build it inside Visual Studio to produce the .prompts file that is used by the speech application. You can also add the calling of the batch file to a postbuild event if you want to automate the calling of this batch file. Place the above command inside a batch file (.bat file or .cmd file). Unfortunately, the prompt project does not have the idea of pre-build and post-build actions. So, you have to add it to either a class library project or another type of project and make this project a dependency of the prompt project so it will build in the correct order before the prompt project. Right click on this project and select the build tab. In the pre-build event box type the name of your batch file and click ok. Then whenever you perform a build it will rebuild the prompt database.

When I want to play the recorded prompts in the prompt database I use the <peml:div> Place Prompt Text Here</peml:div> tags in the prompt functions.

PromptEdit.exe makes our life easier as a developer, just drop the new wave files in the wav directory, update your PromptImport.txt file and re-run your batch script. Done!

Also, the prompt database is here to stay for MSS 2007 so this post applies to the future version as well.

Leave a comment here and tell me how you create and maintain your prompt databases.

Technorati Tags:

Published Friday, August 18, 2006 12:04 PM by brandontyler
Filed under: ,

Comments

# GotSpeech.Net Podcast #6 Pizza Tutorial: Creating Prompts

The Show: GotSpeech.Net has an official into song! Check out csharprox 's creative work. Microsoft to

Monday, March 26, 2007 12:26 PM by Speech Served Here

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Thanks for this article - the docs are a little spare.  I have created a file that looks valid to me, but for every line, I get "Failed to import wav: . . . " The wav files exist and are valid.  I've tried with my wav files on both a network drive and a local drive with the same effect.  

Any ideas much appreciated.  Thanks.

Here are a few lines:

[To randomize a subject, press one. To record a subject visit, press two. To record subject deactivation or reactivation, press three. <007MMENU>] "C:\Program Files\Acarda\Acarda VoxConverter\Prompts\English\007MMENU.wav"

[Please enter the six-digit subject number of the subject you would like to randomize. <007RAND>] "C:\Program Files\Acarda\Acarda VoxConverter\Prompts\English\007RAND.wav"

[To practice randomizing a subject, press one. To practice recording a subject visit, press two. To practice recording subject deactivation or reactivation, press three.  <007TRAIN>] "C:\Program Files\Acarda\Acarda VoxConverter\Prompts\English\007TRAIN.wav"

Tuesday, July 01, 2008 8:43 PM by SydneyOs

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Do you have the /remdup and /delrec parameters being passed to PromptEdit.exe?

"%SDKTOOLS%\PromptEdit.exe" PromptDBName.promptdb /addfile:messagesimport.txt /remdup /delrec

Wednesday, July 02, 2008 11:01 AM by brandontyler

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Or perhaps it doesn't like the spaces in Acarda VoxConverter?

Try to put it under the directory you are running the script like:

"[Extraction text{501}<501>]" wav\501.wav

See what that does.

Wednesday, July 02, 2008 11:04 AM by brandontyler

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Thanks, Brandon - I ended up changing my text file to just be a series of calls to PromptEdit and that worked.  

PromptEdit.exe "Prompts.promptdb" /add:["To randomize a subject, press one. To record a subject visit, press two. To record subject deactivation or reactivation, press three. <9MCRGRM>]" /wave:"C:\Program Files\Acarda\Acarda VoxConverter\Prompts\English\9MCRGRM.wav"

Tuesday, July 08, 2008 6:39 PM by SydneyOs

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Another quick question - PromptEdit converted my apostrophes into an AE character - anyone else seen this or have a fix?

Thursday, July 10, 2008 2:37 PM by SydneyOs

# re: Quickly Creating Prompt Databases Using PromptEdit.exe

Really?

I use:

"[I'm having trouble recognizing you.{640}<640>]" wav\640.wav

and it seems to work just fine.

Perhaps because it is through the command line, line by line.

Thursday, July 10, 2008 5:11 PM by brandontyler
Anonymous comments are disabled