Closed itsAbhi650 closed 1 year ago
You don't need the WaveWriter
. You can store it within a normal Stream
. Just make sure to reset the Position back to zero by and open it with the RawDataReader
providing the Stream
(containing the data with Position = 0) and the WaveFormat
of the Source
.
Just for confirmation! Are you saying that I should do something like:
source.Read(buffer, 0, buffer.Length);
stream.Write(buffer, 0, buffer.Length);
stream.Position = 0;
RawDataReader rawdat = new RawDataReader(stream, source.WaveFormat);
...
Hey! I just tested this now and its working as expected.
Thanks..
Yes, but set the position of stream to 0 after you call Write()
Am 09.08.2022 um 21:40 schrieb Abhinav Pandey @.***>:
Just for confirmation! Are you saying that I should do something like:
source.Read(buffer, 0, buffer.Length); stream.Write(buffer, 0, buffer.Length); RawDataReader rawdat = new RawDataReader(stream, source.WaveFormat); ... — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
Yes I missed that part, Added that later and is working fine!
I'm trying to cut a part from an audio and resample it but after cutting I store the cut in a stream how should I change it to an IAudioSource to perform resampling?
The cut method is: