Skip to content
Discussion options

You must be logged in to vote

After some experiments, it appears that using BinaryWriter to return a stream, regardless of whether it's a MemoryStream or FileStream, results in values being written as zeros. However, when writing to a FileStream and then opening it with File.OpenRead, the data is written correctly,
After further experiments, I found that BinaryWriter does not reset its position upon completion, resulting in the stream playing nothing. To resolve this, I added wavStream.Position = 0; before writer.Close();, and the sound played correctly using SoundFlowToMemoryStream. Regarding the zeros at the beginning of the file, I think this may be related to the decoder and does not affect playback. Instead of ma…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@SonneKiwiBird
Comment options

@LSXPrime
Comment options

Answer selected by SonneKiwiBird
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants