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

Updated SoundTouch to handle seeking and changed it over to a SampleAggregatorBase. #354

Closed ArizonaInkStudios closed 4 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 fixed all of the issues. I figured out the position issue AND added a bit of clean up to be able to close the form correctly.

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.

ArizonaInkStudios commented 5 years ago

Just curious if this is something you want to update or not? Is there more discussion or is this bad? Curious if you would like to have discussions about this.

ArizonaInkStudios commented 5 years ago

Wondering what you would like me to do with this PR?

ArizonaInkStudios commented 4 years ago

I believe this is a better implementation for pitch shifting for those who would like to use it. Any word on this being merged?