filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

SampleAggregatorBase Position #353

Closed ArizonaInkStudios closed 5 years ago

ArizonaInkStudios commented 5 years ago

I have been playing with the SoundTouch library and readdressing the issues you had brought up. I noticed a couple of things on the rewrite I did; I am hoping you might have some insight.

I changed the SoundTouchSource to be a SampleAggregatorBase and got everything working except for one thing. I noticed the position does not update according to the amount of data read when using WasapiOut. If I use DirectSoundOut the position updates quickly as expected.

Any thoughts on to why that would be? I can update the example with a new pull request to show the changes I made to better help you, but I did not know if there was something I was missing.

Thank you for your help! I am trying to make this even better for those who may want to use it.

ArizonaInkStudios commented 5 years ago

I also noticed that peak meter data is not being used when I choose DirectSound either. Is this by design?

ArizonaInkStudios commented 5 years ago

I fixed both issues.

The SoundTouch appending to source needs to happen BEFORE the peak meter is added and everything will work just fine.

Using the SoundTouch position instead of the SoundOut position resolves the position problem I was having before.

The PR has been updated.