Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing sound in C++ using native system calls?

So in Windows, you can use the PlaySound function to play an MP3 file in a C++ application. What would be some similar functions available for use in Mac OS X/Linux? I would also appreciate it if you could link to some sample Hello-World type programs demonstrating this.

like image 343
wrongusername Avatar asked Feb 19 '12 01:02

wrongusername


1 Answers

You can just open("/dev/dsp") and write to it. That's as "native syscall" as you can get, I believe.

like image 86
Ben Voigt Avatar answered Oct 03 '22 06:10

Ben Voigt