public BlipBuffer(int sampleCount) { _context = BlipBufDll.blip_new(sampleCount); if (_context == IntPtr.Zero) { throw new Exception("blip_new returned NULL!"); } }
public int ReadSamplesLeft(short[] output, int count) { if (output.Length < count * 2) { throw new ArgumentOutOfRangeException(); } return(BlipBufDll.blip_read_samples(context, output, count, 1)); }
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)); }
public void Dispose() { if (_context != IntPtr.Zero) { BlipBufDll.blip_delete(_context); _context = IntPtr.Zero; GC.SuppressFinalize(this); } }
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)); } }
public int SamplesAvailable() { return(BlipBufDll.blip_samples_avail(_context)); }
public void EndFrame(uint clockDuration) { BlipBufDll.blip_end_frame(_context, clockDuration); }
public int ClocksNeeded(int sampleCount) { return(BlipBufDll.blip_clocks_needed(_context, sampleCount)); }
public void AddDeltaFast(uint clockTime, int delta) { BlipBufDll.blip_add_delta_fast(_context, clockTime, delta); }
public void Clear() { BlipBufDll.blip_clear(_context); }
public void SetRates(double clockRate, double sampleRate) { BlipBufDll.blip_set_rates(_context, clockRate, sampleRate); }
public void Dispose() { BlipBufDll.blip_delete(context); context = IntPtr.Zero; }
public void AddDelta(uint clock_time, int delta) { BlipBufDll.blip_add_delta(context, clock_time, delta); }