private void Core_AudioSampleBatch(IntPtr data, uint frames) { if (Audio != null) { AudioSample[] samples = new AudioSample[(int)frames]; unsafe { short* _data = (short*)data; for(int i = 0; i < frames; i++) { samples[i] = new AudioSample(_data[i * 2], _data[(i * 2) + 1]); } } AudioEventArgs args = new AudioEventArgs(); args.Samples = samples; Audio(this, args); } }
private void Core_AudioSample(short left, short right) { if(Audio != null) { AudioEventArgs args = new AudioEventArgs(); args.Samples = new AudioSample[1] { new AudioSample(left, right) }; Audio(this, args); } }