Audio in Background in iphone - iphone

I want to make an app which can play audio in background in iphone.Is there any tutorial or example available?

There are plenty out there! Google is your friend :)
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW1

Related

is it possible to play AppleMusics inside my app? If yes then how can i play this?

I'm beginner to iOS development. I want to play AppleMusic inside my app. please let me know is it possible or not?
If it is possible then please suggest me how can i play this.
I found this Link but i don't know wether it play music with iPhone default player or AVPlayer?
It is possible with music kit. Check out https://developer.apple.com/musickit/, but the users will need to have an apple music account.

Apple watch video playback

Can apple watch capable of video playback? I want to develop an app similar to vine for apple watch. So, user can consume video conveniently from the watch. Is it possible?
I have played with animating multiple images to create a video but it really is a bad approach. Anyone else comes up with any idea?
Update after WWDC 2015:
Good news! Now it's possible!
Link to sample code:
https://developer.apple.com/library/prerelease/watchos/samplecode/WatchKitMoviePlayer/Introduction/Intro.html
Summary:
Now there is a class (WKInterfaceMovie) that allows you to play videos on the watch :)
From the docs:
A WKInterfaceMovie object lets you play back video and audio content
directly from your interface. A movie object displays a poster image
with a play button on top of it. When the user taps the play button,
WatchKit plays the movie in a modal interface.
Class Reference:
https://developer.apple.com/library/prerelease/watchos/documentation/WatchKit/Reference/WKInterfaceMovie_class/index.html
Using the current APIs it might be difficult/impossible.
Still, the camera application on the apple watch is receiving a live stream coming from the camera of the iPhone at a quite good rate.
Most of the apple watch apps are not using only the publicly available APis but it shows that it should be feasible (not talking about the sound here...)
update:
I had missed one feature, there IS an embedded video player with sound on the apple watch... have someone send you a short video has an iMessage and you are able to play it on the watch...

how to play background music while recording voice?

friends
Now I'm developing iPhone Recorder App.
I can easily record my voice with sample code.
I want to record background music with my voice.
For example,When I click "Record" button,background music plays
Then I sing a song.
In this case,I should record background music with my voice.
But,If I did like that,I can't record anything.
What's wrong?
To do this,what should I do?
Please help me..
Thanks.
I'm not familiar with programming for the iPhone but I can imagine there would be a limitation to what you like to achieve IF you intend to make this work without using headphones/headset. It just might be that the OS wont let you play music and record at the same time because the recording would result in an echo because of the background music.
That said, I'm sure an experienced iPhone programmer is able to tell you exactly how this would work.
Good luck and I hope my suggestion helps you out.
friends
I solved this problem by using OpenAL.
Thanks for all your effet.

How to record videos from an iphone App

Does anyone know how to record videos from an iphone app without making it to close..
it would be greatly helpful, if any one provides the sample code...
Maybe you can see the Apple note:
How to capture video frames from the camera as images using AV Foundation

First "Simple" Audio Player Application

Can anybody please tell me how to implement an audio player application in an iPhone? I am pretty new to iPhone development and I am just starting to learn the tricks of the trade.
PS: I need sample code!
If you want to play your own sounds, the AVAudioPlayer class. If you want to play media from the iPod library, see MPMusicPlayerController.