public void GetSamplesSync(out short[] samples, out int nsamp) { uint f_clock = LibMSX.MSX_get_audio(MSX_Pntr, Aud, ref num_samp); for (int i = 0; i < num_samp; i++) { blip.AddDelta((uint)Aud[i * 2], Aud[i * 2 + 1]); } blip.EndFrame(f_clock); nsamp = blip.SamplesAvailable(); samples = new short[nsamp * 2]; blip.ReadSamples(samples, nsamp, true); }
public void GetSamplesSync(out short[] samples, out int nsamp) { uint f_clock = LibMSX.MSX_get_audio(MSX_Pntr, Aud_L, Aud_R, ref num_samp_L, ref num_samp_R); for (int i = 0; i < num_samp_L; i++) { blip_L.AddDelta(Aud_L[i * 2], (int)Aud_L[i * 2 + 1]); } for (int i = 0; i < num_samp_R; i++) { blip_R.AddDelta(Aud_R[i * 2], (int)Aud_R[i * 2 + 1]); } blip_L.EndFrame(f_clock); blip_R.EndFrame(f_clock); nsamp = Math.Max(Math.Max(blip_L.SamplesAvailable(), blip_R.SamplesAvailable()), 1); samples = new short[nsamp * 2]; blip_L.ReadSamplesLeft(samples, nsamp); blip_R.ReadSamplesRight(samples, nsamp); }