Re: Reading capture data from network stream

From: Chris P. [MVP] (msdn_at_chrisnet.net)
Date: 02/21/05


Date: Mon, 21 Feb 2005 18:00:57 -0500

On Mon, 21 Feb 2005 22:32:03 -0000, mphcomputers@hotmail.com wrote:

> Hi..
>
> I am not a newbie to .NEt or c# but wuld not say im a wealth of knowledge
>
> I am trying to send captured data over a network and then play it on other
> Pc.. like VOIP
>
> I have the correct data captured as it plays after capture.
>
> I have debugged the data after network transmission and
> the same values are conatined in both pre and post bytes arrays
>
> I have tried to set the buffer to read from the network stream directly but
> still no joy.
>
> Can anybody help me with this as its doing my skull in and im ready for
> booting my Pc through the window
>
> Again my basic problem is The data transmitted over the network plays as
> noise in my sound buffer, how do i read it in so it plays correctly?

There's no magic, data is data.

To help debug your code I would write the network stream to disk along with
an appropriate wav header and see what it sounds like played back.

It the sound output is random noise then it would seem the data isn't
getting copied into the sound buffer. Sometimes for debugging sake it's
worth replacing the copy with a data set that initializes the buffer to a
series of bytes that represent a tone. A crude square wave will do such as
{5000, 5000, 5000, 5000, 5000, -5000, -5000, -5000, -5000, -5000}

I don't know anything about .NET that would be special here. What
interface are you using for sound output?



Relevant Pages