Beispiel #1
0
        public SoundTouch()
        {
            _is64Bit = Marshal.SizeOf <IntPtr>() == 8;

            _handle = _is64Bit ? SoundTouchInterop64.soundtouch_createInstance() :
                      SoundTouchInterop32.soundtouch_createInstance();
        }
Beispiel #2
0
 public int GetUseQuickSeek()
 {
     if (_is64Bit)
     {
         return(SoundTouchInterop64.soundtouch_getSetting(_handle, SoundTouchSettings.UseQuickSeek));
     }
     return(SoundTouchInterop32.soundtouch_getSetting(_handle, SoundTouchSettings.UseQuickSeek));
 }
Beispiel #3
0
 public int GetUseAntiAliasing()
 {
     if (_is64Bit)
     {
         return(SoundTouchInterop64.soundtouch_getSetting(_handle, SoundTouchSettings.UseAaFilter));
     }
     return(SoundTouchInterop32.soundtouch_getSetting(_handle, SoundTouchSettings.UseAaFilter));
 }
Beispiel #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));
 }
Beispiel #5
0
 public void SetChannels(int channels)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setChannels(_handle, (uint)channels);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setChannels(_handle, (uint)channels);
     }
 }
Beispiel #6
0
 public void SetSampleRate(int sampleRate)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setSampleRate(_handle, (uint)sampleRate);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setSampleRate(_handle, (uint)sampleRate);
     }
 }
Beispiel #7
0
 public void SetPitchOctaves(float pitchOctaves)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setPitchOctaves(_handle, pitchOctaves);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setPitchOctaves(_handle, pitchOctaves);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #10
0
 public void SetTempo(float newTempo)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setTempo(_handle, newTempo);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setTempo(_handle, newTempo);
     }
 }
Beispiel #11
0
 public void SetRate(float newRate)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_setRate(_handle, newRate);
     }
     else
     {
         SoundTouchInterop32.soundtouch_setRate(_handle, newRate);
     }
 }
Beispiel #12
0
 public void Clear()
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_clear(_handle);
     }
     else
     {
         SoundTouchInterop32.soundtouch_clear(_handle);
     }
 }
Beispiel #13
0
 public void Flush()
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_flush(_handle);
     }
     else
     {
         SoundTouchInterop32.soundtouch_flush(_handle);
     }
 }
Beispiel #14
0
 public void PutSamples(float[] samples, int numSamples)
 {
     if (_is64Bit)
     {
         SoundTouchInterop64.soundtouch_putSamples(_handle, samples, numSamples);
     }
     else
     {
         SoundTouchInterop32.soundtouch_putSamples(_handle, samples, numSamples);
     }
 }
Beispiel #15
0
 private void DestroyInstance()
 {
     if (_handle != IntPtr.Zero)
     {
         if (_is64Bit)
         {
             SoundTouchInterop64.soundtouch_destroyInstance(_handle);
         }
         else
         {
             SoundTouchInterop32.soundtouch_destroyInstance(_handle);
         }
         _handle = IntPtr.Zero;
     }
 }