public void Draw()
        {
            // Create the sampler that we will use to pull data
            InputSampler = new Sampler((int)FFTDataSize.FFT2048);

            worker.DoWork += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            worker.WorkerSupportsCancellation = true;

            // Start the background worker
            worker.RunWorkerAsync();
        }
Esempio n. 2
0
        public static void Initialize()
        {
            // This should help prevent playback hiccups
            Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.High;

            // Initialize the SoundTouchSharp library
            _soundTouchSharp = new SoundTouchSharp();
            _soundTouchSharp.CreateInstance();

            _currentPitch = 0.0f;
            _currentTempo = 1.0f;
            _currentVolume = 0.25f;

            // Initialize the sampler
            // Create a new sampler object
            InputSampler = new Sampler((int)FFTDataSize.FFT2048);

            stopWorker = false;
            IsInitialized = true;
        }