// after preparing analysis data (asynchronous)function onprepare(file, result) { // skip all not audio files if (!result) return; // add to results list results.analysis.add(file, 'rating', myrating(file.analysis));}// file processing callback (asynchronous)function onfile(file) { // just try to receive analyse data, if it has such data this is audio file analysis.prepare(file, onprepare)}// folder processing callback (asynchronous)function onfolder(folder) { // recursively process subdir with same callbacks process(folder, onfile, onfolder);}function myrating(data) { var score = 1.0; // sample rate score *= 0.5 + 0.5 * (Math.min(44100, Math.max(22050, data.samplerate)) - 22050) / 22050; // bitrate if (data.bitrate > 0) score *= 0.5 + 0.5 * (Math.min(128000, Math.max(64000, data.bitrate)) - 64000) / 64000; // max.freq score *= 0.5 + 0.5 * (Math.min(18500, Math.max(12000, data.maxFreq)) - 12000) / 6500; // stereo/mono if (data.channels == "mono") score *= 0.5; // clipping score *= 0.7 + 0.3 / (0.01 * data.clips + 1.0); // dynamic range if (data.absMax < 0.75) score *= 0.7 + 0.3 * (Math.max(0.25, data.absMax) - 0.25) * 2.0; // dc offset if (data.absMean >= 0.05) score *= 0.7 + 0.3 * (0.1 - Math.max(0.1, data.absMean)) * 20.0; if (data.minStep >= 0.00004) score *= 0.5; return score;}// clear all results in programresults.analysis.clear();// start processing files via callbacksvar folders = settings.folders;for (var idx = 0; idx < folders.length; ++idx) { process(folders[idx], onfile, onfolder);}
Hi support,I am a Mac OS X 10.8.5 user: will there be a new beta for this version soon? Thanks for the support.