Let the "Sound" be heard!

Features wanted...
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Let the "Sound" be heard!

Post by aurumdigitus »

For a long time have wished for a Sound function but thought Don would consider it superfluous bloat.

Love it. Has already been rolled into several CTB's. :mrgreen:

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Let the "Sound" be heard!

Post by zer0 »

Perhaps this ^^^ post is more suitable for this thread? http://www.xyplorer.com/xyfc/viewtopic.php?f=6&t=730

Regarding the overall functionality of this feature, I'd like for playlist files to be supported. I suppose we're talking about file types like .m3u and .wpl. I assume that sound feature was included as a form of notification, perhaps as an alternative to a dialogue pop-up. Therefore, if it's a "no" then it's a "no" :P
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Let the "Sound" be heard!

Post by aurumdigitus »

If that thread (or something like it) were a main Forum Topic people would gravitate to it easily and eschew the obfuscation. :roll:

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Let the "Sound" be heard!

Post by j_c_hallgren »

aurumdigitus wrote:If that thread (or something like it) were a main Forum Topic people would gravitate to it easily and eschew the obfuscation. :roll:
It's not that hard to find when you use the "View Active Topics" link as your primary display mode...and you've been here long enough to know where things hide, I thought. :wink:
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Let the "Sound" be heard!

Post by aurumdigitus »

j_c_hallgren wrote:...and you've been here long enough to know where things hide, I thought.
De gustibus non est disputandum. :evil:

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Let the "Sound" be heard!

Post by Stefan »

v8.80.0331 - 2010-03-04 15:19
+ Scripting got a new command.
Name: Sound
Action: Plays a sound.
edit:
beta log> "Event labels can be found in your registry here"

I have found out:
All Win32 systems support at least the following; most systems support many more:
PlaySound() name Corresponding Control Panel Sound name
'SystemAsterisk' Asterisk
'SystemExclamation' Exclamation
'SystemExit' Exit Windows
'SystemHand' Critical Stop
'SystemQuestion' Question
So we can use e.g.:
sound "SystemAsterisk",0;
sound "SystemExclamation",0;
sound "SystemExit",0;
sound "SystemHand",0;
sound "SystemQuestion",0;
or
sound "SystemStart",0;
sound "WindowsLogon",0;
sound "WindowsLogoff",0;
/edit




@Don
since company pc mostly don't have loudspeaker...
maybe you want to implement an BEEP command?

Code: Select all

' API-Deklaration
Private Declare Function Beep Lib "kernel32" ( _
  ByVal dwFreq As Long, _
  ByVal dwDuration As Long) As Long
http://www.vbarchiv.net/tipps/tipp_430- ... laune.html

So i can let the internal speaker beep if my script is finished
beep 500 600;
beep 700 200;
beep 700 400;
Last edited by Stefan on 07 Mar 2010 11:52, edited 2 times in total.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Let the "Sound" be heard!

Post by admin »

Stefan wrote:
v8.80.0331 - 2010-03-04 15:19
+ Scripting got a new command.
Name: Sound
Action: Plays a sound.
@Don
since company pc mostly don't have loudspeaker...
maybe you want to implement an BEEP command?

Code: Select all

' API-Deklaration
Private Declare Function Beep Lib "kernel32" ( _
  ByVal dwFreq As Long, _
  ByVal dwDuration As Long) As Long
http://www.vbarchiv.net/tipps/tipp_430- ... laune.html

So i can let the internal speaker beep if my script is finished
beep 500 600;
beep 700 200;
beep 700 400;
Yeah, will do.

However: "On Windows 7 Beep does not make sound on a motherboard speaker, but on a sound card."

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Let the "Sound" be heard!

Post by Stefan »

Admin> Yeah, will do.

Thanks.

I don't know what this code will do as default
(i think an simple beep; without parameter will do nothing on first implantation),

so please consider to let this command in XY play an "standard" beep always, even without any parameter.

I mean an simple beep; should play an sound like beep 800 200; instead of doing nothing.


But i bet you would had think about this on your own.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Let the "Sound" be heard!

Post by admin »

Stefan wrote:Admin> Yeah, will do.

Thanks.

I don't know what this code will do as default
(i think an simple beep; without parameter will do nothing on first implantation),

so please consider to let this command in XY play an "standard" beep always, even without any parameter.

I mean an simple beep; should play an sound like beep 800 200; instead of doing nothing.


But i bet you would had think about this on your own.
I had thought about it but did not find any specs about the standard beep. Is it 800 200?

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Let the "Sound" be heard!

Post by serendipity »

