on_audio_query
2.9.0, released 4 years ago by lucasjosino.com
Query audio and song metadata from device storage across Android, iOS, and Web.
What it does
Allows developers to query songs, albums, artists, playlists, and genres from the device's storage. It also supports fetching and displaying artwork using a built-in widget and managing playlists.
AI-written summary of version 2.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build a custom music player that reads local audio files from the device.
- You want to organize and query songs by artist, album, genre, or playlist.
- You need to display artwork associated with local audio files.
Skip it when
- You are streaming music exclusively from remote servers.
- You only need general file picking rather than a specialized music library database.
Strengths
- Comprehensive querying methods for songs, albums, artists, playlists, and genres.
- Built-in QueryArtworkWidget for rendering album art easily.
- Cross-platform support covering Android, iOS, and Web.
Weaknesses
- Playlist manipulation and certain media scanning methods are limited or not supported on iOS and Web.
- Requires explicit native permissions setup in AndroidManifest.xml and Info.plist.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Requires adding storage/media permissions to AndroidManifest.xml and NSAppleMusicUsageDescription to Info.plist for iOS.
final OnAudioQuery _audioQuery = OnAudioQuery();
List<AudioModel> audios = await _audioQuery.queryAudios();Alternatives
Packages that do the same job and could replace on_audio_query.
- ffmpeg_kit_flutter_new_audio
Run FFmpeg and FFprobe commands from Dart with prebuilt audio codecs for multiple platforms.
79Compare - flutter_screen_recording
Record device screen on Android, iOS, and web with optional audio.
71Compare - kplayer
A cross-platform audio player wrapper supporting assets, network, files, and bytes.
47Compare - audiofileplayer
A Flutter plugin for audio playback.
30Compare