can I ask for a synopsis of the state of affairs here?
i’m facing truly unacceptable lag on a nexus 7 (my “go to” device for most testing, as it performs well across the board, without being too far out in the stratosphere for most “real-world” consumers to have, or so goes my thinking :D)
the top of the media api says “should not be used”, the individual methods like playEventSound word it more softly as “recommended” to use newer audio lib". advice here (and all around the 'net) says “audio.* has insufferable lag, for ui sounds and such still use playEventSound” . so which is it, who’s right? use media.* if/when required, or no way, not supported, use at your own risk, will crash-and-burn for sure?
particularly with ui sounds you can literally “feel” the lag with audio.*, whereas any latency with media.playEventSound() is essentially imperceptible. should mention i’m using tightly trimmed .wav files, mono, linear pcm, 16-bit, 22050hz, have config.lua specifying 22050hz, everything should be matching up not requiring sample-rate conversion. (only difference with media.* is I instead load an .ogg conversion of same files, as .wav doesn’t seem supported, .mp3 has an “inbuilt” silence at the beginning, etc, but ogg not supported with audio.* so hard to do a perfect apples-to-apples comparison w exact same file format between the two libs)
i have a flag in my dev version i can hit and switch between the two libs/files at runtime, and the difference is glaring. somehow the big-boy heavy-hitter AAA titles out there have solved the problem, just wish I knew how.
i’d just keep using media.* for such sounds (and reserving audio.* for streaming music), except my concern at this point comes about as a result of investigating a side issue of “application has stopped unexpectedly” immediately on startup which some on the 'net seem to have attributed to media.* tho i can’t confirm. can anyone else?
i suppose I’ll try again doing everything at 44.1khz again, maybe nexus 7 isn’t “respecting” my request for 22khz, or maybe 44.1khz is an optimized “sweet spot”? worth trying i guess, but i doubt it – cuz that’s where i started, and latency was there back then, and i only converted down to save space, cuz any diff in quality isn’t noticable on a tablet, but it’s possible that some recent os update might have changed things. (?)
any advice? sorry for the long post. thx