0

Is there a way to trigger some kind of task on the base of date event .My problem is that i want to play sound (alarm) on specific date it does work fine by using UILocalNotification, but it plays s short sound , and i want to play an infinite sound instead of .How can i achieve this goal .. waiting for your early response. Thanks

skaffman
  • 398,947
  • 96
  • 818
  • 769

2 Answers2

2

The apple documentation of UILocalNotification states that the soundName property will play for a maximum of 30 seconds only.

Sounds that lasts longer than 30 seconds are ignored and the default sound is played instead.

While adding the custom sound make sure the sound is in the correct format (linear PCM or IMA4)

You can convert from wav and mp3 using:

afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf

In case if u were wondering what is afcomvert ..it's nothing but command line program Caf is container format..

Sometimes emulator won't play the custom sound but device does.

Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
0

You can schedule a custom sound using the soundName property of UILocalNotification, but it can't be infinite. You could use the repeatInterval property to play the alert again, making it seem infinite...

Don
  • 3,654
  • 1
  • 26
  • 47
  • The repeatInterval has to be NSCalendarUnit and can only contain: NSWeekCalendarUnit, NSMonthCalendarUnit, NSDayCalendarUnit, NSHourCalendarUnit and how could we repeat this to make it seem continuos? – Durai Amuthan.H Sep 28 '13 at 18:50