Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effect handler which changes buffer length #78

Open
mbpictures opened this issue May 13, 2024 · 1 comment
Open

Effect handler which changes buffer length #78

mbpictures opened this issue May 13, 2024 · 1 comment

Comments

@mbpictures
Copy link

mbpictures commented May 13, 2024

Hi again!

I want to implement an effect callback for the Mix_RegisterEffect function, which changes the playback speed of a track (e.g. using this lib). Doing something like this would cause the output buffer of the buffer to increase or decrease in length. I saw some implementations for the "normal" SDL Mixer lib using Mix_Chunk and storing the complete buffer (so it's possible to access data outside of the current buffer of the effect callback). Do you have an idea how to implement something like that using music streams?

Thanks already very much!

@Wohlstand
Copy link
Member

Hello!
The public API of effects doesn't allows to apply effects with the buffer length change at least for now. But, internally it's possible to add any kind of effect (i.e. filter) that can change the length of the buffer (right now these are used to convert sample format, channels count and perform resampling). I had thinks to implement use of such library too, but there was a discussion between me and some other folks that complains the quality of slowdowned results and suggested me to try better algorithms. Right now I do have the simple speed implementation through the sample rate change hack at the stb-vorbis module, and that's not ideal as clicks were made during the sliding of the speed factor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants