Agent skill

flutter_soloud Idioms

by alnitak in alnitak/flutter_soloud

Explains the mental model for the flutter_soloud audio plugin: the SoLoud.instance singleton, AudioSource versus SoundHandle, synchronous play and platform limits.

MITAuto-check passedMobile

Install flutter_soloud Idioms

skills CLI
$ npx skills add alnitak/flutter_soloud --skill flutter-soloud-idioms -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alnitak/flutter_soloud flutter-soloud-idioms --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alnitak/flutter_soloud.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/flutter-soloud-idioms .claude/skills/flutter-soloud-idioms && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flutter-soloud-idioms
GitHub stars
425
Token cost
~2.3k tokens
SKILL.md length
880 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Explains the mental model for the flutter_soloud audio plugin: the SoLoud.instance singleton, AudioSource versus SoundHandle, synchronous play and platform limits.

  • Playing a sound effect or music in a Flutter app
  • SKILL.md covers Minimal example, The API shape, What flutter_soloud is NOT and Traps, plus 2 more sections
  • Calls dart
  • Debugging a SoLoudNotInitializedException or silent playback

What it does

flutter_soloud is a thin Dart FFI wrapper over the SoLoud C++ engine with a miniaudio backend, and the skill stresses that it is a low-level mixer rather than a media player. You load a sound as an AudioSource, then start playing instances of it that are SoundHandle voices, all on one global engine behind SoLoud.instance. Habits from audioplayers, just_audio or the Web Audio API lead to wrong code, so the skill is meant to be read before writing any flutter_soloud code.

The API notes cover awaiting init before anything else, the isInitialized check, deinit and deinitAsync disposing every loaded sound, the async load methods for assets, files, URLs and memory, play returning its handle synchronously, playSource as a load-and-play shortcut, per-voice controls taking a handle, explicit disposal of sources, and a concurrent voice cap of 16 by default with a hard maximum of 1023. It also helps with SoLoudNotInitializedException, silent playback and migrations.

When your agent uses it

  • Playing a sound effect or music in a Flutter app
  • Debugging a SoLoudNotInitializedException or silent playback
  • Migrating audio code from audioplayers or just_audio

Example prompts

  • “Add a tap sound to the game screen using flutter_soloud.”
  • “My flutter_soloud call throws SoLoudNotInitializedException; find where init is missing.”

Requirements

  • A Flutter app with the flutter_soloud plugin

What it can do on your machine

Read from SKILL.md and the folder at commit 289697e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • pub.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

flutter_soloud Idioms loads about 2.3k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 880 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alnitak/flutter_soloud at commit 289697e, republished under its MIT licence (© alnitak). 880 words, ~2,286 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-soloud-idioms/SKILL.md (or your agent's skills folder).
name
flutter-soloud-idioms
description
Core mental model for the flutter_soloud audio plugin — the SoLoud.instance singleton lifecycle (init/deinit), the AudioSource vs SoundHandle distinction, synchronous play semantics, and cross-platform constraints. Use when the user asks to play a sound, set up audio in a Flutter app, debug SoLoudNotInitializedException or silent playback, or migrate from audioplayers/just_audio.
version
2

flutter_soloud idioms

flutter_soloud is a thin Dart FFI wrapper over the SoLoud C++ engine (miniaudio backend). It is a low-level mixer API, not a media player: you load sounds (AudioSource), then spawn playing instances of them (SoundHandle voices). Everything lives on one global engine behind SoLoud.instance. Read this before writing any flutter_soloud code — assumptions carried over from audioplayers, just_audio, or the Web Audio API will produce wrong code.

Minimal example

dart
import 'package:flutter_soloud/flutter_soloud.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // MUST be awaited before any other SoLoud call.
  await SoLoud.instance.init();

  // Load once: an AudioSource is the loaded sample, identified by its
  // SoundHash. Loading is async; keep the source around.
  final sound = await SoLoud.instance.loadAsset('assets/explosion.mp3');

  // play() is SYNCHRONOUS: it spawns a voice and returns its handle
  // immediately. The handle controls that one playing instance.
  final SoundHandle handle = SoLoud.instance.play(
    sound,
    volume: 0.8,
    looping: false,
  );

  // ... on teardown (e.g. top-level widget dispose()):
  SoLoud.instance.deinit(); // or: await SoLoud.instance.deinitAsync();
}