admin wrote:
Stefan wrote:@Don
since company pc mostly don't have loudspeaker...
maybe you want to implement an BEEP command?

Code: Select all

' API-Deklaration
Private Declare Function Beep Lib "kernel32" ( _
  ByVal dwFreq As Long, _
  ByVal dwDuration As Long) As Long
http://www.vbarchiv.net/tipps/tipp_430- ... laune.html

So i can let the internal speaker beep if my script is finished
beep 500 600;
beep 700 200;
beep 700 400;
Yeah, will do.

However: "On Windows 7 Beep does not make sound on a motherboard speaker, but on a sound card."
And with frequencies and durations one can compose music, use keyboard as piano keys and even repel animals using ultrasonic sounds. :wink:

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Let the "Sound" be heard!

Post by Stefan »

admin wrote:
Stefan wrote:Admin> Yeah, will do.

Thanks.

I don't know what this code will do as default
(i think an simple beep; without parameter will do nothing on first implantation),

so please consider to let this command in XY play an "standard" beep always, even without any parameter.

I mean an simple beep; should play an sound like beep 800 200; instead of doing nothing.


But i bet you would had think about this on your own.
I had thought about it but did not find any specs about the standard beep. Is it 800 200?
> beep 800 200
At least with "D0kTorZ Beep for DOS" http://doktorz.mooltied.de/delphi/beep.html

