|
I'd like to download the audio track for some of the selection in the emi_open_collection. I think I understand how to generate the URL except for the signature and maybe the id. Ideally, I'd like to do everything without leaving the sandbox. For example, I've collected this information from the sandbox regarding one particular Blondie song:
Dreaming,Essential,emi_open_collection/EMIDD1337110.mp3,843be8c5a232a7fdd4263e107d38291c,audio,open_collection
Now I'd like to listen to it to see if it is suitable for my game. So I think I want to put together a URL that looks something like this:
NSString* req = [NSString stringWithFormat:@"http://developer.echonest.com/api/v4/sandbox/access?api_key=%@&sandbox=%@&id=%@&oauth_consumer_key=%@&oauth_nonce=%@&oauth_timestamp=%@&oauth_signature_method=HMAC-SHA1&oauth_signature=%@", api_key, oauth_consumer_key, oauth_nonce, oauth_timestamp, sandbox, asset, oauth_signature];
I know what most of the parameters need to be, but I need to come up with oath_signature. Your documentation says this is kind of difficult and suggests using libraries, but when I look at Echonest Framework, Jen, and Pyechonest, I don't really see anything about HMAC-SHA1 encoding unless I am perhaps skipping over it. Of course, it would be ideal to have some function that I could include in an Objective-C program if possible.
I looked at the OAuth site suggested and even the NetFlix site. There just seem to be so many steps, including sorting parameters and working with the "base URL" (not sure what that means), that my chances of getting it to work exactly right seem small, so, as you suggest, using an existing library function seems much more practical, even if I have to switch languages to do it.
If all that is done successfully, is it true that it then hands me a temporary URL where I can access the audio as an mp3 file?
I think some of the audio files in the sandboxes could be quite good for my game, but right now I just need to listen to them carefully to pick out what I'd like to use.
Thanks much,
Bruce
|