what is the fastest method to clone WaveStream-Objects?
Something like this?
private WaveStream CopyWaveStream(WaveStream input)
int bufferLength = (int)input.Length;
byte streamBuffer = new byte[bufferLength];
input.Read(streamBuffer, 0, bufferLength);
MemoryStream newMemStream = new MemoryStream();
var fileWriter = new WaveFileWriter(newMemStream, input.WaveFormat);
fileWriter.WriteData(streamBuffer, 0, bufferLength);
WaveFileReader reader = new WaveFileReader(newMemStream);
Or exists simpler way with any BufferClass?
-I have to play 20 WaveStreams each one over 100 times with a short reaction time.
-And sometimes the same WaveStream can play many times at the same time.
-So i do the conversion-work only on first load and cache this WaveStream.
-I need the same wavestream-data with different play-positions at the same time...this means: i have to clone the CachedWaveStream with a minimum effort for each instance
I know this is a complex-scenario...lets focus in this discussion only on the fast cloning of WaveStreams. Thanks :)