# beep_player **Repository Path**: dxmeta/beep_player ## Basic Information - **Project Name**: beep_player - **Description**: 升级https://github.com/iandis/beep_player - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-13 - **Last Updated**: 2025-11-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README A player for short audio asset files, such as beeps. On Android, this uses the `SoundPool` API, with audio attributes set to `AudioAttributes.USAGE_ASSISTANCE_SONIFICATION` and `AudioAttributes.CONTENT_TYPE_SONIFICATION` with max streams of 1. On iOS, this uses the `AVAudioPlayer` API, with audio category set to `AVAudioSessionCategoryAmbient`. ## Getting Started Before any calls to `BeepPlayer.play`, the audio file needs to be loaded first using `BeepPlayer.load`, otherwise it will silently fail. Don't forget to unload it when no longer needed. Example: ```dart static const BeepFile _beepFile = BeepFile( 'assets/sounds/beep.wav', package: 'package1', ); @override void initState() { super.initState(); BeepPlayer.load(_beepFile); } @override void dispose() { BeepPlayer.unload(_beepFile); super.dispose(); } @override Widget build(BuildContext context) { ... } void _onPressed() { BeepPlayer.play(_beepFile); } ```