Page 1 of 1

solved : How to "beep" sound to plain speaker or headphone

Posted: 2017-11-01 00:02
by lbuiyzxl
[ solved ] How to "beep" sound to my headphone not the pc speaker ?
[ solved ] How to "beep" sound to external speaker or headphone ?

I want all as or similar to beep(1) but sound is output to my headphone or other loudspeaker.
Is there any tool do this?
Thank you.
Of course,this post contents only for fun that to play beep music in headphone or other loudspeaker. :D

Thu Nov 23 20:54:55 CST 2017:
First, thank GarryRicketson for the directly answer

I no solved this question by search,but now I try guess that Google key word:
https://www.google.com/search?newwindow ... grfsqv4bvg
then:
https://unix.stackexchange.com/question ... eaker-beep
Ctrl+F to search 'soudcard" on that stackexchange page
Now you can found this answer by Google search .
HTH :D

Re: How to "beep" sound to my headphone not the pc speaker?

Posted: 2017-11-02 16:09
by tynman
The purpose of the beep command is to send "beep sounds" to the PC speaker, not to the computer's sound card. If you want to send "beeps" to speakers or headphones connected to your sound card, you would need to use some other software (i.e., not the beep command).

I don't have any experience with the type of sound software that can generate "beep sounds", so I am just guessing here: I would assume that any sound package that supports "MIDI" could be used - you would just need to tell it to produce a specific audio frequency for a short period of time (maybe 1/10 second?).

Re: How to "beep" sound to my headphone not the pc speaker?

Posted: 2017-11-02 16:39
by GarryRicketson
Try this :
https://packages.debian.org/stretch/sox
After installing , read the manual.

Code: Select all

man sox
NAME
SoX - Sound eXchange, the Swiss Army knife of audio manipulation

SYNOPSIS
sox [global-options] [format-options] infile1
[[format-options] infile2] ... [format-options] outfile
[effect [effect-options]] ...

play [global-options] [format-options] infile1
[[format-options] infile2] ... [format-options]
[effect [effect-options]] ...

SoX(1) Sound eXchange SoX(1)

NAME
SoX - Sound eXchange, the Swiss Army knife of audio manipulation
For example:

Code: Select all

play -n synth .3 sine A4 
Will play short beep, or tone A .
You could put the command in a simple shell script, and name it
"beep-1.sh", then it could be run by just typing "./beep-1", don't use "beep"
for the name, it could cause conflict , or confusion with the "beep" command
you have all ready.

Re: How to "beep" sound to my headphone not the pc speaker?

Posted: 2017-11-23 07:40
by lbuiyzxl
@GarryRicketson
Thank you.
If you post your answer with search ,then what is your searching key word to solved this question ? please.

Re: How to "beep" sound to my headphone not the pc speaker?

Posted: 2017-11-23 10:28
by GarryRicketson
Not sure I understand, you can edit the first post, subject line, add the
word "solved",...

If you mean what key words I used to find a answer, ?
Actually none, I did not find the answer to this by doing a search.
By coincidence , I had asked a similar question here:
http://daemonforums.org/showpost.php?p= ... ostcount=1
Well, if you want to use the external speaker then it's probably easier to just generate a .wav (or other sound file format) with audio/audacity for use with your favorite music playing software.
When I tried "audacity", it was not what I wanted, but in the Audacity manual:
If you need to batch-process audio or do
simple edits from the command line, using sox or ecasound driven by a
bash script will be much more powerful than audacity.
They mentioned "sox", so I installed that, and it works perfect for what I
wanted to do.

Re: How to "beep" sound to my headphone not the pc speaker?

Posted: 2017-11-23 12:32
by lbuiyzxl
GarryRicketson wrote:Not sure I understand, you can edit the first post, subject line, add the
word "solved",...
I'm sorry due subject line had too length ,so I can't add the "solved" word.

solved:How to "beep"sound to external speaker,headphone

Posted: 2017-11-23 12:44
by GarryRicketson
You would have to shorten it:
Example, or copy/paste:

Code: Select all

solved:How to "beep" sound to external speaker or headphone