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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 38
Registered: ‎12-06-2008
My Device: 9530

AudioPathControl not routing audio correctly

I'm trying to play some media through the handsfree speaker, but it isn't routing correctly. I'm using the latest 4.7 beta JDE.  Here is my code:

 

_player = javax.microedition.media.Manager.createPlayer(_audioLocation);
_player.addPlayerListener(this);
_player.realize();
_player.prefetch();

Control[] c = _player.getControls();
for(int i=c.length-1; i>=0; --i) {
if(c[i] instanceof AudioPathControl) {
_audioPathControl = (AudioPathControl)c[i];
_audioPathControl.setAudioPath(AudioPathControl.AUDIO_PATH_HANDSFREE);
}
}

_player.start();

 

On my Storm, the audio ends up outputting through the headset (apparently, even when one isn't plugged in). I installed on a pearl, and the audio plays through the handset.  If I specify AudioPathControl.AUDIO_PATH_HANDSET, it routes correctly (that is, to the handset). I even added some code that calls getAudioPath and it appears to show that the audio path was set correctly. Am I missing something here? Is there something that's preventing me from outputting to the speakerphone?  Is there any way to find out where the simulator is supposedly outputting to?

 

Thanks,

Joe

 

Highlighted
New Developer
Posts: 6
Registered: ‎12-12-2008
My Device: Not Specified

Re: AudioPathControl not routing audio correctly

I'm having a similar problem with the Storm. I'm trying to play MP3 audio over the speaker or the headset (if it's plugged in). However, no sound plays over the speaker. If I plug in the headset, the sound plays. If I unplug the headset while a sound is playing, it continues to play over the speaker. This is without having touched the AudioPathControl at all. I tried setting the Audio path to AudioPathControl.AUDIO_PATH_HEADSET_HANDSFREE but that didn't work either.

 

Any suggestions?

Developer
Posts: 38
Registered: ‎12-06-2008
My Device: 9530

Re: AudioPathControl not routing audio correctly

The same discussion is going on over here now: http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=11963.  In short, it appears to be a fairly major bug in the 4.7.0.75 software. No one has yet discovered a workaround, nor has RIM responded.

New Developer
Posts: 6
Registered: ‎12-12-2008
My Device: Not Specified

Re: AudioPathControl not routing audio correctly

Thanks for the quick response. I'll check that thread out.
New Developer
Posts: 1
Registered: ‎04-21-2009
My Device: Not Specified

Re: AudioPathControl not routing audio correctly

try setting the AudioPath after starting the player. It might help.