AI Blocks › Build and ship software
Audio streamer code writer
Say what to play or record. Get modern MATLAB audio code, not the old methods.
Audio streamer code writer is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: beginner · Thinking: low
Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.
What it does
MATLAB code for playing and recording sound that uses the newer audiostreamer object instead of the older device writer and reader classes. Without this guidance, AI tends to write the old style, which has fewer features. Tell it what you want to play or record, and it sets up the device, the settings that must be set before streaming starts, callbacks, play and record methods, full-duplex use for loopback tests, transport controls, and device listing. It also tells you when not to use it, such as for a one-off short clip, code generation or Simulink. It needs a recent release of MATLAB with Audio Toolbox.
You give it
- What to play or record
- Your device or interface (optional)
- Sample rate and channel needs
- Your MATLAB release
You get
- Working audiostreamer code
- Device selection code
- Playback, recording or full-duplex setup
- Notes on when to use older tools
Use it when
- You want to play a sequence of sounds through a sound card.
- You need to record from an audio interface while playing a test tone.
- Your AI keeps writing old audioDeviceWriter code.
- You have to list the audio devices on a machine and pick one.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run MATLAB R2025a or later with Audio Toolbox.