943,970 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jul 24th, 2005
0

Linux Sound??

Expand Post »
I can so far find Nothing whatsoever that will allow me to easily play a wav sound in a console app in linux. It's like I have to create my own audio player to play a half second clip of a cat meowing. Does anyone have any experience? I'd really appreciate it.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Rearden is offline Offline
26 posts
since Jul 2005
Jul 24th, 2005
0

Re: Linux Sound??

The wonderful power of google...

is this like what your doing?

http://www.daniweb.com/techtalkforum...577#post143577
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Sauce is offline Offline
55 posts
since Jul 2005
Jul 24th, 2005
0

Re: Linux Sound??

I already utilized the forum search feature to find that article, that's why i posted a new topic. That topic deals with windows programming. I am talking about linux programming.
Reputation Points: 10
Solved Threads: 0
Light Poster
Rearden is offline Offline
26 posts
since Jul 2005
Jul 25th, 2005
1

Re: Linux Sound??

I don't have a Linux Box, but if there is a program that plays wave files you could call it with system(). Something like
system("WavePlayer cat.wav")
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Jul 26th, 2005
0

Re: Linux Sound??

Quote originally posted by vegaseat ...
I don't have a Linux Box, but if there is a program that plays wave files you could call it with system(). Something like
system("WavePlayer cat.wav")
I dont think you can use the "System" command in linux. I'm pretty sure its a windows only command.

But what i think i would do is just piggy back off of another program (linux does this all the time) and is what i think vegaseat is refering to. I'd install a program like mpg123 (basic mp3 player) and "exec" the program with the "-q" (quiet) option. I know its not a wav file but mp3's are just better anyway.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Sauce is offline Offline
55 posts
since Jul 2005
Jul 26th, 2005
0

Re: Linux Sound??

>I dont think you can use the "System" command in linux.
I don't know about the "System" command, but the system function is standard C, declared in stdlib.h.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 26th, 2005
1

Re: Linux Sound??

That is exactly what I ended up doing. The system call does work in linux. I don't see why it wouldn't as I think it is standard ANSI. However, on my system at least, the system function is in iostream. Maybe it is in both? Anyway the program is call esdplay. so a call to it would look like system("esdplay cat.wav");

While this works and I eventually resorted to it. I think it's cheating. For now, I'm going to leave it as is but in the future, I will use OpenAL which if you didn't figure it out from the name is the audio equivalent to openGL. Thanks for your suggestions everyone.
Reputation Points: 10
Solved Threads: 0
Light Poster
Rearden is offline Offline
26 posts
since Jul 2005
Jul 26th, 2005
0

Re: Linux Sound??

I stand corrected on the "system" function in C. Yeah i just looked it up to make sure. I just realized why i thought that. Not a C or C++ programmer anymore so its been a while since i've written much in it.

As far as feeling like its cheating, I understand why you would feel that way but keep in mind, at least from a linux stand point, using other programs to accomplish a small part of your program is a good idea. It helps keep programs smaller and creation of programs faster. Plus its nice not having to recreate the wheel everytime you need one.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Sauce is offline Offline
55 posts
since Jul 2005
Jul 26th, 2005
0

Re: Linux Sound??

>I think it's cheating.
For theorists, cheating is an option. For the rest of us, it's a necessity.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 27th, 2005
0

Re: Linux Sound??

I understand how it is probably better to just use the system command instead of doing it all myself. I'm not sure why it bothers me so much but it really does. It seems like a failure. The system call also makes it unportable by default.
Reputation Points: 10
Solved Threads: 0
Light Poster
Rearden is offline Offline
26 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Game Development Forum Timeline: Need help with C++ DirectX!
Next Thread in Game Development Forum Timeline: PLotting a map/graph





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC