0

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

Pete Zíťák
  • 67
  • 1
  • 6

1 Answers1

0

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.

VC.One
  • 14,790
  • 4
  • 25
  • 57