Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
audio Element (Microsoft.Speech)
Supports the insertion of recorded audio files.
Syntax
<audio src="string" /> </audio>
Attributes
Attribute |
Description |
---|---|
src |
Required. Specifies the path and name of the audio file. The value of this attribute can be an absolute, local path for speech applications running in a local environment, but it must be an HTTP. This attribute is case-sensitive only when referencing files residing in file systems that are case-sensitive. |
The audio element supports WMA files and .WAV files containing RIFF headers and encoded with the following parameters.
Parameter |
Value |
---|---|
Format |
PCM, a-law, u-law |
Bit-depth |
8 bits, 16 bits |
Channels |
Mono only |
Sampling Rate |
All sampling rates supported. |
Remarks
Use this element to play a known audio file.
The content of a non-empty audio element should be the plain text or SSML marked-up text to be spoken if the audio file specified in the src attribute is either not available or unplayable. The content of a non-empty element can also include another audio element.
Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<p>
<audio src="http://www.treyresearch.net/audioprompts/opinionprompt.wav"> Thanks for offering your opinion. Please begin speaking after the beep. </audio>
<audio src="http://www.treyresearch.net/audioprompts/beep.wav"> The beep could not
be played, please voice your opinion now. </audio>
</p>
</speak>