echonest / enios

Updated iOS wrapper for EN API
71 stars 22 forks source link

Upload a file to track #2

Open jacks8x opened 10 years ago

jacks8x commented 10 years ago

Hi, how can I upload my mp3 in local file to your server and then get info about this sample in iOS. With your api I can use to send a link then analysis it, but I don't know how to upload a file, I see there is no API to do this (I see this api in Java, but not iOS)

plamere commented 10 years ago

jacks8x - enios should support track upload directly, but I haven't personally tried it. Take a look at

add a parameter 'track' that is of type NSData that contains the mp3. You'll probably also need to set a filetype parameter to @"mp3" as well.

You may be the first to head down this road, so if you have trouble let me know. I have some code for uploading a track to the Echo Nest for analysis that I know works (however, it doesn't use ENIOS). You can use it in a pinch if you have trouble with the ENIOS code. The upload code is here:

https://gist.github.com/plamere/10638004

jacks8x commented 10 years ago

Hello, I use ENAPIRequest POSTWithEndpoint for analysis a file in a url and it works great. But when I want to upload file from Bundle to test I have no idea how to use your api to add mp3 data to the body for request. In your upload code link I have confused what is Track

plamere commented 10 years ago

The code that I posted does not use ENIOS, it is from a personal project. The Track in that code is my own track class.