Simulink Raspberry pi ALSA audioCapture data type miss match
1 次查看(过去 30 天)
显示 更早的评论
Hi.
I'm trying to get 32bit audio data from the raspberry pi microphone array.
But i got this error:
For '?' of 'simulink_test/ALSA Audio Capture', the 'stepImpl' method of the System object 'codertarget.raspi.internal.RaspiALSAAudioCapture' returned a value that has data type 'int16'. This data type does not match the type 'int32' returned by the 'getOutputDataTypeImpl' method, inherited from System object 'codertarget.linux.blocks.ALSAAudioCapture'. To override the inherited behavior, customize 'getOutputDataTypeImpl' for System object 'codertarget.raspi.internal.RaspiALSAAudioCapture'.
With this microphone array, data can only be received in 32-bit, and my deep learning model was also trained with 32-bit data.
How can I fix this error?
Thank you.
0 个评论
回答(1 个)
Brandon Stevens
2022-11-10
For the 'ALSA Audio Capture' block there is a block paramater called 'Device bit depth' that you would want to change to 32-bit.
This parameter specifies what data type the audio data should be cast to. The default is 16-bit which seems to be what your parameter is set to.
For more information, check out the documentation page for the block:
https://www.mathworks.com/help/supportpkg/raspberrypi/ref/alsaaudiocapture.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!