matlab-play-record-audio
Reference for MATLAB audiostreamer (Audio Toolbox R2025a+). Without this skill, agents consistently default to legacy audioDeviceWriter/audioDeviceReader or base MATLAB sound(), producing less capable code. Use when writing code for audio playback, recording, full-duplex device I/O, real-time audio measurements, or audio I/O processing with callbacks. Also use when debugging audiostreamer errors, dropouts, or latency issues, or migrating from audioDeviceReader, audioDeviceWriter, audioPlayerRecorder, or audioplayer/audiorecorder.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-play-record-audio --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Describes how to use the MATLAB audiostreamer tool as a unified replacement for audioDeviceWriter, audioDeviceReader, and audioPlayerRecorder, enabling playback, recording, or full-duplex I/O with callbacks, pre-buffering, transport control, and measurement helpers. It covers version requirements, key workflows, and when not to use it (e.g., codegen or Simulink). It also outlines common usage patterns, including pre-buffered playback, callback-driven streaming, and frame-based full-duplex loops, with concrete MATLAB examples and recommended patterns for measurement and GUI integration.
How it works
The skill instructs construction of audiostreamer objects via Name-Value pairs, with explicit Modes: "player", "recorder", or "full-duplex" (default is "player"). It requires explicit Mode when recording. It lists properties to configure device (Driver, Player, Recorder, SampleRate, etc.), including how they behave before streaming starts and notes about locking. It defines callbacks (PlayerFcn, RecorderFcn, and their corresponding MinSamples thresholds) and the required two-argument function signatures. It documents methods for playback (play, write), recording (record, read), full-duplex (playrec), and transport control (start, stop, pause, resume, waitfor, release). It provides diagnostics (isPlaying, getUnderrunCount, getStreamTime, etc.) and static device enumeration utilities. It emphasizes that setup() does not exist and that pre-buffering can occur via PlayerFcn. It then presents multiple patterns (simple sweep, non-blocking play+record with waitfor, pre-buffered playback with write+start, callback-driven streaming, frame-at-a-time processing) with explicit MATLAB code blocks illustrating how to use the APIs. It also includes teardown guidance (release stops streaming and clears buffers).
# audiostreamer — MATLAB Audio Device I/O (R2025a+) `audiostreamer` is the unified replacement for `audioDeviceWriter`, `audioDeviceReader`, and `audioPlayerRecorder`. It provides player-only, recorder-only, or full-duplex modes with callbacks, pre-buffering, transport control, and measurement helpers. **Version requirements:** `audiostreamer` requires Audio Toolbox R2025a or later. The `start` and `write` methods were added in R2026a. ## When to Use - Playing audio through a sound card or USB audio device - Recording audio from a microphone or audio interface - Full-duplex playback + recording (e.g., acoustic measurements, loopback tests) - Listing or selecting audio devices and drivers - Any workflow that involves audio hardware I/O in MATLAB ## When NOT to Use - **Playing a single isolated sound** — `sound` or `soundsc` is fine for one-shot playback of a short clip with no sequencing. For sequential playback (e.g., before/after comparison), use `audiostreamer` — its `play()` calls queue automatically, whereas overlapping `sound` calls play simultaneously. - **Code generation (codegen)** — `audiostreamer` does not yet support codegen; use legacy APIs if targeting codegen - **Simu
- When to Use
- When NOT to Use
- Construction
- Properties
- Device Configuration (set BEFORE streaming starts)
- Callback Properties
- Read-Only Status
- Methods
- Playback
- Recording
- Full-Duplex
- Transport Control
- Query / Diagnostics
- Static Device Enumeration
What does the matlab-play-record-audio skill do?
Reference for MATLAB audiostreamer (Audio Toolbox R2025a+). Without this skill, agents consistently default to legacy audioDeviceWriter/audioDeviceReader or base MATLAB sound(), producing less capable code. Use when writing code for audio playback, recording, full-duplex device I/O, real-time audio measurements, or audio I/O processing with callbacks. Also use when debugging audiostreamer errors, dropouts, or latency issues, or migrating from audioDeviceReader, audioDeviceWriter, audioPlayerRecorder, or audioplayer/audiorecorder.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-play-record-audio --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
