Can I use libspotify to play audio without using a low level audio API? - libspotify

Is it possible to use libspotify to obtain the URI of a track and play it using a higher level Media Player? For instance, I'm interested in doing this with a QMediaPlayer in Qt. I ask this because one of Spotify's sample applications uses lower level API's to write the samples directly.
I'd rather do this simpler, similar to how Grooveshark's API works by returning a URL for the track and simply setting that on the high level media player.

No, the only way to get audio for a Spotify track is using libspotify's audio delivery callback, which delivers raw PCM data.

Related

objective-c record audio session output

I am writing an app that generates music. I am using OpenAL to: modify gain; modify pitch; mix audio; and play the resulting audio. I now need to record the audio as it is being played. I understand that OpenAL does not let you record the output audio. The other options I have found is to use audio units. However because I need to mix/pitch/gain the audio and record it, it seems I need to write all the audio processing so I can have access to the output buffer. Is this correct? Or is there a different iOS API I can use to do this. If not then is there a 3rd party solution already that lets me record the output (paid solutions are fine)?
You are correct.
Audio Units are the only iOS public API that allows an app to both process and then record audio.
Trying to record the OpenAL output may well be a violation of Apple's rules against using non-public APIs.
The alternative may be to completely rewrite the portions of OpenAL you need (there may be open source for some portions) running on top of the RemoteIO Audio Unit.
The best way to go is likely to be Core Audio, since it will give you as much flexibility as you need. Take a look into the Extended Audio File Services reference pages.
Using and extended audio file you should be able to set up a file format and audio stream buffer to send the final mixed output to, and then use the ExtAudioFileWrite() function to write the samples to the file.

get access to soundcloud tracks

I'd like to built an application for analysis and classifications of tracks (everyday sound tracks instead of speech or music) recorded and/or streamed by soundcloud.
The idea is to use existing soundcloud infastructure (database, record, share, comment...) and just add an analysis level in between.
It is possible trought the API to access to the track binary files? We'd like to process some of them.
Is there also a way to access to the audio stream durring recording? it's for live classification task.
Thanks
Boris
Some users allow for their tracks to be downloaded, others don't. On one of the downloadable tracks, the track information will have a download_url, and you can download and process that however you like. As for accessing the stream during recording, at that point in time, the file doesn't exist on SoundCloud yet (it's only uploaded once the recording is complete). You could write your own Flash recorder or use the Web Audio API to get audio information during recording.

iPhone: Advanced Microphone Recorder APIs

I am building an App that allows our customers to record, save, and play recorded sound as a basic functionality. This should be straight using AVFoundation Framework. What I also allow users are
Fast Forward and Reverse functionality.
User should also able to manipulate the sound. I mean they allow to insert the sound in between their recorded sound later.
Could anyone please tell me how could I achieve these? Is there any good open-source library for this?
The AVAudioPlayer supports manipulating the playback speed via the rate and enableRate properties, but it only allows forward playing.
The MPMoviePlayerController conforms to the MPMediaPlayback protocol which allows you to specify any rate (even reverse). Though this method will result in choppy audio for some rates.
As far as merging audio files, I think your best bet is to convert your samples to linear PCM. Then you can insert additional samples anywhere in your stream.

iPhone Media Player Framework accessing raw file

I'm interested in using the Media Player framework on iPhone to access audio in the user's library. I want to be able to load a given audio file and then perform some specialised filtering on it.
Ideally I want to be able to directly load the audio file (or portion thereof for streaming) then use the audio converter services to perform decompression. Once I have the linear PCM data I want to perform some filtering on it before supplying the audio directly to an audio queue.
Is this possible on iPhone?
If so, can anyone tell me how I would access the audio file directly? Is it just a matter of using the "URL" to load it using NSFile (Presumably I obtain that through MPMediaItemPropertyAssetURL)? Or do I need to do something more complicated?
Cheers!
The URL you get from MPMediaItemPropertyAssetURL is an Assets Library URL. You can use it to initialize an AVURLAsset. Then create an AVAssetReader with the asset and add to it an AVAssetReaderOutput (instances of AVAssetReaderAudioMixOutput or AVAssetReaderTrackOutput, depending on what you need). This latter object will finally give you access to the media data (-copyNextSampleBuffer).

iphone sdk: Core Audio How to continue recording to file after user stops recording by leaving the application and then re-opens it?

The iPhone's AVAudioRecorder class will not allow you to open an existing file to continue a recording. Instead, it overwrites it. I'd like to know an approach that would allow me to continue recording to an existing file using Core Audio APIs.
The best bet would be to take a look at the Audio Queue Services API. This is basically the next "deeper" level into the Core Audio stack provided by Apple. Unfortunately, the chasm between AVAudioRecorder and Audio Queue Services is vast. AQS is a C-based API and a fairly low level abstraction of the even more "raw" lowest levels of Core Audio. I would suggest reviewing the guide above, then taking a look at the example SpeakHere. It should easily be able to handle your current requirement.
No matter which API, you will have to handle the "intermediate" storage of your PCM data, probably temporarily storing it as a WAV or raw PCM, which you then reload and append with PCM data when continuing.