Esempio n. 1
0
 private double AnalyzeBpm(double from, double to)
 {
     if (_channel == 0)
     {
         return(-1.0);
     }
     return(BassFx.BPMDecodeGet(_channel, from, to, 0,
                                BassFlags.FxBpmBackground | BassFlags.FXBpmMult2 | BassFlags.FxFreeSource, GetBPM_ProgressCallback));
 }
Esempio n. 2
0
        void DecodingBPM(bool newStream, double startSec, double endSec, string fp)
        {
            if (newStream)
            {
                // open the same file as played but for bpm decoding detection
                _bpmchan = Bass.CreateStream(fp, 0, 0, BassFlags.Decode);

                if (_bpmchan == 0)
                {
                    _bpmchan = Bass.MusicLoad(fp, 0, 0, BassFlags.Decode | BassFlags.Prescan, 0);
                }
            }

            // detect bpm in background and return progress in GetBPM_ProgressCallback function
            if (_bpmchan != 0)
            {
                Bpm = BassFx.BPMDecodeGet(_bpmchan, startSec, endSec, 0, BassFlags.FxBpmBackground | BassFlags.FXBpmMult2 | BassFlags.FxFreeSource, _progressProcedure);
            }
        }