AudioEngine previously hardcoded 44100 Hz stereo for AudioTrack and MediaCodec, causing streams at other sample rates (22050, 48000, etc.) to play at wrong speed and mono streams to be misinterpreted. Now defers AudioTrack/MediaCodec creation until the first MP3 frame arrives, reads the actual sample rate and channel mode from the frame header, and configures output accordingly. Timing constants (frame duration, frames-per-second) are computed dynamically. Adds INFO_OUTPUT_FORMAT_CHANGED handling as a safety net and surfaces detected format (e.g. "44.1 kHz Stereo") in the Now Playing UI. Made-with: Cursor
2.3 KiB
2.3 KiB