at the moment, trying to understand how I can play the wave file in C # by filling the secondary buffer with data from the wave file through streams, and then play the wave file.
Any help or sample coding that I can use?
thanks
code example used:
public delegate void PullAudio(short[] buffer, int length); public class SoundPlayer : IDisposable { private Device soundDevice; private SecondaryBuffer soundBuffer; private int samplesPerUpdate; private AutoResetEvent[] fillEvent = new AutoResetEvent[2]; private Thread thread; private PullAudio pullAudio; private short channels; private bool halted; private bool running; public SoundPlayer(Control owner, PullAudio pullAudio, short channels) { this.channels = channels; this.pullAudio = pullAudio; this.soundDevice = new Device(); this.soundDevice.SetCooperativeLevel(owner, CooperativeLevel.Priority);
}
The concept is the same as im, but I canβt get the wave byte [] dataset for playback
source share