How to create tones without launching Windows Media Player
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
How to create tones without launching Windows Media Player

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
Sam Low
Guest





Posted: Fri Jan 07, 2005 7:42 pm    Post subject: How to create tones without launching Windows Media Player Reply with quote

In the old days, BASIC used to have a command (I think it was SOUND) that
could generate tones at a specified frequency for a specified duration that
is played on the built-in speaker. Is there some equivalent in VBScript?
Every machine today, from PC to server, still has that built-in speaker. I
am runnng some scripts and occasionally want to send some audio signals to
indicate certain events, and just ASCII 7 doesn't allow me to differentiate
different events.

Launching the giant WMP just to play a single tone seems like a gross
overkill.

Thanks in advance.
Back to top
SubnetJO
Guest





Posted: Fri Jan 07, 2005 8:49 pm    Post subject: RE: How to create tones without launching Windows Media Play Reply with quote

You may use the best player of the world... CoolPlayer!

It is a 584 KB player from the "source forge", available for download at page:
http://prdownloads.sourceforge.net/coolplayer/CoolPlayer215_Bin.zip?download

One zip file of less than 400 KB!!!

The player natively support MP3 and many other file formats!
Supports the playlists, you may add codecs and even... supports the "skins"!

Surely the best, in my opinion.
You can try with it.

I hope this can help,
SubnetJO
Italy


"Sam Low" ha scritto:

Quote:
In the old days, BASIC used to have a command (I think it was SOUND) that
could generate tones at a specified frequency for a specified duration that
is played on the built-in speaker. Is there some equivalent in VBScript?
Every machine today, from PC to server, still has that built-in speaker. I
am runnng some scripts and occasionally want to send some audio signals to
indicate certain events, and just ASCII 7 doesn't allow me to differentiate
different events.

Launching the giant WMP just to play a single tone seems like a gross
overkill.

Thanks in advance.


Back to top
David H. Lipman
Guest





Posted: Fri Jan 07, 2005 9:25 pm    Post subject: Re: How to create tones without launching Windows Media Play Reply with quote

Kixtart ( http://kixtart.org Kixtart is CareWare) has the ability built into their
interpreter

PLAY [FILE "path\filename.spk"] | "string" | "path\filename.wav"

There are four possible syntax forms:

- PLAY FILE "Jbond.spk"
- PLAY "0g256t 0g8d247f 4d165f 247f 8d262f 4d165f 262f 8d277f 4d165f"
- PLAY FILE "Ding.wav"
- PLAY "Chimes.wav"



--
Dave




"Sam Low" <samlow91xx@hotmail.com> wrote in message
news:%23NroE7L9EHA.3676@TK2MSFTNGP10.phx.gbl...
| In the old days, BASIC used to have a command (I think it was SOUND) that
| could generate tones at a specified frequency for a specified duration that
| is played on the built-in speaker. Is there some equivalent in VBScript?
| Every machine today, from PC to server, still has that built-in speaker. I
| am runnng some scripts and occasionally want to send some audio signals to
| indicate certain events, and just ASCII 7 doesn't allow me to differentiate
| different events.
|
| Launching the giant WMP just to play a single tone seems like a gross
| overkill.
|
| Thanks in advance.
|
|
Back to top
Torgeir Bakken (MVP)
Guest





Posted: Fri Jan 07, 2005 10:07 pm    Post subject: Re: How to create tones without launching Windows Media Play Reply with quote

Sam Low wrote:

Quote:
In the old days, BASIC used to have a command (I think it was SOUND) that
could generate tones at a specified frequency for a specified duration that
is played on the built-in speaker. Is there some equivalent in VBScript?
Every machine today, from PC to server, still has that built-in speaker. I
am runnng some scripts and occasionally want to send some audio signals to
indicate certain events, and just ASCII 7 doesn't allow me to differentiate
different events.
Hi


Set oShell = CreateObject("Wscript.Shell")
sWaveFile = "%windir%\media\tada.wav"
oShell.Run "sndrec32.exe /embedding /play /close """ _
& sWaveFile & """", 0, True



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Back to top
David
Guest





Posted: Sat Jan 08, 2005 3:53 am    Post subject: Re: How to create tones without launching Windows Media Play Reply with quote

u can also embed this in your script:

WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True
WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True
WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True

DT


"Torgeir Bakken (MVP)" wrote:

Quote:
Sam Low wrote:

In the old days, BASIC used to have a command (I think it was SOUND) that
could generate tones at a specified frequency for a specified duration that
is played on the built-in speaker. Is there some equivalent in VBScript?
Every machine today, from PC to server, still has that built-in speaker. I
am runnng some scripts and occasionally want to send some audio signals to
indicate certain events, and just ASCII 7 doesn't allow me to differentiate
different events.
Hi

Set oShell = CreateObject("Wscript.Shell")
sWaveFile = "%windir%\media\tada.wav"
oShell.Run "sndrec32.exe /embedding /play /close """ _
& sWaveFile & """", 0, True



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Back to top
Sam Low
Guest





Posted: Sat Jan 08, 2005 9:51 am    Post subject: Re: How to create tones without launching Windows Media Play Reply with quote

Thank you. But WScript.echo chr(7) would do the same.

I think I will launch sndrec32.exe as suggested by Torgeir.

Thanks all.

"David" <davidnyg@gmail.com> wrote in message
news:5E72ADB4-DD49-4CCC-A2FB-E3497D68B17C@microsoft.com...
Quote:
u can also embed this in your script:

WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True
WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True
WSHShell.Run "%comspec% /c echo " & Chr(07), 0, True

DT


"Torgeir Bakken (MVP)" wrote:

Sam Low wrote:

In the old days, BASIC used to have a command (I think it was SOUND)
that
could generate tones at a specified frequency for a specified duration
that
is played on the built-in speaker. Is there some equivalent in
VBScript?
Every machine today, from PC to server, still has that built-in
speaker. I
am runnng some scripts and occasionally want to send some audio
signals to
indicate certain events, and just ASCII 7 doesn't allow me to
differentiate
different events.
Hi

Set oShell = CreateObject("Wscript.Shell")
sWaveFile = "%windir%\media\tada.wav"
oShell.Run "sndrec32.exe /embedding /play /close """ _
& sWaveFile & """", 0, True



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB