norns-study-group / pirate-radio

norns pirate radio: explore, listen, share, contribute.
https://coffer.norns.online
GNU General Public License v3.0
33 stars 21 forks source link

a place to bury treasure #16

Closed schollz closed 2 years ago

schollz commented 2 years ago

and added the dial

schollz commented 2 years ago

ok I veered maybe off-course and can course-correct if needed but I just added in the "MP3 class" to use compressed audio. mp3s do not work because SoundFile.openRead(..) seems unable to get the duration of the file (for use with crossfade), but oggs work perfectly well! wav/flac still work too. but now this requires having oggdec and lame installed (apt install lame vorbis-tools).

if this is all the complexity it adds, it seems not so bad and will save tons of bandwidth and disk space (i.e. a 3 minute .flac -> .ogg reduced size from 29 MB to 2.1MB). but perhaps there are some cases I'm not accounting for (and I havent tested on norns yet)

catfact commented 2 years ago

should be fine on norns. the only thing i'd note is that the MP3 quark is a pretty rube goldberg kind of contraption, which does stuff like directly managing the lame process by its PID, and piping through a temp file: https://github.com/supercollider-quarks/MP3/blob/master/MP3.sc#L153

so its worth just keeping an eye on for weird bugs, and it might want a really large streaming buffer.

catfact commented 2 years ago

if one is going down that route anyway (leaning on unix components outside of supercollider) then i suppose one might as well get the duration by a similar method; e.g. ffmpeg -i thing.mp3 | grep Duration etc

catfact commented 2 years ago

hi ho, maybe merging this would be good!

schollz commented 2 years ago

i suppose one might as well get the duration by a similar method; e.g. ffmpeg -i thing.mp3 | grep Duration etc

this is a good idea, at least it will be nice for me to learn how to do that.

(I can merge now so I will go ahead an merge)