echonest / echoprint-ios-sample

Sample Echoprint song identifier for iOS
http://echoprint.me/
165 stars 53 forks source link

make this better #1

Open bwhitman opened 13 years ago

bwhitman commented 13 years ago

from jimmcgowan

I'm using the EchoPrint Codegen for an OSX based project, and I was looking through the iPhone example code, and it seemed a bit overcomplicated as it does an audio conversion to LPCM of the whole compressed file, writes out the uncompressed version to disk and then re-reads the uncompressed file to input to the codegen. A more efficient method is to create an ExtAudioFile for the compressed file, attach an LPCM format description to the ExtAudioFile as its Client Format, then read the first 30 seconds of the file into a buffer. The client format causes the results of the read to be in the LPCM format, so the buffer can be passed directly to the codegen.

I've posted a code sample at https://gist.github.com/1073528 Hopefully it will help iOS or Mac OS X Cocoa developers get off the ground with EchoPrint a bit quicker.

Thanks to the EchoPrint team for giving is such a great tool!