Linux Sound??

Please support our Game Development advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2005
Posts: 26
Reputation: Rearden is an unknown quantity at this point 
Solved Threads: 0
Rearden's Avatar
Rearden Rearden is offline Offline
Light Poster

Linux Sound??

 
0
  #1
Jul 24th, 2005
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.
Who is John Galt?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 55
Reputation: Sauce is an unknown quantity at this point 
Solved Threads: 0
Sauce Sauce is offline Offline
Junior Poster in Training

Re: Linux Sound??

 
0
  #2
Jul 24th, 2005
The wonderful power of google...

is this like what your doing?

http://www.daniweb.com/techtalkforum...577#post143577
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 26
Reputation: Rearden is an unknown quantity at this point 
Solved Threads: 0
Rearden's Avatar
Rearden Rearden is offline Offline
Light Poster

Re: Linux Sound??

 
0
  #3
Jul 24th, 2005
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.
Who is John Galt?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,067
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 936
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Linux Sound??

 
1
  #4
Jul 25th, 2005
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")
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 55
Reputation: Sauce is an unknown quantity at this point 
Solved Threads: 0
Sauce Sauce is offline Offline
Junior Poster in Training

Re: Linux Sound??

 
0
  #5
Jul 26th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,768
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 742
Team Colleague
Narue's Avatar
Narue Narue is online now Online
Code Goddess

Re: Linux Sound??

 
0
  #6
Jul 26th, 2005
>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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 26
Reputation: Rearden is an unknown quantity at this point 
Solved Threads: 0
Rearden's Avatar
Rearden Rearden is offline Offline
Light Poster

Re: Linux Sound??

 
1
  #7
Jul 26th, 2005
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.
Who is John Galt?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 55
Reputation: Sauce is an unknown quantity at this point 
Solved Threads: 0
Sauce Sauce is offline Offline
Junior Poster in Training

Re: Linux Sound??

 
0
  #8
Jul 26th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,768
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 742
Team Colleague
Narue's Avatar
Narue Narue is online now Online
Code Goddess

Re: Linux Sound??

 
0
  #9
Jul 26th, 2005
>I think it's cheating.
For theorists, cheating is an option. For the rest of us, it's a necessity.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 26
Reputation: Rearden is an unknown quantity at this point 
Solved Threads: 0
Rearden's Avatar
Rearden Rearden is offline Offline
Light Poster

Re: Linux Sound??

 
0
  #10
Jul 27th, 2005
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.
Who is John Galt?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Game Development Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC