Getting HTTP based playback to work? #206
Unanswered
NattyNarwhal
asked this question in
Q&A
Replies: 1 comment 9 replies
-
The HTTP input source pathway is the least-tested so it's definitely possible SFBAudioEngine is doing something incorrectly with If you try to play the URL using SimplePlayer do you see the same behavior? Or does opening fail completely due to lack of MIME type? Interestingly, |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm still getting my Objective-C legs still, so pardon me if I sound a bit dumb.
I'm adapting an application from the before times of Snow Leopard to Monterey. There's a lot to do still (i.e. convert to ARC, clean up UI threading issues, etc.), but I figured getting working audio would be a nice dopamine rush. It used both QTKit and SFBAudioEngine for playback, depending if the file was remote or local, respectively. Since QTKit has been mega deprecated, and porting it to the modern AVFramework seems like a bit of a feat, I figured, since SFBAudioEngine supports both local and remote playback, why not just use SFBAudioEngine all the time?
I did have to do the conversion from the C++ to the Objective-C API, which I'm still figuring out (i.e. going to do callback to delegate conversion, the measurement type changes), but the biggest thing is using SFBAudioEngine to play audio from an HTTP service.
Mildly cleaned up example:
Here's the full console log output from Xcode. Apologies for having other application issues intermixed; I'll clean it up, but don't know how much is relevant to my issue with SFBAudioEngine specifically. I do notice in particular that the NSURLSession downloader stuff seems to be triggering multiple times and gets cancelled. I wonder if that has something to do with it?
If I curl the URL, I get a perfectly normal file, without any special headers or whatever, so I don't think it's the HTTP input source choking on not having proper auth or anything.
In addition, I've had difficulty with the MIME type detection (since extension won't work for the API endpoints) not well - not sure if it's enumerating through all the different providers. I do know one type was missing (
audio/mp4
).Beta Was this translation helpful? Give feedback.
All reactions