[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Playing tone through speakers



Michael Satterwhite wrote:
On Friday 14 January 2005 03:41 pm, Hugo Vanwoerkom wrote:

Michael Satterwhite wrote:

Does anyone know of a utility that will play a continuous tone (specified
frequency, I know there may be some drift) through the computer's
speakers?

I wrote an application using the Network Audio System to play marine
chimes using its continuous tone facility. I used the sine wave tone but
that can be changed too.


Is it available anywhere?

Let me tell you about it first and if you are still interested I will certainly put it on my server.

This is part of my (B)Ruby project installation: 2 monitors/keyboards/mice on 1 PC for 2 users running Sarge.

That exists as a patch to either 2.4.x or 2.6.x kernel. Until very recently the PC Speaker output was busted in that patch and I used to play the chimes through the PC speaker.

So not knowing that I wrote for NAS.

This is a thingy à la vcstime (man vcstime). It puts a little bar at the top right of the X screen that displays the date then the time and the hours/days the system has been up. If the internet is up it is green otherwise red. Left click on it pops up a popup with more info. It plays marine chimes, which I first heard at IBM 20 years ago that somebody had written for PC-DOS: 1 bell every half hour until 4 hours are complete. So right now it is 6AM that is: beep-beep + beep-beep, 4 half hours past 4AM when the watch starts.

Here's the catch: NAS is very behaved but many sound apps are not and hog the sound device. Then NAS politely waits until the device is free. That means that my x-vcstime would sit there blank. So I split it into 2 parts: the display and the sound and if the sound is "hung" the time is displayed in parens and the left click displays in red "the sound client has not been heard from". The two pieces communicate with each other over a port.

E.g. right now I am using sox "play" to play a wav file I downloaded from KUSC and sox blocks the sound device. I seem to recall that cdcd is well behaved and plays well with NAS, or maybe it is mpg321.

Having said all that, now that in Bruby 2.4.29 the speaker is working again: that is certainly a better and easier approach: the PC speaker also generates tones at different pitches/duration and always does its job.

So now I have 2 apps running with marine chimes: one through NAS and the other through the PC Speaker, the latter always chimes because nobody can hog that "device".

I have not Debianized this app and it requires Qt to operate: that does all the displaying, etc. and it also requires libaudio-dev of NAS.

Let me know, you can mail to the email address.

HTH
H










Reply to: