Comments (6)
it comes out of the box (there's an background-enabled iPhone example in this fork: http://github.com/jfricker/AudioStreamer), just add "audio" key in Info.plist, also you have to have the playback started at least once before your app enters background for it to work
from audiostreamer.
The one issue I have found with the AudioStreamer and this project also would have the problem is implementing a "Pause" function instead of using the Stop. The issue I have found with using pause is that in iOS4 if you pause the stream and have the app in the background this will affect other applications audio sessions.
Try to add pause to this app instead of using Stop and you will see what I am talking about. Pandora is the only app that I have seen that has solved this issue. Other Streaming apps are just doing a Stop which doesn't work if you are listening to a individual stream of a song and not a station. Example streaming a .mp3 file from a website.
from audiostreamer.
I don't know where else to look. I'm using the audio streamer to play a radio in my app. It all works fine until i go to background mode. There it still plays for some random time (from 1 minute to 10) and then it stops. If i resume my app, the stream is also resumed and continues to play.
Why should this happen? i've set nslogs everywhere in the audio streamer. I've put audio as an item in the UIBackgroundModes plist array, as instructed here. I think the problem has something to do with a network condition that happens wich causes the stream to pause, and then it doesn't resume. Perhaps buffering is not allowed in background? I don't know how to check what happens.
edit: i've run more tests. If i upgrade my wifi connection to a better one (the first connection i tested was somewhat poor) the background streaming lasts a lot more. I'm starting to think that this issue appears when a buffering occurs while in background mode. In foreground mode buffering works by just pausing sound until the buffer is complete again and then resumes. When in background mode, buffering stops completely until i get to foreground again.
Also, one of the last times i got the sound in the background stopped, the last nslog in the console window was showing a call to setState with a value of 6 (buffering).
from audiostreamer.
Is this background stream supposed to work on the simulator with your fork? I can't seem to get it to work. The app is clearly running in the background, but the audio stops playing (pauses) when the app is put away. It resumes where it left off when bringing the app back up.
from audiostreamer.
My mistake, it appears that background audio doesn't work on the simulator. It does work on a real device, however. I just tested it.
from audiostreamer.
@mbrucedogs take a look at #26 for your pause/audio-interruption issue.
from audiostreamer.
Related Issues (20)
- I built a audioqueue framework which used lots of your code, can I publish it on github? HOT 1
- Does it work with iOS 7.0?
- How to switch rate ?
- Streaming and caching
- The function Seeks to a specific time (in seconds) when streaming not good
- 'CFReadStreamCreateForHTTPRequest' is deprecated: first deprecated in iOS 9.0
- Failing to start ShoutCast Stream HOT 1
- Play Shoutcast radio
- Play Wav from Internet
- play audio queue on iPod which system version is iOS6
- Soundcloud certain songs not working HOT 2
- Backgroundaudio not working in iOS7 HOT 3
- How do i get the played sound name ??? HOT 1
- Crash on CFReadStreamSetProperty HOT 1
- New version issue - "Audio packets are larger than kAQDefaultBufSize." HOT 5
- it can not continue play after the audio data from server missed some
- Stop after 10 min
- Playing Media LIbrary File
- Stream directly to xxx.xxx.xxx.xxx/stream.mp3?
- Is it possible to mix two streams in AudioStreamer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiostreamer.