mattgallagher / AudioStreamer

A streaming audio player class (AudioStreamer) for Mac OS X and iPhone.
http://cocoawithlove.com
1.93k stars 553 forks source link

Abandoned? #45

Open ghost opened 12 years ago

ghost commented 12 years ago

It seems matt has abandoned this project. There's 114 forks. There doesn't seem to be an alternative to this project. What's the best response in situations like this?

mikefrederick commented 12 years ago

It seems to me like AVPlayer might be the best solution at this point.

ghost commented 12 years ago

This library is an essential part to numerous iphone apps --each one with their own fork, apparently. It fills a hole in iOS development, AVPlayer being too low level for a lot of people's needs.

It's a shame that someone hasn't taken over the project (and maybe even coordinated the forks).

cbess commented 12 years ago

@autodidakto I used to use this proj heavily (I built a media player app around it). Now having switched to AVPlayer, I don't think AVPlayer is low-level at all: [AVPlayer playerWithURL:] handled my needs. Its really a high level API and it provides more feedback about its internals using AVPlayerItem and KVO. I accept the abandonment.

mikefrederick commented 12 years ago

Yeah, it is a shame. It is also a shame that AVAudioPlayer doesn't support streaming because I think AVPlayer is a bit messy and annoying to work with. If AVAudioPlayer supported streaming then a lot of people's problems would be solved.

I integrated AudioStreamer into an app I am currently working on and within a couple of days I had to dig in and fix 3 bugs that showed up. That makes me feel like AudioStreamer might not be suitable for production and that AVPlayer might be a better solution.

myell0w commented 12 years ago

for those of you who don't want to use AVPlayer: MPMoviePlayerController is working fine for audio-only streaming, despite the name and it's as high-level as it can get :)

cbess commented 12 years ago

@mikefrederick AVPlayer works with local and remote files. AVAudioPlayer is a wrapper around AVPlayer and AVPlayerItem objects. You can get the same behavior by implementing your own audio player using those two classes (which I have done). And yes, my app streams audio. I say all that to say it wasn't a daunting task, if you can understand or modify AudioStreamer code, then making you own wrapper for the two classes will/should be a breeze.

ghost commented 12 years ago

A note about MPMoviePlayerController: It buffers the whole file, making it useless for 3G connections (apple will reject.)

And while I thank @cbess for the useful and correct guidance, the fact remains that the iOS community wants a maintained AudioStreamer(-like) project. As it stands, everyone is reinventing the wheel.

mikefrederick commented 12 years ago

@cbess I have also implemented an audio player using AVPlayer and AVPlayerItem. I agree that using AVPlayer is not a daunting task at all whatsoever, it would just be nice to have a cleaner and well-rounded solution (i.e. the use of a delegate instead of KVO and NSNotifications). For my particular task, I would really like to be able to use audio level metering with a streaming player -- something that I cannot figure out how to do with AVPlayer (it might not be possible). A couple of years ago I had to create an audio player from scratch with Core Audio (utilizing ffmpeg & streaming audio) and IMHO Core Audio is very poorly documented and it was was not a trivial task.

I did not know that AVAudioPlayer was a wrapper around AVPlayer & AVPlayerItem. How do you know this? Can you point me somewhere that suggests this is true? I would expect AVAudioPlayer to support streaming audio if this were the case. Also, AVAudioPlayer has been around since iOS 2.2, whereas AVPlayer is relatively new I believe.

cbess commented 12 years ago

@mikefrederick Here is some support for my claim.

One: AV Foundation Programming "There are two facets to the AV Foundation framework—API related just to audio, which was available prior to iOS 4; and API introduced in iOS 4 and later. The older audio-related classes provide easy ways to deal with audio. They are described in Multimedia Programming Guide, not in this document."

Two: Multimedia Programming Guide "The AVAudioPlayer class provides a simple Objective-C interface for playing sounds. If your application does not require stereo positioning or precise synchronization, and if you are not playing audio captured from a network stream, Apple recommends that you use this class for playback."

Three: AV Foundation Programming The layer photo at the top places iOS3 classes in the AVFoundation stack.

All of the above excerpts imply that AVAudioPlayer is a wrapper. And looking at AVPlayer and AVPlayerItem, which as you know come later, they expose most of the properties available from AVAudioPlayer, the other properties for metering will have to be implemented by you, using one of the other APIs. There doesn't seem to be a wrapper for the metering, other than AVAudioPlayer, but it is achievable without AVAudioPlayer.

I could give more examples but this is not for me to research, its mostly for you (since its your project). I could possibly help you implement it though.

alexcrichton commented 12 years ago

I'm not sure if anyone is still interested in this, I finally got around to taking a stab at actually figuring out what's going on here, and I've got a heavily modified version in one of my projects.

The major differences are:

I'd like to support OSX 10.6, so I can't use AVAudioPlayer sadly. If you'd like to keep using AudioStreamer, but have problems with it, I might be able to help out!

ghost commented 12 years ago

I'm still interested. Thanks for this. Maybe make a separate project for it? I think people will join in.

alexcrichton commented 12 years ago

I'll be maintaining and updating it here: https://github.com/alexcrichton/AudioStreamer

Instructions and better documentation will be coming shortly.