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

Java Development

Reply
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

[ Edited ]

Is there a differece between:

 

net.rim.device.api.system.Audio.setVolume()

 

and

 

net.rim.device.api.system.Alert.setVolume()

 

?

Would be important to know if there is a difference.    

 

 

Message Edited by javec on 07-21-2008 11:42 PM
If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Unable to set audio volume on BlackBerry Pearl 8130

Both of those methods should operate in the same way.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 8
Registered: ‎07-16-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

At least that is not the case on your BB Pearl devices with firmware 4.3. Audio.setVolume() doesn't work, Alert.setvolume() does.
New Developer
Posts: 86
Registered: ‎11-19-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

My code is this:

 

int volume = Alert.getVolume(); // reads 100
Alert.setVolume(0);

 

It DOESN'T change the volume setting Smiley Sad I'm running this on a Curve 8310. Any idea?

Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

It depends where you use it. If you play music after you set Alert.setVolume(int i) then it sets back the volume.

 

It only works for some things. I also have not fully figured this out. And why is there a difference between Alert.setVolume and Audio.setVolume ?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
New Developer
Posts: 86
Registered: ‎11-19-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

I'm trying to use it from inside a callIncoming interceptor...

I know there are softwares that allow to hear a very low ring when a call comes in...I wonder how they really work. 

Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

Ok I see. RIM is very strick when it comes to incoming calls and handling those things I found out (not able to answer calls and so).

I am not sure if this API works in the PhoneListener. Does it throw any exception?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
New Developer
Posts: 86
Registered: ‎11-19-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

no it doesn't throw any exception. The thing that make me think, is that at least one other app does this successfully, so it must be possibile somehow. I was thinking I may try to lower the volume after waiting a bit, so that the ring starts (which may reset the volume to its default, like you say above)...however even if this worked, I'd hear the volume as normal for an instant, which isn't good...
New Developer
Posts: 86
Registered: ‎11-19-2008
My Device: Not Specified

Re: Unable to set audio volume on BlackBerry Pearl 8130

I actually just tried the following code, but nothing changes, not even in the simulator.

 

 

Timer timer2 = new Timer(); timer2.schedule(new TimerTask() { public void run() { UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { Alert.setBuzzerVolume(0); Alert.setVolume(0); } }); } }, 1000);

 

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Unable to set audio volume on BlackBerry Pearl 8130

You can only change the volume level in increments of 10.  Values greater than that are ignored.  So you'll need to get the current volume level, subtract 10, set the volume level and repeat until you reach 0.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker