hakko / subsonic

A streaming music server. Based on Subsonic, with MusicCabinet integration.
34 stars 20 forks source link

Enhancement: track.getSimilar #36

Open nichtmax opened 11 years ago

nichtmax commented 11 years ago

Hi hakko,

first of all: thank you for your work, musiccabinet is awesome!

I got one suggestion: what about track.getSimilar? That feature would be really great at parties and could be integrated into the playlist. I have no experience at all with last.fm and java, so unfortunately I can't program this myself. But maybe you like the idea?

Another thing: The downsampling command in the transcoding section only works with mp3 files, all other files are just piped. Any chance to change that behavior? ffmpeg doesn't care for the input (downsampling can be done with ffmpeg instead of lame).

//edit: this is set in https://github.com/hakko/subsonic/blob/master/subsonic-main/src/main/java/net/sourceforge/subsonic/service/TranscodingService.java in line 438. I guess just removing that check should do the trick.

Regards, Moritz

hakko commented 11 years ago

I used track.getSimilar in an early release of MusicCabinet but gave up on it. Reasons: generated playlists quickly became predictable, I had to invoke getSimilar "live" which made playlist generation take 5 sec or more (that's forever) and doing it for all tracks in advance isn't feasible. So I don't know.. I don't think it's the best approach.

How is downsampling used in Subsonic? I don't use that myself so I can't really tell for sure what the implications are. If you give me a good explanation on possible issues, I'll be more likely to remove the check. :)

Regards

nichtmax commented 11 years ago

Regarding the downsampling: This is mainly used for external apps in cellular networks. Here's a screenshot from iSub..

I think Sindre realized this with lame in the first place. That is why lame is included in the package. Lame doesn't take anything else than MP3 (and wav..) as input, therefore the restriction. There is no reason not to do this with ffmpeg though, the main advantage would be that the input file could be M4A for instance. As ffmpeg is in the package as well there is no disadvantage.

The line for the downsampling would be

ffmpeg -i %s -ab %bk -v 0 -f mp3 -

aaronk6 commented 11 years ago

Hi hakko,

why do you think it's a problem when it takes 5 secs to generate a playlist?

Amarok 1.4 had this feature (I don't know about 2.x though) and it worked quite well. IIRC, there were two different ways to listen to similar tracks:

I'm not sure how this can be integrated into Subsonic/MusicCabinet. I would love this feature though.

Thanks for the good work!

hakko commented 11 years ago

Thanks for the explanation wernermo! That makes sense to me. So I'll remove the restriction.

IceSheep: To me, using track.getSimilar just meant more repetitive playlists than the current artist radio implementation, and with slower generation, so they didn't really have any advantages. It would definitely be interesting to analyze tracks in your library and find similar ones, but I'd think that something like Echo Nest would be more useful for that.

nichtmax commented 11 years ago

Awesome! If you need me to test it drop me a mail.