The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-02-2008, 03:39 PM
Developer
 
Join Date: Feb 2008
Posts: 426
Thanks: 34
Thanked 157 Times in 55 Posts
How to access the top ear speaker

Has anyone seen a 3rd party native app access the top speaker (not the player speaker at the bottom of the phone).

Better yet - anyone know how to (code wise?).

THANKS!

-mc
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 03-02-2008, 10:05 PM
JLA JLA is offline
Developer
 
Join Date: Oct 2007
Posts: 227
Thanks: 1
Thanked 31 Times in 24 Posts

To get sound out of the receiver, try this:

Code:
-(void) switchToReceiver
{
NSString* zError;
AVController* zAVController=[AVController avController];

[zAVController activate: nil];
[zAVController setAttribute:@"PhoneCall" forKey:@"AVController_AudioCategoryAttribute" error:&zError ];
}
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
The Following User Says Thank You to JLA For This Useful Post:
psuskeels (03-03-2008)
  #3  
Old 03-03-2008, 10:03 AM
Developer
 
Join Date: Feb 2008
Posts: 426
Thanks: 34
Thanked 157 Times in 55 Posts

JLA - Thanks a ton! Worked great.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 03-03-2008, 05:01 PM
Green Apple
 
Join Date: Feb 2008
Device + Firmware: unlocked iphone FW 1.1.4 BL3.9 with ZIphone 2.5 *** Thank You for your hard work *** :P
Posts: 36
Thanks: 3
Thanked 0 Times in 0 Posts

i don't get... where did you put the code in?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #5  
Old 03-03-2008, 05:56 PM
JLA JLA is offline
Developer
 
Join Date: Oct 2007
Posts: 227
Thanks: 1
Thanked 31 Times in 24 Posts

Anywhere you want...it can be a class method, so I guess you can change that - to a +.
Calling it will switch to the audio to the receiver until something switches it back.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #6  
Old 04-14-2009, 11:19 AM
What's Jailbreak?
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

When I add the code to my method I get:

error: 'AVController' undeclared (first use in this function)
error: 'zAVController' undeclared (first use in this function)


Do I need an additional framework for this? A have AVFoundation imported and I am successfully playing sounds using AVAudioPlayer. I just want to play the sound through the ear speaker.

Thanks!
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #7  
Old 04-14-2009, 11:41 PM
Green Apple
 
Join Date: Apr 2009
Operating System: Mac
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post

Quote:
Originally Posted by JLA View Post
To get sound out of the receiver, try this:

Code:
-(void) switchToReceiver
{
NSString* zError;
AVController* zAVController=[AVController avController];

[zAVController activate: nil];
[zAVController setAttribute:@"PhoneCall" forKey:@"AVController_AudioCategoryAttribute" error:&zError ];
}
thank you JLA! I'm adding saving this...
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 03:46 PM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top