Does anybody know a command line wav player that doesn't display anything?
GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does anybody know a command line wav player that doesn't display anything?
I'm searching for a command line wav player to use it with a program I'm writing (a nice little guitar tuner/ear trainer). It's supposed to run under windows/DOS ( I know, but the program is for a school project).
I want it to play a wav file, without displaying anything.
I tried mplayer, but it shows various info about the computer and the played file, even with the very quiet option. I also tried discarding the output to NUL:, which is an equivalent to Linux's /dev/null from what I get it, but it doesn't seem to work with a 16bit Pascal-written program...
Thought about modifying mplayer's source code for this, or maybe just extracting the functions related to playing wav files, but I have to go through about 2700 files and search...
So, does anyone know of such a program? Other ideas/suggestions are welcomed as well.
Thanks, I should have thought of trying xmms, I never new they had a windows console version...
Quote:
Originally Posted by Dragineez
What you're looking for is the playsound API. Look for the winmm.dll resources to see how to invoke in your programming language du jour.
Thank you too, I'll see what I can find out about it. It should be a good option as well, and would greatly reduce the size of the program.
Quote:
Originally Posted by dasy2k1
read the rules,
we dont help with homework!
Well, the LQ Rules state that I am not allowed to ask you to do my homework, and I am not asking you that. My "homework" consists in actually writing the program, which I shall do myself (actually I already wrote about 70% of it). Simply asking for an external program, for which I have previously googled and searched on sourceforge for hours, in my oppinion doesn't qualify as asking you to do my homework. If I didn't understand the rule right, then please correct me.
My 2 cents -- the OP is simply asking for suggestions for an app that runs silently in CLI. Doesn't look like homework to me, given the context of the question.
Perhaps something like cdtool might be of interest, although I haven't used this personally so don't really know what it does/doesn't do.
Since you're obligated to do it in Windows and your program appears to be shellexec'ing an external program with parameters (the WAV you want to play), why not do it the easy way - PlaySound.vbs.
Code:
If WScript.Arguments.Count <> 1 Then
Wscript.Echo "Usage: CScript.exe PlaySound.vbs <inputFile>"
WScript.Quit
End If
PlaySound WScript.Arguments(0)
'-----------------------------------------------------
' Purpose: To play a sound requested by the user.
'-----------------------------------------------------
Sub PlaySound(TheSound)
Set objWMP = CreateObject("wmplayer.ocx.7")
objWMP.url = TheSound
objWMP.Controls.play
WScript.Sleep 1000
objWMP.close
Set objWMP = nothing
end Sub
You may want to play around with the "Sleep" time. Must be long enough to prevent the object from being destroyed before the wav finishes playing, but should be short enough so you don't have too much silence between wavs you want to play. Could mod the script to take sleep duration as another parameter.
Thank you all for your suggestions. I'll check everything out and post what worked best.
Quote:
Originally Posted by St.Jimmy
Ohh, Will you release it on sf?
I thought about it, and also about making a Linux version. When I chose this project, it was because I could't find a good tuner on Linux for an acoustic guitar.
But I don't know if anyone would really like to use a 16 bit program written in Pascal with crappy graphics. I'll probably rewrite it in C this summer, making it somewhat better, and then post it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.