Open ionarevamp opened 7 months ago
By the way, I had the idea to do my own form of audio queueing by effectively concatenating the data buffers of different loaded files, one after another. I'll do that when I have some free time and make another comment about its effectiveness. In theory, it should work though.
Using a Sound struct and implementing the callback function for it (based on the wav file example), I was able to then call the .lock()
method on a generated AudioDevice<Sound>
instance and append the contained data
vector with that of another wav file.
It works perfectly.
Now just to make some changes to the Vec structure and the callback function, along with writing a couple new audio-pairing functions, and I should be able to mix audio ""manually"" without the need to link to the mixer library.
The dependency is defined as such in
Cargo.toml
:However, I get this error when calling
sdl2::mixer::init(...)
Linking statically without the NDK doesn't work (and I don't want to use it as it doesn't seem to work correctly anyways and takes up too much space on this device), and specifying -L or -l flags doesn't fix the problem either.
I would really like to use the mixer library for volume control when playing music, as the next best thing for high-quality gapless playback is to use the queuing methods which don't have direct volume control. If anyone knows a good workaround in the meantime that would be great.