Closed ArizonaInkStudios closed 6 years ago
Sure thing!
I moved it.
Great, I've added two comments. Maybe we can fix that and merge it afterwards. Thanks!
All complete. Let me know if we have any other oddities.
Did you give the sample a go?
Sample looks good to me. Just one question. Why is there a coefficient of 8? See https://github.com/ArizonaInkStudios/cscore/blob/master/SoundTouchPitchAndTempo/SoundTouchSource.cs#L74 and following.
Also one last please: Move the sample to the Samples folder. Thanks! :+1.
The number of bytes read. It may not be correct and I am open for changes!
I don't think that this will really work. There are different input pcm formats like 8, 16, 24, 32 bit. Also the underlying WaveSource might provide Ieeefloat. I would suggest the following:
SampleAggregatorBase
instead of WaveAggregatorBase
Read
method will provide floating point values automatically. Those are things to consider absolutely. I do have a separate project with this code working and it seeks without issue. Nonetheless, perhaps more testing with other PCM formats is in order to ensure that works.
Most of the tests I have done are with MP3 that are 16bit I believe. I will create some test wave files and do some hard testing to see what may break or cause issues.
The SoundTouch examples are not very well done and I had to use the source and the examples and the lack of documentation to make this work. I am definitely not an expert on how some of their library works.
I will take your suggestions and see what changes can be made. You know your project better than anyone. Thank you for your help! Hopefully we can get a good sample working that fulfills all the sources.
Here is my results from testing.
I used: 8bits-48khz.wav 16bits-48khz.wav 24bits-48khz.wav 32bits-IEEE-48khz.wav
All of these worked with the code as is.
I also did seeking and position changing while tempo/pitch change and it all worked as expected.
I tried to convert to SampleAggregatorBase and use float buffers as the base and that was bad; VERY bad. Using the float buffer in many different attempts I either got an exception and bad explosions or the audio was choppy, had static, and was not audio that was good in any way. I am all for updating this but I am a bit stumped on how to accomplish it. I am open for suggestions.
Sorry this is such an ordeal. I will not give up. If there is a better answer, I would like to find it.
Sorry for the late response. I've merged it. Thanks!
No worries! Glad I could help and contribute something. I hope to do more in the future! Great working with you.
Great! But could you please move it to a seperate project within the Samples folder? Would like to keep main CSCore project clean from dependencies. Similar to the https://github.com/filoe/cscore/tree/master/Samples/NVorbisIntegration sample.