How to to design and test UI with audioDeviceWriter and dsp.AudioFileReader in AppDesigner for multichannel audio playback

5 次查看(过去 30 天)
I'm developing a user interface in AppDesigner that uses dsp.AudioFileReader and audioDeviceWriter to read and play 16-channel audio files. I don't have immediate access to the final 16-channel hardware interface and loudspeaker setup that will be used (it will use RME Madiface XT I guess with ASIO driver), but I do have example 16-channel wav files to work with.
I have the UI working well with mono files over a simple 2-channel home setup using a WASAPI driver. As soon as I've tried playing back the 16-channel files, I get the error message:
Error using audioDeviceWriter/setup
PortAudio Error: Invalid number of channels
(I've been using the setup call to initialise the audioDeviceWriter object, as per the example https://uk.mathworks.com/help/audio/ref/audiodevicewriter-system-object.html)
Is it possible to use these MATLAB objects with the 16-channel files in a limited way over a stereo device (for example, with only playing back 2 of the 16 channels), to enable development and debugging to continue, before undertaking final testing and debugging on the full 16-channel system?
What settings should I anticipate being needed to get the UI working with the 16-channel hardware that are not needed for playback of mono or stereo files - for example, device-specific settings, channel mapping etc?
  2 个评论
Mario Malic
Mario Malic 2023-10-5
deviceWriter = audioDeviceWriter('SampleRate',fileInfo.SampleRate);
info(deviceWriter)
info will tell you how many channels does the audioDeviceWriter support.
Each channel corresponds to a column of matrix you are trying to write.
Michael
Michael 2023-10-5
Thanks. That is helpful in incorporating a check in the code to see if the selected device can support the number of channels in the file.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Spatial Audio 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by