hxaudio-player
HX Audio Player for music and sound playback. Use when implementing music playback, sound effects, HXMusic, HXSound, or audio in HXAudioPlayer. Library is in the hxaudio module.
install
source · Clone the upstream repo
git clone https://github.com/huhx0015/HXAudioPlayer
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/huhx0015/HXAudioPlayer "$T" && mkdir -p ~/.claude/skills && cp -r "$T/claude/skills/hxaudio-player" ~/.claude/skills/huhx0015-hxaudioplayer-hxaudio-player && rm -rf "$T"
manifest:
claude/skills/hxaudio-player/SKILL.mdsource content
HX Audio Player
Use HX Audio Player for music and sound in HXAudioPlayer. The library is in the
hxaudio module. Supports Android 2.3+ with workarounds for MediaPlayer/SoundPool bugs.
Audio files: Place in
res/raw/ (e.g. res/raw/my_song.mp3 → R.raw.my_song).
Music Playback (HXMusic)
Play from resource:
HXMusic.music() .load(R.raw.my_song_name) // [REQUIRED] .title("My Awesome Song") // [OPTIONAL] .artist("Mr. Anonymous") // [OPTIONAL] .date("January 1, 1998") // [OPTIONAL] .at(5) // Start position (seconds) .gapless(true) // Gapless playback (API 16+) .looped(true) // Loop .play(this); // [REQUIRED]
Play from path/URL:
HXMusic.music() .load("http://example.com/song.mp3") .title("My Awesome Song") .play(this);
Control:
— PauseHXMusic.pause()
— ResumeHXMusic.resume(this)
— Stop allHXMusic.stop()
— BooleanHXMusic.isPlaying()
— Current position (seconds)HXMusic.getPosition()
— HXMusicListenerHXMusic.setListener(this)
— Status stringHXMusic.getStatus()
— Enable/disableHXMusic.enable(true)
— Log outputHXMusic.logging(true)
— Clear when app is terminatingHXMusic.clear()
Lifecycle (Activity/Fragment):
→onPause()
— Pause when backgroundedHXMusic.pause()
→onResume()
— Resume when foregroundHXMusic.resume(this)- App terminating →
— Clean up inHXMusic.clear()onDestroy()
Sound Playback (HXSound)
Play sound:
HXSound.sound() .load(R.raw.my_sound_effect) // [REQUIRED] .looped(true) // [OPTIONAL] .play(this); // [REQUIRED]
Control:
— Pause looping soundsHXSound.pause()
— ResumeHXSound.resume()
— Pre-load resourcesHXSound.load(soundResourceList, context)
— Multiple sound engines (API 9–10 only)HXSound.engines(2)
— Enable/disableHXSound.enable(true)
— Re-init (API 9–10)HXSound.reinitialize(this)
— Log outputHXSound.logging(true)
— Clear when no longer neededHXSound.clear()
Module
Add dependency in
build.gradle:
implementation project(':hxaudio')
Notes
- API 9–10: HXSound creates 2 HXSoundEngine instances by default to work around SoundPool buffer limits. Keep sound effects small (<100 KB, 64 kbps or less).
- Gapless:
only on API 16+; falls back to standard loop on older devices..gapless(true) - Release: Call
andHXMusic.clear()
inHXSound.clear()
when audio is no longer needed.onDestroy()