Simulink Raspberry pi ALSA audioCapture data type miss match

조회 수: 3 (최근 30일)
중범
중범 2022년 10월 27일
답변: Brandon Stevens 2022년 11월 10일
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.

답변 (1개)

Brandon Stevens
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

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by