Play sound in local notification - iphone

I have used Local Notification in my app an successfully generated an alert at correct time..
But when i tried following code for playing sound it does not play....
localNot.soundName =#"Ghulam Ali-Chamkte Chaad Ko.mp3";
Can anyone tell me the reason....Does the playing length of sound file affects

According to the Apple Developer Documentation, you need to use "aiff", "caf" or "wav" files.
The link provided shows some ways of converting audio to these formats on your mac.

Related

playing downloaded audio video in iphone

Hi seen many tutorial but couldn't find the right workable answer. I need to play audio and video file from my webservice, for this I want to download the file and play it in the app, seen tutorial for avPlayer nothing workable. Please provide link or guide how to do this.
Use MPMoviePlayer, as this can open network streams and despite the name works with audio. The only thing is this pops up the modal player with controls.
First Download the network file using NSURLConnection and store it locally, then use AVAudioPlayer to play the local file.

How to play the recorded sound in NSLocalNotifiaction

I implemented local notification in my app but I am just wondering is there a way to play a sound that is not part of the NSMainbundle.Basically in my app, I want user to record a sound that gets played when the local notification is generated instead of playing a pre-recorded sound. I have read out the Apple Documentation but i have also seen 2 -3 Apps on app store which is doing it like the this App link of the App i am wondering how the are playing custom sounds (sounds which are not the part of NSMainBundel)
Anyone has any idea how I can do it ?
Thank you in Advance
What you can do is to utilize the AVAudioRecorder and save its recordings to the documents directory of the iPhone.
After the recording is done, you can play the very same files using an AVAudioPlayer via the path of the recorded files.
HTH

How do I put iOS application in background mode, with audio option set?

So my application for iphone4 reads data from the accelerometer and sends it to another application via tcp sockets. I need my app to work in background mode, so what I did was:
I put an mp3 file in the application's Documents folder
I used AVAudioPlayer library to play the file in a loop. It works.
I edited Info.plist and added option "required background
modes" with "audio" on.
Still, the scheduler suspends the application whenever I press the iphone's home button. Is there anything I missed?
I read apple's documentation, but I didn't find a solution. A few thoughts on this:
do I have to edit appDelegate.m?
is it because I use AVAudioPlayer instead of the iPod?
is it because I play an audio file from the application documents
folder?
I read about one person changing iOS Development Target from 4.0 to
3.2.1, but that didn't work for me.
And finally, say I get this to work, would the application still be getting data from the accelerometer?
On a side note, I don't want to submit the application to the App Store.
No, you will not receive accelerometer notifications in background mode. As far as I know, it is not possible. Check Executing Code in Background.
If you read the docs carefully, you will know that the whole background code model is based on responding to specific events (location and voip modes).
As for the audio mode here is an extract from Apple:
Your application should limit itself to doing only the work necessary
to provide data for playback while in the background. For example, a
streaming audio application would download any new data from its
server and push the current audio samples out for playback. You should
not perform any extraneous tasks that are unrelated to playing the
content.
Not sure whether you have solved your issue or not since this question was posted more than one year ago. Also, not sure whether playing audio is a must in your app or not. If both answers are no, my recent investigation may help a bit.
Here are how I get my app getting accelerometer data at the background
1. Follow this tutorial http://mobile.tutsplus.com/tutorials/iphone/ios-multitasking-background-location/ to get the background location working.
2. Follow this tutorial http://jonathanhui.com/ios-motion to get the accelerometer working.
Then you can get an app collecting accelerometer data at the background. Hope this helps.

iPhone: What are the Alert Sound supported in Push Notification Payload?

I have implemented Push Notification and have been using Default sounds every time. I know that there are many other sounds as well that I can use but I don't know the names of all sounds that Apple support for Push Notification. Can someone please help me to get the list?
Thanks.
You could put your own sound file , which you like to play.
From apple documentation.
You can package the audio data in an
aiff, wav, or caf file. Then, in
Xcode, add the sound file to your
project as a nonlocalized resource of
the application bundle.
See more
The sound has to be bundled with your app.
You can use any sound you desire (and you have the rights to) - but you need to correctly encode the sound to work on the device (caf, aiff, wav). You must embed the sound as a resource within your project bundle, you cannot use "Any sound" on the device. Once embedded, you can reference it by filename in your payload for the sound.
Caveat - your sound must be under 30 seconds long and there is no mechanism to loop the sound)
Apple Push Documentation

iPhone SDK - HTML Live Streaming for audio

I've been developing an iPhone application that streams audio using Matt Gallagher's audio streamer found here: GitHud: AudioStreamer
However, I'm having some problems when the iPhone loses internet connection because the stream cuts out and doesn't reconnect until the user actually presses the play button again. I've even tried using the reachability classes from Apple to try and automatically stop and reconnect the stream but this isn't working 100%.
I've been reading around on the internet and I've found something called HTTP Live Streaming that can supposedly be used to stream audio on the iPhone. However, I can't seem to find any examples of how to use this, therefore can anyone help me by given a brief description any any source that might help to get this working please?
Thanks in advance,
Luke
Not enough detail for me to answer this entirely, but I use a set of calls
to be notified of reachability changes.
When I get a failure, I change the play image to stop.
I then wait for a notification that the network is back
and then programmatically press play for the user.