Page 1 of 1

AudioOutput, how does it work

Posted: Thu Oct 29, 2015 10:05 am
by Hendrik
Hi,

I want to use your AudioOuput for streaming my data (generated by code) to the speakers but I can't get it to work. The code I have so far.

AudioOutput ao = new AudioOutput();
ao.BitsPerSample = 16;
ao.SamplesPerSecond = 40000;
ao.IsStereo = true;
double[][] d2 = new double[2][];
d2[0] = data.samples;
d2[1] = data.samples;
ao.AddSamples(d2);
ao.Start();

But I hear no sound. What do I miss hear?

Re: AudioOutput, how does it work

Posted: Mon Nov 02, 2015 10:44 am
by ArctionPasi
Hi,

it needs a sequential data flow.

I wrote an example, which contains MultiChannelDataPlaybackFeeder, which outputs samples at correct pace for AudioOutput component.
WpfAudioOutputDataFeedingFromDoubleArrays.zip
WPF audio output example
(9.56 KiB) Downloaded 599 times
I hope this helps :geek:

Re: AudioOutput, how does it work

Posted: Tue Nov 03, 2015 9:54 am
by Hendrik
Hi,

that helped me allot. Thanks for that. I seems that the sound is looping all the time. Can I avoid this behavior that the sound will only play If new data is added?

Thanks.

Re: AudioOutput, how does it work

Posted: Fri Nov 27, 2015 7:54 am
by Hendrik
Hi,

Any impact on this?

Thanks

Re: AudioOutput, how does it work

Posted: Fri Nov 27, 2015 8:05 pm
by ArctionPasi
The DirectSound buffers keep looping the sound if no new data is added. Keeeping the dataflow constant is important. Maybe you can set AudioOutput volume low to prevent it from being audible.

Re: AudioOutput, how does it work

Posted: Mon Nov 30, 2015 7:06 am
by Hendrik
Thanks. I will do it that way.