AudioOutput, how does it work

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Hendrik
Posts: 21
Joined: Wed Aug 05, 2015 2:27 pm

AudioOutput, how does it work

Post by Hendrik » Thu Oct 29, 2015 10:05 am

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?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: AudioOutput, how does it work

Post by ArctionPasi » Mon Nov 02, 2015 10:44 am

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 558 times
I hope this helps :geek:
LightningChart Support Team, PT

Hendrik
Posts: 21
Joined: Wed Aug 05, 2015 2:27 pm

Re: AudioOutput, how does it work

Post by Hendrik » Tue Nov 03, 2015 9:54 am

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.

Hendrik
Posts: 21
Joined: Wed Aug 05, 2015 2:27 pm

Re: AudioOutput, how does it work

Post by Hendrik » Fri Nov 27, 2015 7:54 am

Hi,

Any impact on this?

Thanks

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: AudioOutput, how does it work

Post by ArctionPasi » Fri Nov 27, 2015 8:05 pm

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.
LightningChart Support Team, PT

Hendrik
Posts: 21
Joined: Wed Aug 05, 2015 2:27 pm

Re: AudioOutput, how does it work

Post by Hendrik » Mon Nov 30, 2015 7:06 am

Thanks. I will do it that way.

Post Reply