With BM (PC Magazine's Batchman http://www.glennmcc.org/download/free_s ... batchcolls)
it's more like bm beep 800,4

http://msdn.microsoft.com/en-us/library ... 85%29.aspx
use: Beep( 750, 300 ); for an test

others use beep 440 200
e.g. http://johnath.com/beep/beep.c


I think you can check this by typing ^G (or Alt+7) into an DOS-Box and pressing {enter}



The following table gives the frequency values for a five octave range (middle C is 262 Hz):
http://www.jpsoft.com/help/beep.htm


I will investigate some more on this.

serendipity wrote: And with frequencies and durations one can compose music, use keyboard as piano keys
and even repel animals using ultrasonic sounds. :wink:
Yeah. Check out ""Beep" v1.2 FREEWARE! Quentin Christensen, Australia (1999)"
http://www.glennmcc.org/download/free_s ... batch2.htm
ECHO. Mary had a little lamb.
ECHO.
BEEP /F330 /L500 /P'Mar'
BEEP /F294 /L100 /P'y'
BEEP /F262 /L300 /P' had'
BEEP /F294 /L300 /P' a'
BEEP /F330 /L300 /P' lit'
BEEP /F330 /L300 /P'tle'
BEEP /F330 /L700 /P' lamb,' /N
:lol: :mrgreen: :oops:
Last edited by Stefan on 07 Mar 2010 11:36, edited 3 times in total.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Let the "Sound" be heard!

Post by Stefan »

admin wrote:However: "On Windows 7 Beep does not make sound on a motherboard speaker, but on a sound card."
Just found some info btw, but have no W7 to check this out.

It seams that the speaker support is done by using an beep.sys
So one have to find the right driver for his system to get this to work.
But there seams no 64-bit beep.sys driver right now?


Just some infos found:

Larry Osterman's WebLog
What’s up with the Beep driver in Windows 7?
http://blogs.msdn.com/larryosterman/arc ... ows-7.aspx
comment wrote:Dell desktops (Optiplexes, at least) have an internal speaker, presumably on-board. T
hey also wire the output of the actual (on-board) sound card to it, in case nothing is connected to the speaker
or headphones ports. So even if Windows 7 routes Beep() to the sound card, it could get re-routed back to the internal speaker!

i have to check this out:
Default Beep PC Speaker changed in windows 7 – How to get back to old style
The default beep is controlled by a driver under, c:\windows\system32\drivers\beep.sys.
Maybe if you switched it out with a driver from XP/Vista it would increase the volume.

To see this driver you have to open device manager then click on View > Show hidden devices. Then under
Non-Plug and Play Drivers you’ll see “Beep.” This is the driver that runs your beep. Right click on it then choose
properties and go to the driver tab, then click on Driver Details… This shows the file version which looks like it’s
been change with Windows 7. So replace it with an older version and see what happens.

Procedure to follow

1. Boot from an UBCD4WIN disc (or BartPE if you don’t have an SATA hard drive)
2. Take ownership of the “C:\Windows\System32\Drivers\Beep.sys” file and give the local “Administrators” Group “Full Control” permissions.
3. Rename “Beep.sys” to “Beep.old” (just in case)
4. Copy “Beep.sys” from an XP machine to this location.
http://www.windowsreference.com/windows ... old-style/



Also i learned to control the beep.sys driver by using "Net start beep" and "Net stop beep"
http://blogs.msdn.com/larryosterman/arc ... spx#489503


Then i found this bit:
"HKEY_CURRENT_USER > Control Panel > Sound" - "Beep = Yes|No"


Update:
Seit Windows 7 schickt SOUNDBEEP seine Töne direkt an den Soundprozessor.
Damit klingt das Piepsen in manchen Ohren vielleicht angenehmer, der neue Treiber hat aber folgende Nachteile:
1. Die im Befehl eingestellten Frequenzen sind kaum noch wahrnehmbar/unterscheidbar.
2. Das Piepsen wird nun gepuffert. Wer also mit Soundbeep zeitkritische Prozesse akustisch wahrnehmbar
machen will, wird sein blaues Wunder erleben. So kann es passieren, dass das Skript schon fertig ist, aber der
Lautsprecher munter noch Bestätigungstöne zu längst vergangen Meldungen ausspuckt.

Nach eingem Recherchieren habe ich die Gründe für das geänderte Verhalten und einen Lösungsansatz gefunden:
Das Piepsen unter Windows macht ein Gerät namens BEEP, welches ihr im Gerätemanager unter Nicht-PnP-Treiber
(standardmäßig ausgeblendet) findet. Der Treiber dafür heißt beep.sys und ist unter windows\system32\driver zu finden.

Wird nun dieser Treiber durch die alte Datei aus Windows XP ersetzt, gibt's auch wieder als alte Lautsprecherpiepsen. Um das zu ändern, bin ich wie folgt vorgegangen:
1. Im Gerätemanager das Piepsen auf deaktiviert setzten und neu starten.
2. Bei der Datei beep.sys sich selbst als Besitzer setzen (wegen der Zugriffsrechte).
3. Die Datei beep.sys kann nun durch die alte aus Win XP ersetzt werden (vorher sichern!)
4. Im Gerätemanager Piepsen wieder aktivieren, ggf. neu starten.
http://de.autohotkey.com/forum/topic6140.html
In english, with pictures: http://www.recipester.org/Recipe:Restor ... 7_42581702



http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Remarks
Muting and volume controls have no effect on Beep; you will still hear the tone.
To silence the tone, use the following commands:

net stop beep

sc config beep start= disabled
Terminal Services: The beep is redirected to the client.
Windows Vista x64 and Windows XP 64-Bit Edition: This function is not supported.

Examples
The following example demonstrates the use of this function.
Beep( 750, 300 );







Console..::.Beep Method (Int32, Int32)
// Define the frequencies of notes in an octave, as well as
// silence (rest).
enum class Tone
{
REST = 0,
GbelowC = 196,
A = 220,
Asharp = 233,
B = 247,
C = 262,
Csharp = 277,
D = 294,
Dsharp = 311,
E = 330,
F = 349,
Fsharp = 370,
G = 392,
Gsharp = 415
};


// Define the duration of a note in units of milliseconds.
enum class Duration
{
WHOLE = 1600,
HALF = Duration::WHOLE / 2,
QUARTER = Duration::HALF / 2,
EIGHTH = Duration::QUARTER / 2,
SIXTEENTH = Duration::EIGHTH / 2
};
Note: The Beep method is not supported on the 64-bit editions of Windows Vista and Windows XP.
http://msdn.microsoft.com/en-us/library/4fe3hdb1.aspx
Last edited by Stefan on 07 Mar 2010 10:49, edited 1 time in total.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Let the "Sound" be heard!

Post by admin »

Stefan wrote:
admin wrote:However: "On Windows 7 Beep does not make sound on a motherboard speaker, but on a sound card."
Just found some info btw, but have no W7 to check this out. ...
Thanks! I hope somebody with W7 will read (and try) it.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Let the "Sound" be heard!

Post by Stefan »

admin wrote:
Stefan wrote:@Don
since company pc mostly don't have loudspeaker...
maybe you want to implement an BEEP command?

beep 700 400;
Yeah, will do.
Just found an syntax idea while searching:
beep 500 600, 700 200, 700 400;

instead of
beep 500 600;
beep 700 200;
beep 700 400;

maybe you want to adapt ?

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Let the "Sound" be heard!

Post by admin »

Stefan wrote:
admin wrote:
Stefan wrote:@Don
since company pc mostly don't have loudspeaker...
maybe you want to implement an BEEP command?

beep 700 400;
Yeah, will do.
Just found an syntax idea while searching:
beep 500 600, 700 200, 700 400;

instead of
beep 500 600;
beep 700 200;
beep 700 400;

maybe you want to adapt ?
naah, too fancy. :P

Post Reply