how to read an audio file with a function that support code generation for Raspi?
3 views (last 30 days)
Show older comments
Matlab_Beginner
on 2 Nov 2022
Answered: Prasanth Sunkara
on 10 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!
1 Comment
Walter Roberson
on 2 Nov 2022
https://www.mathworks.com/help/dsp/ref/dsp.audiofilereader-system-object.html can have code generated -- but that code uses pre-defined dll that are not available for raspberry.
Accepted Answer
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/
3 Comments
More Answers (1)
Prasanth Sunkara
on 10 Nov 2022
Hi,
Have you tried Audio File read block of Simulink Support pacakge? Simulink Support Package offer more features for advanced workflows.
Thanks
0 Comments
See Also
Categories
Find more on Audio I/O and Waveform Generation 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!