Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 03-18-2009, 10:12 PM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Location: NY
Posts: 1
Default Control audio volume with hardware buttons while audio is not playing

Hi all, I have an application that plays various audio clips. While the clips are playing, the user can use the hardware volume buttons to adjust the volume. Is there any way to get those hardware buttons to do the same when a sound is not playing?

I am using the AudioToolbox framework. My app works on 2.1 and higher and I'd preferably like to keep it that way (which means I won't be using the AVAudioPlayer framework). Any help or suggestions would be greatly appreciated.
peterjp80 is offline   Reply With Quote
Old 06-27-2009, 09:52 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 90
Default

Quote:
Originally Posted by peterjp80 View Post
Hi all, I have an application that plays various audio clips. While the clips are playing, the user can use the hardware volume buttons to adjust the volume. Is there any way to get those hardware buttons to do the same when a sound is not playing?

I am using the AudioToolbox framework. My app works on 2.1 and higher and I'd preferably like to keep it that way (which means I won't be using the AVAudioPlayer framework). Any help or suggestions would be greatly appreciated.
I am also interested in getting the hardware buttons to control the sound when a sound is not playing? it works fine when the sound is playing.

Any help would be great.
jbullfrog is offline   Reply With Quote
Old 07-02-2009, 07:50 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Turin - Italy
Posts: 14
Default

I'm also really interested!!!
worst case, at least how to set the application volume to the maximum when the application loads...
I searched in apple docs, but no success.

thanks in advance!!!
givosoft is offline   Reply With Quote
Old 07-02-2009, 07:54 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 90
Default

one thing we could do, but it seems to be a hack, it load a sound that is silent, then tell it to loop, that way there is always something playing in the background then when the user uses there sound buttons it will work.

I would prefer finding a better solution to this issue if we can.
jbullfrog is offline   Reply With Quote
Old 07-03-2009, 08:35 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 25
Default

One thing that always bugs me about most apps, is that you cant adjust the volume until the sound starts playing. Like you click the play button, and realize it might be too loud and so try to turn it down with the hardware buttons, but end up just changing the level of the "ringer" volume, and once the sound is done buffering it comes blasting through the headphones.

My app uses audiounits, which I used to start and stop along with the play button and stop button, however this is not recommended by apple. Now I just start the audiounits at program start and stop it at program end, and just pass empty buffers in the audiounit callback. This has the nice side effect of allowing hardware control over volume level at any time the app is running.
pwnified is offline   Reply With Quote
Reply

Bookmarks

Tags
audiotoolbox, volume

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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,243
Threads: 39,019
Posts: 171,144
Top Poster: smasher (2,570)
Welcome to our newest member, iWalter
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:14 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0