This project has moved and is read-only. For the latest updates, please go here.

Create WaveStream Instance using byte [] buffer

Aug 29, 2008 at 1:28 PM
Dear Sir,

Thanks a lot for such a good Library to perform Audio related functionality.

I have 2 question, first is much simpler and hope it would take just 2-3 minutes of yours to answer.

I want to play recorded bytes i.e in Eventhandler after writting e.buffer to file, I also want to hear it.

One way (What I think) can be using WaveOut.Play , by providing instance of WaveStream in WaveOut.Init().

Problem is that How to Instantiate WaveStream, becuase all your examples use to read from file using WaveFileReader, and I want to read bytes buffer.

Simply speaking , I want to create a WaveStream instance from bytes array instead of wav file.

Second question is , that can we detect silance in bytes buffer.

I mean that If I want to record only that buffer which ha some data in it, i.e. I want to record only when I speak in Microphone and not when I remain silent.

Thanks a lot.


Sep 3, 2008 at 11:23 PM
Hi there
I replied to your first question on another thread. For your second question, you need to check that each byte is zero in the input buffer. Unfortunately, there is no other way at the moment.