The API shape

  • SoLoud.instance — the singleton. One engine exists in C++, so only one SoLoud exists in Dart; do not construct your own.
  • Future<void> init({PlaybackDevice? device, bool automaticCleanup = false, int sampleRate = 44100, int bufferSize = 2048, Channels channels = Channels.stereo, bool lowLatency = true, ...}) — initializes the engine. Must be awaited before anything else.
  • bool get isInitialized — synchronous readiness check (false while init is in flight or after failure/deinit).
  • void deinit() / Future<void> deinitAsync() — teardown: stops the engine and disposes ALL resources, including loaded sounds. Call once at app exit; deinitAsync runs native teardown off the UI thread.
  • Future<AudioSource> loadAsset(String key, {LoadMode mode = LoadMode.memory, ...}) — also loadFile(String path) (not on web), loadUrl(String url), loadMem(...), loadWaveform(...). All async; all return AudioSource.
  • SoundHandle play(AudioSource sound, {int busId = 0, double volume = 1, double pan = 0, bool paused = false, bool looping = false, Duration loopingStartAt = Duration.zero, Duration? loopingEndAt, double scale = 1}) — synchronous, returns the handle immediately.
  • Future<AudioSource> playSource({String? asset, String? file, String? url, LoadMode mode = LoadMode.disk, ...}) — convenience load+play; exactly one of asset/file/url.
  • Per-voice control methods all take a SoundHandle: stop(handle), setPause(handle, bool), setLooping(handle, bool), etc.
  • disposeSource(AudioSource) / disposeAllSources() — free loaded samples. Loaded sources live until disposed (or until deinit()); play() does not unload anything.
  • setMaxActiveVoiceCount(int) / getMaxActiveVoiceCount() — concurrent voice cap, default 16, hard max 1023.
  • Stream<AudioDeviceStartFailure> get audioDeviceStartFailures — the ONLY channel that reports output-device start failures from synchronous play APIs (see Traps).
  • Errors: sealed SoLoudException hierarchy. SoLoudDartException subclasses come from the Dart side (SoLoudNotInitializedException, SoLoudSoundHashNotFoundDartException, ...); SoLoudCppException subclasses are mapped from the native PlayerErrors enum (SoLoudFileNotFoundException, SoLoudNoPlaybackDevicesFoundCppException, ...). Catch SoLoudException to catch all.

Divergences from audioplayers/just_audio you must unlearn:

