Playing audio from .Net 5 application running in Docker container on TorizonCore 5.6

I’m trying to play audio files from .Net 5 application running inside Docker container on TorizonCore 5.6.
Since .Net 5 still doesn’t support cross platform audio player library I was trying to use external tools for simple playing audio files.

I found this article on Toradex web about audio on Linux but non of mentioned tools are available on TorizonCore 5.6 I’m using (particulary “aplay”).

The idea is to run new process for playing audio files from .Net application using external tools like “aplay”.

I also found article that describes how to play audio files from Qt/C++ application.
Can you point me in the right direction how can I play audio file from .Net application on Toradex platform?

Greetings @frka,

I found this article on Toradex web about audio on Linux but non of mentioned tools are available on TorizonCore 5.6 I’m using (particulary “aplay”).

This is is gone over in the 2nd article you reference but additional utilities like aplay need to be installed in a container. These won’t be found on the host OS.

I also found article that describes how to play audio files from Qt/C++ application.
Can you point me in the right direction how can I play audio file from .Net application on Toradex platform?

You should be able to follow that article for everything but the actual code itself. It shows how you should configure a container to use the audio devices as well as install the needed utilities inside the container. You just need to then use your .NET app to invoke aplay and other utilites.

In our VSCode extensions you should be able to create a .NET based project. From there follow the C/C++ article with regards to configuring your project. But then supply your .NET code.

Best Regards,
Jeremias

@jeremias.tx I confirm that playing audio using aplay tool is working for me.
I installed ALSA utils inside container and then I was aplay to spawn aplay process from my .NET application.

Glad to hear it works now.