Comments (8)
Those end up being pretty heavy-duty in terms of dependencies - FAudio is in the same boat as SDL where we really need everything to be either self-contained or something that's zlib-licensed (or stb-style public domain), since many targets can't bring something like ffmpeg into the mix. But, being in the same boat, I've kept a close eye on how SDL has dealt with resampling in particular, and the result is that we have 2 options:
- Add a path for libsamplerate, can be dynamically loaded: https://github.com/libsdl-org/SDL/blob/main/src/audio/SDL_audiocvt.c#L497
- Make resampling an FAudio_platform_* function, and add pitch shift support to SDL_AudioStream: https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_audio.h#L685
Way back in the day I attempted to use option 2 and the result was pretty limited; we have to be able to adjust the sample rate pretty much all the time, so most resampling libraries don't cut it in terms of all the fussy things XAudio needs. I did my best to take notes from Chris Robinson and OpenAL Soft (without actually using the code, for licensing reasons), but yeah, it's definitely got some sharp edges.
Mixing is a bit tougher because of the way XAudio2 processes channels; mixing isn't hard but writing handwritten SIMD can be sometimes... unlike resampling I actually don't think there's anything that does exactly what XAudio does, but at the same time it's much easier to get correct than resampling.
from faudio.
Assuming I understand correctly, in both cases we'll need to keep the current code path around, which means I'll need to fix the current resampling code anyway. Having to do that and spend effort on improving a less featureful, non-copyleft project does not sound particularly appealing.
I haven't touched the mixing code much but it does indeed seem like the resampler is in much worse shape than the mixer (and would also benefit more from being outsourced).
What prevents FAudio from linking to an LGPL library?
from faudio.
FAudio targets consoles and mobile, both of which disallow LGPL binaries :/
I do agree that improving something like SDL's resampling would have a much bigger impact than trying to fix up this one, so if we can get a third party library to do this well it would make the possibility of nuking the old path a whole lot easier (and whatever library that comes in to fix it can presumably be reused for the Wine path as well, even if it has to statically link some SDL files manually or something).
from faudio.
Remembered that we have an issue filed for this in SDL3:
from faudio.
Looks like Ryan might be doing this for us, could be worth a review when he submits it?
from faudio.
Talked to Ryan last night and confirmed this should do what I had hoped we could do a few years ago - so, if you'd like, you can replace the resampler with whatever you think will work best for the win32 target, and as long as SDL3 can implement the same layer we should be good to go.
from faudio.
from faudio.
The new SDL audio converter is now in the SDL3 branch - you can find the test program here, demonstrating the pitch shifting capabilities in particular: https://github.com/libsdl-org/SDL/blob/main/test/testaudiostreamdynamicresample.c
from faudio.
Related Issues (20)
- Add support for (custom) HRTF HOT 3
- FAudio versions after 22.07 cause popping HOT 1
- Does this library support Android version? If supported, how to compile it? HOT 2
- Super Meat Boy makes ear shattering sound with faudio. HOT 7
- Spider-Man: Shattered Dimensions - dialogue audio doesn't play HOT 4
- Bool size in Darwin ppc ABI is 4-byte (Windows too?) HOT 8
- FAudio.h:723: error: wrong number of arguments specified for ‘deprecated’ attribute HOT 3
- Failure with audio device with 18 inputs: "OpenAudioDevice failed: Unsupported number of audio channels" HOT 3
- warning: expression result un used [-Wunused-value]
- Document graph dependency issues for DestroyVoice
- Segmentation Fault. HOT 1
- Playing VVVVVV on the Wii gives just noise HOT 4
- Running into a segmentation fault HOT 1
- Moorhuhn Director's Cut crashes inside FACTSoundBank_Prepare HOT 2
- SDL3 support HOT 12
- (Question) Implementing Spatial Audio HOT 2
- Windows tests don't compile (unknown type name ‘IXAudio27SourceVoice’)
- Assertion failed: !FAILED(hr) && "Failed to get default audio endpoint!" when there are no audio devices
- SDL3 ABI Checklist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faudio.