I would like to know if it possible just play some kind of audio file in C# Console Application.
I don't find any answer on this question.
Many Thanks
I would like to know if it possible just play some kind of audio file in C# Console Application.
I don't find any answer on this question.
Many Thanks
In command prompt you can play an audio file by typing it's name from location folder:
c:\my_Music>track1.mp3
This opens the file with the format's associated progam so there will be a pop-up of an external program. Set program by using right-click on a file and choose "Open With
".
I've not tested this in a console app. But you should be able to type a String into the console app and then trigger an ENTER
press event.
Option 2:
Use SoundPlayer class.
A good tutorial for beginners.
Also can check this: Playing sounds on Console.