cscore
cscore copied to clipboard
Playing from memory
I'm Currently writing audio to disk and playing back from said location. I'm now trying to skip the writing to disk part and cant figure it out, would anyone be able to advise?
So far I have been going of this:
https://stackoverflow.com/questions/37333969/cscore-play-audio-from-a-filestream-or-memorystream
How I need to so for a wav and marry the two together.
Thank you,
Initialize a WriteableBufferingSource
with the correct format and set FillWithZeros
to true
.
Playback the initialized WriteableBufferingSource
with the soundout.
Use the Write
method of the WriteableBufferingSource
to write data to the buffer.
Note that the format of the data must be any decoded raw format like pcm or ieeefloat.
If you have a program to write the diskfile, change it to write to MemoryStream. instead of close/open the file, set MemoryStream.Position=0 and offer the file to the player.