why audioDeviceWriter doesn't list my output device?
Show older comments
Hello MATLAB comunity,
I’m trying to send audio over a USB Audio Class 2.0 (UAC2) implementation that enables the EV‑SC594‑EZKIT from ADI. The USB UAC2 device supports 16 inputs / 16 outputs at 16‑bit. MATLAB's audioDeviceReader lists the device and I can capture the audio properly:
>> deviceReader = audioDeviceReader(Driver="DirectSound"); InDevices=getAudioDevices(deviceReader)
InDevices =
1×4 cell array
{'Default'} {'Primary Sound Capture Driver'} {'Microphone Array on Monitor (2- Intel® Smart Sound Techno…'} {'Microphone (EV-SC594 (16x16x16bit))'}
However the audioDeviceWritter does not show the device:
>> deviceWritter = audioDeviceWriter(Driver="DirectSound"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{'Default'} {'Primary Sound Driver'} {'Altavoces Laptop (2- Realtek(R) Audio)'} {'Altavoces (office)'}
In Windows, the playback device is listed correctly, and I can run the Test on Sound Playback window confirming each of the 16 streams in the EV‑SC594‑EZKIT and also using audioDeviceReader in simulink.

The output device is listed as 'WASAPI'
>> deviceWritter = audioDeviceWriter(Driver="WASAPI"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{'Default'} {'SC594 (EV-SC594 (16x16x16bit))'} {'Altavoces Laptop (2- Realtek(R) Audio)'} {'Altavoces (office)'}
But I am having next error:
Error:Error in 'AudioAnalyzerSL/Audio Device
Writer': PortAudio Error: Invalid sample rate

Is there any way I can use MATLAB or SIMULINK to send audio to that USB Audio Class 2.0 port?
Thanks,
Gilberto
Answers (2)
Jimmy Lapierre
on 28 Jan 2026
If you use audioDeviceWriter with WASAPI, it is always in exclusive mode, so the sample rate and bit depth you specify in audioDeviceWriter must match the setting in the Windows Sound Properties. If there is an option to allow exclusive mode in Windows, make sure it is checked.
There is also a newer audio I/O object called audiostreamer. Try listing your devices in a table like this.
>> struct2table(audiostreamer.getAudioDevices)
The audiostreamer allows you to turn off exclusive mode, which may allow you to use any sample rate or bit depth. You could also specify 16-bit explicitely (might be necessary in exclusive mode if your device is 16-bit). You can also set the Player property to your device name and specify SampleRate. Here this would just play through the default Windows device:
>> as = audiostreamer(Driver="WASAPI",ExclusiveMode=false,DeviceBitFormat="int16")
>> play(as,pinknoise(44100,2)) % try 1 second of pink noise
4 Comments
Gilberto
on 3 Feb 2026 at 15:39
Jimmy Lapierre
on 3 Feb 2026 at 15:56
That error is because in your version of audiostreamer, you need to specify Player="SC594 (EV-SC594 (16x16x16bit))". Otherwise, it's trying to use the "Primary Sound Driver" which is DirectSound only. The upcoming release will do the right thing and pick a valid WASAPI device if you construct the object with Driver="WASAPI", but you should still specify which device you want to use.
Gilberto
on 4 Feb 2026 at 19:25
Jimmy Lapierre
on 4 Feb 2026 at 19:58
I just wanted to explain the reason for the previous error. Let me know if you still have any issues.
Will
on 27 Jan 2026
0 votes
Hi Gilberto,
The issue might be due to the supported maximum sample rate. You can go through the below MATLAB answer to find out about this -
Categories
Find more on Multichannel Audio Input and Output in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
