getting pcm audio for visualization via Spotify iOS SDK
We’re currently looking at taking our music visualization software that’s been around for many years to an iOS app that plays music via the new iOS Spotify SDK — check out http://soundspectrum.com to see our visuals such as G-Force and Aeon.
Anyway, we have the demo projects in the Spotify iOS SDK all up and running and things look good, but the major step forward is to get access to the audio pcm so we can sent it into our visual engines, etc.
Could a Spotify dev or someone in the know kindly suggest what possibilities are available to get a hold of the pcm audio? The audio pcm block can be as simple as a circular buffer of a few thousand of the latest samples (that we would use to FFT, etc).
Thanks in advance!
- Invalid File Output AVAssetExport
- stop sound in iPhone
- How can I record the audio output of the iPhone? (like sounds of my app)
- What is the best method of synchronizing audio across iOS devices with WiFi?
- Mac OS X speech to text API. Howto?
- iOS - updating the media play/pause state in the multitasking bar
Solutions Collect From Internet About “getting pcm audio for visualization via Spotify iOS SDK”
SPTCoreAudioController and do one of two things:
AudioUnitAddRenderNotify()to add a render callback to
destinationNode‘s audio unit. The callback will be called as the output node is rendered and will give you access to the audio as it’s leaving for the speakers. Once you’ve done that, make sure you call
super‘s implementation for the Spotify iOS SDK’s audio pipeline to work correctly.
attemptToDeliverAudioFrames:ofCount:streamDescription:. This gives you access to the PCM data as it’s produced by the library. However, there’s some buffering going on in the default pipeline so the data given in this callback might be up to half a second behind what’s going out to the speakers, so I’d recommend using suggestion 1 over this. Call
superhere to continue with the default pipeline.
Once you have your custom audio controller, initialise an
SPTAudioStreamingController with it and you should be good to go.
I actually used suggestion 1 to implement iTunes’ visualiser API in my Mac OS X Spotify client that was built with CocoaLibSpotify. It’s not working 100% smoothly (I think I’m doing something wrong with runloops and stuff), but it drives G-Force and Whitecap pretty well. You can find the project here, and the visualiser stuff is in VivaCoreAudioController.m. The audio controller class in CocoaLibSpotify and that project is essentially the same as the one in the new iOS SDK.
- Swift 2.0: Could not cast value MyApp.MyCustomClass to MyAppTests.MyCustomClass when using Set
- headphone plug-in plug-out event when audio route doesn't change – iOS
- Cannot convert value of type 'Float' to expected argument 'CGFloat'
- XCode: Where to put image resources
- iOS custom TableViewCell class subviews return null
- Extending CLPlacemark results in EXC BAD ACCESS
- Delete provisioning profile from Xcode 5
- Geofencing didEnterRegion,didExitRegion function not Calling in iphone 5S iOS8.1
- Unable to create array of SKActions
- How to send Extra parameters in payload via Amazon SNS Push Notification
- uilongpressgesturerecognizer crashes even if not implemented
- WebSockets Energy Consumption
- ActionScript's File.upload does not work on Air SDK for iOS devices
- ARC, self and blocks
- Returning from method inside a @synchronized block