Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Sound help

Hi,

 

My app plays sounds when a user presses a button, it has a settings screen so a user can change the volume of a sound using:

 

sTransform.volume = volume;

 

My question is, when the user changes the var 'volume' do I need to change anything in the tablet API to increase volume? O r will changing it using sound transform work just fine? And do I need to allow 'play_audio' in the xml permissions?

 

Thanks

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Contributor
TheWakeUpCall
Posts: 48
Registered: ‎03-30-2011
My Device: Playbook

Re: Sound help

I believe you need to add permissions for play_audio. This page also suggests that to change volume you need permissions for that too, and should be using qnx.media.MediaControl.

 

I've done playing audio though, but not changing volumes.

 

http://docs.blackberry.com/en/developers/deliverables/23959/Configuring_your_application_1524626_11....

Please use plain text.
Super Contributor
JeffLemon
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook

Re: Sound help

So I should swap my sound transform to something like:

 

 controls.setProperty( MediaControlProperty.VOLUME, 80 );
--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Sound help

Changing the soundTransform will work fine, and you don't need any special permission to do so.

 

You should include play_audio, however, if you're playing sound.

 

There are two ways to control volume... the system setting (which you can affect with the physical up/down volume buttons) and the transform in Flash.  The system setting requires the special permission, but the transform does not.  Obviously if the user has set the system volume to the minimum, you won't hear your sound even if the transform volume is at max.  (And that's probably just what the user wants.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.