BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 10-19-2009, 06:39 AM   #1 (permalink)
New Member
Join Date: Jun 2009
Model: 9000
Carrier: Maxis
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to play sound through the speaker?

Please Login to Remove!

I want to play sound loud through the speaker on the phone - just like when the phone is in speaker phone mode. I try the following code, but can not get it to work :

player = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);
ToneControl tc = (ToneControl) player.getControl("ToneControl");
VolumeControl vc = (VolumeControl) player.getControl("VolumeControl");
AudioPathControl apc = (AudioPathControl) player.getControl("AudioPathControl");
//apc is now null and of course, the below throws an exception
apc.setAudioPath(AudioPathControl.AUDIO_PATH_HANDS FREE);

Why can I not get the AudioPathControl object? Does anyone know how to do this?

Last edited by pmagnus2 : 10-19-2009 at 06:40 AM.

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.