예제 #1
0
        public SoundTouch()
        {
            _is64Bit = Environment.Is64BitOperatingSystem;

            _handle = _is64Bit ? SoundTouchInterop64.soundtouch_createInstance() :
                      SoundTouchInterop32.soundtouch_createInstance();
        }
예제 #2
0
 public int GetUseQuickSeek()
 {
     if (_is64Bit)
     {
         return(SoundTouchInterop64.soundtouch_getSetting(_handle, SoundTouchSettings.UseQuickSeek));
     }
     return(SoundTouchInterop32.soundtouch_getSetting(_handle, SoundTouchSettings.UseQuickSeek));
 }
예제 #3
0
 public int GetUseAntiAliasing()
 {
     if (_is64Bit)
     {
         return(SoundTouchInterop64.soundtouch_getSetting(_handle, SoundTouchSettings.UseAaFilter));
     }
     return(SoundTouchInterop32.soundtouch_getSetting(_handle, SoundTouchSettings.UseAaFilter));
 }
예제 #4
0
 public int ReceiveSamples(float[] outBuffer, int maxSamples)
 {
     if (_is64Bit)
     {
         return((int)SoundTouchInterop64.soundtouch_receiveSamples(_handle, outBuffer, (uint)maxSamples));
     }
     return((int)SoundTouchInterop32.soundtouch_receiveSamples(_handle, outBuffer, (uint)maxSamples));
 }
예제 #5
0
 public void SetChannels(int channels)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setChannels(_handle, (uint)channels);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setChannels(_handle, (uint)channels);
     }
 }
예제 #6
0
 public void SetSampleRate(int sampleRate)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setSampleRate(_handle, (uint)sampleRate);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setSampleRate(_handle, (uint)sampleRate);
     }
 }
예제 #7
0
 public void SetPitchOctaves(float pitchOctaves)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setPitchOctaves(_handle, pitchOctaves);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setPitchOctaves(_handle, pitchOctaves);
     }
 }
예제 #8
0
 public void SetUseQuickSeek(bool useQuickSeek)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setSetting(_handle, SoundTouchSettings.UseQuickSeek, useQuickSeek ? 1 : 0);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setSetting(_handle, SoundTouchSettings.UseQuickSeek, useQuickSeek ? 1 : 0);
     }
 }
예제 #9
0
 public void SetUseAntiAliasing(bool useAntiAliasing)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setSetting(_handle, SoundTouchSettings.UseAaFilter, useAntiAliasing ? 1 : 0);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setSetting(_handle, SoundTouchSettings.UseAaFilter, useAntiAliasing ? 1 : 0);
     }
 }
예제 #10
0
 public void SetTempo(float newTempo)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setTempo(_handle, newTempo);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setTempo(_handle, newTempo);
     }
 }
예제 #11
0
 public void SetRate(float newRate)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setRate(_handle, newRate);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setRate(_handle, newRate);
     }
 }
예제 #12
0
 public void Clear()
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_clear(_handle);
     }
     else
     {
         SoundTouchInterop32.soundtouch_clear(_handle);
     }
 }
예제 #13
0
 public void Flush()
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_flush(_handle);
     }
     else
     {
         SoundTouchInterop32.soundtouch_flush(_handle);
     }
 }
예제 #14
0
 public void PutSamples(float[] samples, int numSamples)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_putSamples(_handle, samples, numSamples);
     }
     else
     {
         SoundTouchInterop32.soundtouch_putSamples(_handle, samples, numSamples);
     }
 }
예제 #15
0
 private void DestroyInstance()
 {
     if (_handle != IntPtr.Zero)
     {
         if (_is64Bit)
         {
             SoundTouchInterop64.soundtouch_destroyInstance(_handle);
         }
         else
         {
             SoundTouchInterop32.soundtouch_destroyInstance(_handle);
         }
         _handle = IntPtr.Zero;
     }
 }