Now there is a way to do this with the NAudio library (starting from 1.9.0-preview1 ), but it will only work on Windows.
So, using NAudio, here is the code for playing sound in .NET Core, if you are doing it from a Windows environment.
using (var waveOut = new WaveOutEvent()) using (var wavReader = new WavFileReader(@"c:\mywavfile.wav")) { waveOut.Init(wavReader); waveOut.Play(); }
For a more global solution, you should choose @Fiodar, which uses Node.js.
source share