Exemple #1
0
 public BlipBuffer(int sampleCount)
 {
     _context = BlipBufDll.blip_new(sampleCount);
     if (_context == IntPtr.Zero)
     {
         throw new Exception("blip_new returned NULL!");
     }
 }
Exemple #2
0
 public int ReadSamplesLeft(short[] output, int count)
 {
     if (output.Length < count * 2)
     {
         throw new ArgumentOutOfRangeException();
     }
     return(BlipBufDll.blip_read_samples(context, output, count, 1));
 }
Exemple #3
0
 public int ReadSamples(short[] output, int count, bool stereo)
 {
     if (output.Length < count * (stereo ? 2 : 1))
     {
         throw new ArgumentOutOfRangeException();
     }
     return(BlipBufDll.blip_read_samples(context, output, count, stereo ? 1 : 0));
 }
Exemple #4
0
 public void Dispose()
 {
     if (_context != IntPtr.Zero)
     {
         BlipBufDll.blip_delete(_context);
         _context = IntPtr.Zero;
         GC.SuppressFinalize(this);
     }
 }
Exemple #5
0
 public int ReadSamplesRight(short[] output, int count)
 {
     if (output.Length < count * 2)
     {
         throw new ArgumentOutOfRangeException();
     }
     unsafe
     {
         fixed(short *s = &output[1])
         return(BlipBufDll.blip_read_samples(context, new IntPtr(s), count, 1));
     }
 }
Exemple #6
0
 public int SamplesAvailable()
 {
     return(BlipBufDll.blip_samples_avail(_context));
 }
Exemple #7
0
 public void EndFrame(uint clockDuration)
 {
     BlipBufDll.blip_end_frame(_context, clockDuration);
 }
Exemple #8
0
 public int ClocksNeeded(int sampleCount)
 {
     return(BlipBufDll.blip_clocks_needed(_context, sampleCount));
 }
Exemple #9
0
 public void AddDeltaFast(uint clockTime, int delta)
 {
     BlipBufDll.blip_add_delta_fast(_context, clockTime, delta);
 }
Exemple #10
0
 public void Clear()
 {
     BlipBufDll.blip_clear(_context);
 }
Exemple #11
0
 public void SetRates(double clockRate, double sampleRate)
 {
     BlipBufDll.blip_set_rates(_context, clockRate, sampleRate);
 }
Exemple #12
0
 public void Dispose()
 {
     BlipBufDll.blip_delete(context);
     context = IntPtr.Zero;
 }
Exemple #13
0
 public void AddDelta(uint clock_time, int delta)
 {
     BlipBufDll.blip_add_delta(context, clock_time, delta);
 }