FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.48k stars 339 forks source link

Fyrox-Sound glitchy sounds on Android #613

Closed maciekglowka closed 4 months ago

maciekglowka commented 4 months ago

Hi,

I've been using the fyrox-sound crate for my game (outside of the Fyrox engine context), which is overall a great experience, except for a small issue on the Android target. The sound clips often produce unwanted pops and glitches. I only play short sfx clips - no background music etc. I target a couple of platforms (also Win, Linux, WASM) and none of them faces this. It might be the problem somewhere further in the dependency tree, as I see that the sound crate is build on top of tinyaudio -> aaudio ? I've tried running the sound engine on a separate rust thread, which might have helped a bit (although it is hard to measure precisely by ear). Maybe this problem could be resolved by setting a larger audio buffer - but I do not seem to see such a setting in the API?

I am currently depending on the 0.34 version.

mrDIMAS commented 4 months ago

Hi! I made some fixes in tinyaudio (https://github.com/mrDIMAS/tinyaudio/commit/c6f409acfa147a80d2dfe412b37a2ca038f9f541) and it should now work fine. I don't have any audio issues on my Redmi Note 8, however when I'm using an emulator there's some occasional clicks from time to time which might be related to slowness of the emulator (these clicks disappear after a short time, but appear again when I'm opening a web browser on the emulator for example). Could you please check if it works for you? I think simple cargo update should be enough, since I released a patch for tinyaudio (0.1.3).

maciekglowka commented 4 months ago

Hi! Many. many thanks. I really appreciate the instant patch. It worked like a charm :D No issues anymore on my low-tiered Samsung M21 a well.

So I think I can push the Play Store update today :)