0

Good day to all.

I would like to ask some help regarding C++ sounds. I read some codes in playing sounds using C++ and this codes was based on WINDOWS. I would like to as if there is a possibility that I can play a wav file in LINUX using C++. I am a begginer in C++ and I really need your help guys.


Thank you.

Hunterfish.

4
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by Stefano Mtangoo
-2
#include <windows.h>
PlaySound("file.wav", NULL, SND_ASYNC | SND_FILENAME);

You didn't mention what compiler.

Votes + Comments
Are you an idiot? windows.h on linux?
0

You can also create a shell script to play a wav file:

#!/bin/bash
mplayer (replace with your favorite media player) $1
chmod +x wavplayer
./wavplayer file.wav
0

Thank you. I really appreciate it but It doesn't work.Any other codes/scripts using C++.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.