From: Julien C. <jco...@re...> - 2000-10-27 07:17:09
|
Hi, > -------------------------------- > 1. Which part of a song is the Songprint ID really based on? (30 secs ?) > -------------------------------- Here is what Bob Copeland replied to me a couple days ago : "Nope, there are no docs on the algorithm. The gist of it: - for every block of 2048 samples, do an fft, then quantize to 16 bands. - repeat for 30 seconds worth of pcm data - generate the mean and std deviations of those 16 bands across the 30 secs. Etantrum has some beat analyzing code that would improve the algo, but whether or not it sees the light of day remains to be seen." So it seems you are right for the 30 seconds thing ! I agree that this is not perfect. But I think this kind of "a couple seconds missing" ripping is rather rare. I just started looking into the code last week so I am no guru, and I don't know what could be better. It seems etantrum is working on a "streamID" though, which I hope could help identify music when you missed the beginning. > -------------------------------- > 2. Is there any easy way to capture the Songprint key locally from > sp_example? > -------------------------------- > I'm trying to identify the Songprint ID generated by sp_example so that > I can use it to query Songprint separately from the key extraction > process. Is there an easy modification that I can do to sp_example to > allow me local access to the key? In the sp_identify_file, there is sp_generate_signature used. Here is the interface. /** * sp_generate_signature: * @song_audio_format Audio format of pcm data stream * @signature Structure to which signature is written * @get_pcm_data Callback to get samples from pcm data stream * @user_data Caller-defined parameter to pcm callback * * Generates a signature for a waveform. All pcm data is procured * by calling @get_pcm_data, and the resulting signature is stored * in @signature. * * Returns SP_SUCCESS if a signature was successfully generated. */ sp_rv sp_generate_signature (sp_audio_info_t * song_audio_format, sp_signature_t * signature, guint (*get_pcm_data) (guint sample_offset, guint num_samples, guchar * output_buf, void *user_data), void *user_data) It seems to be what you are looking for. The developers will correct me if I am wrong :) After this signature (songprintID) is generated, it seems to be sent to the server which replies with the MusicID. Also, the sp_identify_file (a bit shortened) seems to fit what you would like to do. NB to freetantrum admins : It is weird that a reply to a freetantrum-devel post goes to the sender instead of the mailing list (maybe with a CC to the sender ?). See you Julien |