how to read an audio file with a function that support code generation for Raspi?

2 views (last 30 days)
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!

Accepted Answer

Walter Roberson
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

Sign in to comment.

More Answers (1)

Prasanth Sunkara
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

Community Treasure Hunt

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

Start Hunting!