Instead of (other plugins)Do this in flutter_soloud
final player = AudioPlayer()SoLoud.instance (singleton, no player instances)
player.setSourceUrl(url) then player.resume()final sound = await SoLoud.instance.loadUrl(url); then SoLoud.instance.play(sound);
player.onPlayerComplete.listen(...)sound.soundEvents.listen((e) { if (e.event == SoundEventType.handleIsNoMoreValid) ... }) or sound.allInstancesFinished.first
player.setVolume(0.5)SoLoud.instance.setVolume(handle, 0.5) (per-handle) or SoLoud.instance.setGlobalVolume(0.5)
player.seek(pos)SoLoud.instance.seek(handle, pos) (handles only; can't seek unloaded sources)
player.stop()SoLoud.instance.stop(handle) or SoLoud.instance.stopAudioSource(sound)

What flutter_soloud is NOT

  • No per-player objects. There is one engine; play() returns a handle, not a player.
  • No built-in "onComplete" on the handle. Listen to source.soundEvents (SoundEventType.handleIsNoMoreValid) or source.allInstancesFinished instead.
  • No playlists, no AudioPlayer.setUrl, no media-session integration. Sources are loaded explicitly and reused.
  • play() does not await anything. Do not await SoLoud.instance.play(...) expecting it to finish when the sound finishes.
Show full SKILL.md (444 more words)Show less

Traps

  • Calling anything before init() completes throws SoLoudNotInitializedException. Await init(); check isInitialized before UI-triggered calls.
  • init() is NOT idempotent. Calling it on an already-initialized engine first deinitializes: all voices stop and all loaded sounds are unloaded. Guard with if (!SoLoud.instance.isInitialized) or call it exactly once (e.g. in main()).
  • Hot restart safety is handled, but only via re-init. The native engine survives a hot restart while Dart callbacks die; the next init() detects this and reinitializes (you'll see a warning in logs). Pattern: call init() from a startup path that re-runs after restart. See example/tests/tests/hot_restart_lifecycle.dart.
  • play() cannot report audio-device failures. It returns a valid handle even if the device fails to start — the device start happens in the background after the voice is created. Silence with no exception means: listen to SoLoud.instance.audioDeviceStartFailures and recover with await SoLoud.instance.startAudioDevice().
  • Voice limit silently steals. At the 16-voice default cap, playing another instance of a sound stops the oldest instance of that same sound. If the cap is hit by other sounds, play() logs a warning, returns a handle that addresses no voice, and throws nothing. Raise the cap with setMaxActiveVoiceCount(...) — values of 0 or >1023 are silently ignored by the engine.
  • Web: add <script src="assets/packages/flutter_soloud/web/init_soloud.js" defer></script> to web/index.html. loadFile is unavailable on web (use loadMem/loadAsset/loadUrl); use LoadMode.disk on web for loadAsset; per-sound filters throw SoLoudFilterForSingleSoundOnWebDartException (only global/engine filters work on web).
  • Linux: uses miniaudio with runtime dynamic loading for ALSA, PulseAudio, and JACK (default LinuxAudioBackend.auto prioritizes ALSA -> PulseAudio -> JACK). Configure via linuxAudioBackend in init() or switch dynamically with SoLoud.instance.setLinuxAudioBackend(backend). No compile-time ALSA headers required.
  • Android lowLatency: true (default) uses AAudio's MMAP path: lowest latency, but not capturable by screen recorders and little CPU headroom for heavy DSP. Pass lowLatency: false for the conservative profile (capturable, more DSP headroom, higher latency).
  • Platform minimums: Android API 21, iOS 13.0, macOS 10.15.
  • Not a recorder. There is no microphone input; the only capture is mixer OUTPUT capture (startMixerOutputStream() / stopMixerOutputStream(), a Stream<Uint8List> of the mixed output) for recording/streaming what the engine plays. To record audio input from microphone, suggest to use the flutter_recorder package.

More depth

  • Demo entry point: example/lib/main.dart (init in main(), deinit() in dispose(), loadAsset + play, web-specific LoadMode.disk branch).
  • More runnable patterns under example/lib/ and example/tests/tests/ (e.g. max_voices.dart, playback_devices.dart, hot_restart_lifecycle.dart).
  • Full docs site source: docs/index.mdx, docs/get_started/setup.mdx.

Keeping this skill current

This skill ships inside the flutter_soloud package, so upgrading flutter_soloud can carry a newer revision of it than the copy installed in the project. To check, run:

sh
dart run flutter_soloud:skills --check

It reports the installed and bundled skill versions and exits non-zero when an update is available. Offer to update with dart run flutter_soloud:skills (which touches only the skills, never pubspec or build files).

© alnitak, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/flutter-soloud-idioms of alnitak/flutter_soloud.

Open the folder on GitHubat commit 289697e

Compare with similar skills

flutter_soloud Idioms next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

flutter_soloud Idioms compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
flutter_soloud Idioms this skillalnitak/flutter_soloud425—~2.3kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
Flutter Cherry Pickflutter/flutter179k—~1.8kAutomated safety check: PassBSD-3-Clause
Upgrade Browserflutter/flutter179k—~1.1kAutomated safety check: PassBSD-3-Clause
Bump Dartflutter/flutter179k—~1.2kAutomated safety check: PassBSD-3-Clause
Run Devicelab With Ledflutter/flutter179k—~786Automated safety check: PassBSD-3-Clause

Similar skills

  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • Flutter Cherry Pick

    flutter/flutter

    How to land a formal cherry-pick of a merged PR for the flutter/flutter repo stable or beta channel.

    179k GitHub stars~1.8k tokensUpdated today
    MobileAuto-check passed
  • Upgrade Browser

    flutter/flutter

    Upgrade browser versions (Chrome or Firefox) in the Flutter Web Engine and/or Framework tests.

    179k GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Bump Dart

    flutter/flutter

    Do not trigger automatically; only run when a user runs /bump-dart.

    179k GitHub stars~1.2k tokensUpdated today
    MobileAuto-check passed
  • Run Devicelab With Led

    flutter/flutter

    Run DeviceLab tests for Flutter PRs using LUCI's led CLI tool.

    179k GitHub stars~786 tokensUpdated today
    MobileAuto-check passed
  • Shepherd PRs

    flutter/flutter

    Automate shepherding, checking status, updating branches, and landing open PRs or approved third-party contributor PRs in the flutter/flutter repository using the gh CLI.

    179k GitHub stars~1.7k tokensUpdated today
    MobileAuto-check passed

More from alnitak/flutter_soloud

All 14 skills in this repo
  • Flutter SoLoud Audio Filters

    alnitak/flutter_soloud

    Explains how to add and tune flutter_soloud's 13 audio filters at global, per-sound and mixing-bus level, including activation order and parameter fades.

    425 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • flutter_soloud Mixing Buses

    alnitak/flutter_soloud

    Teaches flutter_soloud mixing buses for routing groups of sounds through shared sub-mixes with collective volume and filters, such as separate music, SFX and UI sliders.

    425 GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • flutter_soloud Setup

    alnitak/flutter_soloud

    Walks through adding the flutter_soloud audio engine to a Flutter app, with per-platform setup, initialization, binary-size and logging options, and output device switching.

    425 GitHub stars~3.6k tokensUpdated 2 days ago
    Auto-check: notes
  • Teaches the push buffer-stream API of flutter_soloud for playing audio that arrives in chunks, such as icecast radio, WebSocket PCM feeds or streaming TTS, instead of a complete file.

    425 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Shows how to build audio visualizers in Flutter with flutter_soloud, using live FFT and wave data or offline waveform extraction, plus volume readings for level meters.

    425 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Flutter Soloud 3D Audio

    alnitak/flutter_soloud

    Teaches positional (3D) audio in fluttersoloud — play3d/play3dClocked/play3dScheduled, listener position/orientation/velocity, per-source attenuation and Doppler, and the per-frame update pattern.

    425 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about flutter_soloud Idioms

What does flutter_soloud Idioms do?

Explains the mental model for the flutter_soloud audio plugin: the SoLoud.instance singleton, AudioSource versus SoundHandle, synchronous play and platform limits. flutter_soloud is a thin Dart FFI wrapper over the SoLoud C++ engine with a miniaudio backend, and the skill stresses that it is a low-level mixer rather than a media player.instance.

When should I use flutter_soloud Idioms?

flutter_soloud Idioms fits situations like: playing a sound effect or music in a Flutter app; debugging a SoLoudNotInitializedException or silent playback; migrating audio code from audioplayers or just_audio.

How do I install flutter_soloud Idioms in Claude Code?

Run `npx skills add alnitak/flutter_soloud --skill flutter-soloud-idioms -a claude-code`. Or copy the skill folder (skills/flutter-soloud-idioms in alnitak/flutter_soloud) into .claude/skills/flutter-soloud-idioms in your project. Claude Code loads it when a task matches its description.

How do I install flutter_soloud Idioms in Codex?

Run `npx skills add alnitak/flutter_soloud --skill flutter-soloud-idioms -a codex`. Or copy the skill folder (skills/flutter-soloud-idioms in alnitak/flutter_soloud) into .agents/skills/flutter-soloud-idioms in your project. Codex loads it when a task matches its description.

Can I use flutter_soloud Idioms in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alnitak/flutter_soloud --skill flutter-soloud-idioms -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flutter-soloud-idioms, .gemini/skills/flutter-soloud-idioms, .github/skills/flutter-soloud-idioms and .opencode/skills/flutter-soloud-idioms in your project.

What does flutter_soloud Idioms need to run?

Going by SKILL.md and its folder, flutter_soloud Idioms needs the command-line tools its instructions call (dart). Our summary lists: A Flutter app with the flutter_soloud plugin.

Does flutter_soloud Idioms access the network?

SKILL.md names 1 domain. As links in the text: pub.dev. This is read from the text; nothing was executed.

Is flutter_soloud Idioms safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does flutter_soloud Idioms use?

flutter_soloud Idioms is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does flutter_soloud Idioms use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to flutter_soloud Idioms?

Skills that share tags, products or a category with flutter_soloud Idioms: Engine Whats New (flutter/flutter, 179k stars), Flutter Cherry Pick (flutter/flutter, 179k stars), Upgrade Browser (flutter/flutter, 179k stars) and Bump Dart (flutter/flutter, 179k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains flutter_soloud Idioms?

alnitak (a GitHub user) maintains it in alnitak/flutter_soloud, which has 425 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 6, 2026.

Source: alnitak/flutter_soloud on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.