locked
MediaElement.Volume not changing the volume (HTC HD7) RRS feed

  • Question

  • Hi,

    I have a slider control that set ths volume of the media element.

     <MediaElement Name="_playSoundMediaElement"/>

            <TextBlock Text="Volume" 
                                   Foreground="{StaticResource PhoneForegroundBrush}"
                                   FontSize="20" Canvas.Left="12" Canvas.Top="242" />
            <Slider Canvas.Left="106" Canvas.Top="229" Width="299"
                    Minimum="0" Maximum="1"
                    ValueChanged="Slider_ValueChanged"/>


     private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
            {
                if(_playSoundMediaElement!=null)
                _playSoundMediaElement.Volume = (double)e.NewValue;
      
            }


    And I am setting the URI for the sound in another button click event.

    Volume does not change atall on the phone when I move the slider up and down on my HTC-HD7. It varies very drastically on my emulator.

    On the Phone is either 0 or 1.

    I have a 45sec audio that needs to be played in a loop and its volume gets adjusted depending on game logic. Would you recommend using XNA SoundEffect instead ?

    Thanks !!
    Saturday, July 21, 2012 5:18 AM

All replies

  • Anyone ?
    Monday, July 23, 2012 6:49 PM
  • I did not find any reference to MediaElement.Volume not working
    ... but it could be related to an issue with the HD7 audio driver and SoundEffectInstance.Volume not working.  

    FWIW: 
      HTC was informed of the SoundEffectInstance.Volume issue but I have no tracking information after that point.
      Based on previous threads in this forum this was still a problem for some people as recently as March 2012.
    Monday, July 23, 2012 8:39 PM
  • Thanks ! I will try my app on other devices.

    Friday, July 27, 2012 6:48 PM