ISpStreamFormatConverter (Windows CE 5.0)
This interface is the primary interface implemented by the SAPI audio data format converter. The format converter is used by SAPI to compensate for differences between supported SR and TTS engine formats, and the I/O formats requested by the application. Typically applications and engines do not use this object directly. The format converter is a wrapper object that encapsulates the specified base stream. It performs on-the-fly conversion during read/write operations. The conversion is performed by the Windows ACM layer (Audio Compression Manager).
Several methods are included in addition to the ISpStreamFormat interface to allow data conversion.
Implemented By
- SpStreamFormatConverter
Remarks
SAPI uses the installed host system audio codecs to perform the conversion. SAPI currently supports 1-stage and 2-stage stream conversions, but does not support 3-or-more-stage conversions.
An example of a 1-stage stream format conversion is the conversion of a PCM format to another PCM format (for example, 8kHz 16-bit Stereo PCM [SPSF_8kHz16BitStereo] -> 44kHz 8-bit Mono [SPSF_44kHz8BitMono]). This requires only one codec (for example, "Microsoft PCM Converter").
An example of a 2-stage stream conversion is the conversion of a compressed format to a PCM format (for example, TrueSpeech 8kHz 1-Bit Mono [SPSF_TrueSpeech_8kHz1BitMono] -> 8kHz 8-bit Mono PCM [SPSF_8kHz8BitMono] -> 44kHz 16-bit Stereo [SPSF_44kHz16BitStereo]). This requires two codecs (for example, "DSP Group TrueSpeech(TM) Audio" and "Microsoft PCM Converter"). One of the formats must be a PCM format.
An example of an unsupported 3-stage stream conversion is the conversion of a compressed format to another compressed format (for example, TrueSpeech 8kHz 1-Bit Mono [SPSF_TrueSpeech_8kHz1BitMono] -> 8kHz 8-bit Mono PCM [SPSF_8kHz8BitMono] -> 8kHz 8-bit Stereo PCM [SPSF_8kHz8BitStereo] -> ALaw 8kHz Stereo [SPSF_CCITT_ALaw_8kHzStereo]). This would require three codecs (for example, "DSP Group TrueSpeech(TM) Audio", "Microsoft PCM Converter", and "Microsoft CCITT G.771 Audio"). SAPI is capable of converting between two compressed non-PCM formats if a single codec can do the entire conversion.
Methods
The following table lists the methods for the ISpStreamFormatConverter interface.
Method | Description |
---|---|
GetBaseStream | Gets the base audio stream that is being wrapped. |
ResetSeekPosition | Resets the format converter's stream seek position to the start of the stream. |
ScaleBaseToConvertedOffset | Maps an offset in the base stream into an offset in the converted stream. |
ScaleConvertedToBaseOffset | Maps an offset in the converted stream into an offset in the base stream. |
SetBaseStream | Sets audio stream to be wrapped by the format converter. |
SetFormat | Sets the conversion (output) format. |
Requirements
OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.
See Also
Send Feedback on this topic to the authors