Exemplo n.º 1
0
        public SoundTouch()
        {
            _is64Bit = Marshal.SizeOf <IntPtr>() == 8;

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