次の方法で共有


Muted audio even when the playback rate is set to a supported audio playback rate

Silverlight 5 supports multiple playback rates. When the playback rate is set to a rate that does not support audio playback, audio will be muted. If playback is reset back to 1 or to any value that supports audio playback after multiple rates that don’t support audio/pitch correction playback, the audio could still be muted.

To work around this issue, you can reset the volume when the playback rate is changed. The following code demonstrates one way to reset the volume.

 

void ME_RateChanged(object sender, RateChangedRoutedEventArgs e)

{

    // For playback rates that support audio playback, Enforce audio playback by resetting the MediaElement Volume property

    //to unmute audio after multiple playbackRate changes.

     if (e.NewRate <= 2  && e.NewRate >= 0.5)

     {

           ME.Volume = ME.Volume;

     }

}

-Nitya.

Comments

  • Anonymous
    December 21, 2011
    I am trying out this new feature (PlaybackRate) but I cannot change the value from 1.0. Is there something I need to enable to allow this value to be changed? I am playing WAV files.