locked
Volume control RRS feed

  • Question

  • How can I use the slider in wp7 to change the volume of

    SoundEffectInstance.Volume

     I have tried but I cant seem to get it to work... does anyone have any idea? 

     
    
    Friday, April 1, 2011 2:31 PM

Answers

  • The HTC market definitely not insignificant. I don't have any numbers, but I know it makes up a large portion of devices.

    I had to deal with this by muting some of the sounds completly on HTC phones. On other phones they are not muted. It was better then playing at 100% volume all the time. I didn't have a slider so it doesn't look like anything is broken, but you might want to hide the slider instead of having something that doesn't work.

    You can check if the code is running on an HTC phone with this code.

    Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString.ToLower.Contains("htc")

    Hopefully sometime in the future HTC will fix this and and update will be released. Then I can remove that code. I can confirm that the latest NoDo update doesn't contain a fix for this though.


    Saturday, April 9, 2011 9:10 AM

All replies

  • Are you trying to use the device's volume slider or a slider control in your app?

    You can create a Slider control with Minimum=0 and Maximum=1.  On a ValueChanged event,  you can update the Volume's value with the new value.

    Friday, April 1, 2011 3:26 PM
  • Yes it works in the emulator. But on my HTC phone it doesnt work..

    I have read that it is a problem with HTC phones? Is there a workaround?

    Friday, April 1, 2011 4:19 PM
  • Hi Proogeren,

    There is no workaround for this. You will need HTC to address this.

    Thanks!

    Friday, April 1, 2011 8:36 PM
  • So how big is the HTC marked in WP7 phones? 

    How does developers deal with this?

    Do they add slider and not care that it doesnt work on HTC or do they just skip this functionality?

    Saturday, April 2, 2011 6:38 AM
  • The HTC market definitely not insignificant. I don't have any numbers, but I know it makes up a large portion of devices.

    I had to deal with this by muting some of the sounds completly on HTC phones. On other phones they are not muted. It was better then playing at 100% volume all the time. I didn't have a slider so it doesn't look like anything is broken, but you might want to hide the slider instead of having something that doesn't work.

    You can check if the code is running on an HTC phone with this code.

    Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceManufacturer").ToString.ToLower.Contains("htc")

    Hopefully sometime in the future HTC will fix this and and update will be released. Then I can remove that code. I can confirm that the latest NoDo update doesn't contain a fix for this though.


    Saturday, April 9, 2011 9:10 AM