Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpVoice::SetVolume

ISpVoice::SetVolume sets the synthesizer output volume level of the voice in real time. The default base volume for all voices is 100 (full volume).

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetVolume(</strong> <strong> USHORT </strong> <em>usVolume</em> <strong>);</strong> </pre>

Parameters

  • usVolume
    [in] Value containing the requested volume level. Volume levels are specified in percentage values ranging from zero to 100 - values outside this range may be truncated.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more parameters are invalid.

Remarks

SetVolume affects the volume of synthesized WAV data; it does not affect the volume of the .WAV file that is played back. Volume is specified as a percentage of the maximum volume of the current voice. Different voices may have different maximum volume levels.

Applications can adjust the volume of a voice either through this function call, or using Speech Synthesis Markup Language (SSML) passed to the voice with the input text of a speak call.The voice should combine volume adjustments made in these two ways to arrive at a final volume.

See Speech Synthesis Markup Language Reference (Microsoft.Speech) for information about suport for SSML by the Microsoft Speech Platform.