how to read an audio file with a function that support code generation for Raspi?
2 views (last 30 days)
Matlab_Beginner on 2 Nov 2022
i want to play audio on my Raspi, and i couldnt find a way on how to read an Audio File with a function that supports code generation. Only one exemple is shown in the Documentation about Audio Capture and it did not helped me.
in there a way how to do it, thanks in advance!
Walter Roberson on 2 Nov 2022
You can use putFile() to copy the file from the host to the Pi. But once it is there, there is no built-in support from MATLAB to play the file. You will need to system() the play command, or hook in to some appropriate library that exists on the Pi.
One particular audio file player is listed at https://www.makeuseof.com/tag/play-mp3-audio-raspberry-pi/
More Answers (1)
Prasanth Sunkara on 10 Nov 2022
Have you tried Audio File read block of Simulink Support pacakge? Simulink Support Package offer more features for advanced workflows.