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
[request if possible] add r8brain resampling #922
Comments
I'm not sure if that's usable for OpenAL, at least in that form. OpenAL needs to be able to adjust the resampling rate on the fly, as a result of AL_PITCH or AL_VELOCITY changes, and OpenAL Soft needs it to be real-time safe (no (re)allocations, etc when running or updating). It also needs to track sub-sample positions. It may be possible to take out the guts of the resampler and fit it into what OpenAL Soft needs, though it would be a fair bit of work. |
https://github.com/avaneev/r8brain-free-src#real-time-applications found this on the git page |
just a poke :P |
I wouldn't expect it any time soon. It would need significant changes to make work with the library as well as adding the ability to dynamically adjust the resampling rate in a real-time-safe manner. I also wouldn't be surprised if performance ends up a problem, since OpenAL needs to be able to resample potentially hundreds of sounds at once, with higher quality resamplers having higher CPU impact. |
it's realtime friendly though (based on the source page) either way, ill leave this open for now and if it does end up being added in the future i will close this... unless it ends up not being possible |
The actual processing is, but changing the resampling rate needs to allocate new structures and buffers, which isn't real-time safe. OpenAL has different requirements for resampling sources than fixed playback or conversion, like being able to accurately report the playback position in a passively fed buffer queue, or being able to dynamically ramp the playback speed up and down. Low-latency mixing and playback will also always run into limits with resampling quality due to better quality resampling needing larger filters, which increases latency. |
As a possible alternative, have you looked into the resampler from SpeexDSP? No idea how well it reacts to frequent input rate changes, but quality and latency are pretty decent. |
I haven't looked into that. From a quick look, it seems potentially more doable, though from what I'm reading, it seems to be very similar to what OpenAL Soft already has for the bsinc resamplers; the primary difference seems to be that OpenAL Soft uses linear interpolation between phase indices while speex uses cubic (though it's unclear how much that influences the quality; it seems speex primarily does that to make the tables smaller, and doesn't mention any impact on quality). Aside from that, OpenAL Soft has only a couple settings (12 points up to 24 for downsampling, and 24 points up to 48 for downsampling, all with a -60dB stop band) while speex has many more. Simply adding more options (larger filters that further attenuate the the stop band and shrink the transition band) would provide better quality resamplers like speex, although it's important to note that it will have an impact on performance even with a moderate (compared to speex) size of 64, given OpenAL may need to resample hundreds of sources at once as opposed to Speex, which only needs to do a handful of channels from an audio file. Its primary use-case would be for making the WASAPI resampler sound better where it only does a handful of channels, or replace some uses of the polyphase resampler to perform faster where quality isn't as important. |
title says it. see following links
https://www.voxengo.com/product/r8brain/
https://github.com/avaneev/r8brain-free-src
The text was updated successfully, but these errors were encountered: