Question

I'm trying to reproduce the functionality of built-in Mail application when a new message arrives while you are listening to iPod music.

What happens with the Mail app is:

  1. iPod's volume lowers a bit
  2. Mail app plays a short sound and vibration
  3. iPod's volume goes back to normal

I know how to play a sound and cause vibration, what I don't know is how to lower iPod's volume and restore it after my sound plays.

How can I reproduce this same functionality in my app with SDK 2.2? I know third party apps can't run in the background. My users will play the iPod then have my app in the foreground.

Was it helpful?

Solution 3

This is not possible with iPhone SDK 2.2.1 or earlier. If you need this functionality please submit a bug to apple. I've submitted one but duplicates indicate interest so it might help promote this issue.

OTHER TIPS

See my answer to that other question of yours ;)

[[MPMusicPlayerController iPodMusicPlayer] setVolume:x.y]

where you change x.y through a timer or as one-off. In OS3, of course.

Have you tried simply playing the sound? I suspect this is automatic functionality on the part of the SDK.

edit: according to this question, you can fade the ipod sound out but not back in.

(I'm surprised this functionality isn't automatic and default behaviour. But then I've always found the elegance of the apple APIs to be inversely proportional to the elegance of the interface :-)

[[MPMusicPlayerController iPodMusicPlayer] setVolume:x.y] this will affect your ipod music player volume (allowed values are 0.0 to 1.0)

i hope vibration not allowed in ipod. if device have an option for vibration then we can do

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top