SDK: WAV files
Microsoft WAV
Microsoft WAV files can contain many sub-formats including A-law, PCM, ADPCM. Each WAV file contains a header that says exactly what format the audio data is. In Windows XP you can right-click on WAV file and see this information, and you can also load a WAV into the Sound Recorder (soundrec) accessory to see the same information. For example, a CD-quality audio file might say:
Bit Rate 1411kbps
Audio sample size 16 bit
Channels 2 (stereo)
Audio sample rate 44 kHz
Audio format PCM
Whereas a voice prompt (used in a speech application) might say:
Bit Rate 128kbps
Audio sample size 16 bit
Channels 1 (mono)
Audio sample rate 8 kHz
Audio format PCM
Diva can only play WAV files that are in 8 kHz format. This is because it is not possible to resample audio from one sample rate to another on-the-fly. It just takes too much CPU to do this in the SDK. Resampling is an expensive operation that is best done off-line anyway, using an audio tool like soundrec, Winamp or Goldwave.
Diva understands 8-bit and 16-bit PCM formats, and can convert these automatically to line format (A-law or mu-law) on the fly. WAV files can contain A-law or mu-law samples, and Diva will also play these sub-formats. Other exotic WAV sub-formats (like IMA ADPCM) will not play.
NIST Sphere ‘WAV’ Files
Note that there is also an audio file format called NIST Sphere, which also uses the suffix ".WAV" for its audio files. Some speech applications understand Sphere files (Nuance, for example, have support for it). This format is completely incompatible with Microsoft WAV, and consequently Diva cannot play them. If you right-click on one of these files, Windows will not be able to tell you the format of the file, and Microsoft apps (like soundrec) cannot read them.
If a customer needs to play the contents of a Sphere file, then the only choices are (a) to write a Sphere decoder themselves or (b) use an offline utility to convert the Sphere files into something that the Diva will read, e.g. Microsoft WAV PCM-16.
Converting files
There are very many programs available that will convert WAV files between different formats; a search for 'WAV resample' or 'WAV change sample rate' will yield many of them. Â
File Contention
Sometimes the SDK will refuse to play a file because it doesn’t have exclusive rights to the file. For example, if an application already has a WAV file locked open for writing, then the Diva will not be able to play it at the same time.