Playing WAV files 
Author Message
 Playing WAV files

Can someone tell me how to play WAV files?  I saw a sample script that is
supposed to do this, but it seems to require a file called mci32.ocx.  Where
can I get this and how do I install it?


Tue, 19 Mar 2002 03:00:00 GMT  
 Playing WAV files
This sample script will play the wave file %windir%\media\ding.wav.
Just substitute the path to your own wave file in the script, or
substitute a variable that represents a wave file. It doesn't require
any files other than files that are standard Windows installations.

set wave = CreateObject ("WScript.Shell")
wave.run ("sndrec32 /play /close %windir%\media\ding.wav")


: Can someone tell me how to play WAV files?  I saw a sample script
that is
: supposed to do this, but it seems to require a file called
mci32.ocx.  Where
: can I get this and how do I install it?
:
:
:



Tue, 19 Mar 2002 03:00:00 GMT  
 Playing WAV files
Sorry, I should have been clearer.

I am running this on NT 4.0 and Windows 2000 RC2.  Neither one of these have
mci32.ocx installed.  Where does this file come from?  How can I install it
on these OS's?  The error I get is "Error:  Class in not licensed for use"

This is the script I am using:

Set WSHShell = WScript.CreateObject("WScript.Shell")
Set mci = WScript.CreateObject("MCI.MMcontrol")
mci.FileName="c:\jungle.wav"
mci.AutoEnable=1
mci.Command="Open"
mci.Command="Play"
wscript.echo "Done"

This script that I found uses mci32.ocx.  The technique you sent me is
interesting, but it pops-up the media player.  This is a problem if you are
running multiple wav files in a row.  THe mci32.ocx seems to be installed in
windows 98.  I have a copy of it, but do not know how to register it so that
NT can use it.

Thanks for the response.

Frank Mena


Quote:
> This sample script will play the wave file %windir%\media\ding.wav.
> Just substitute the path to your own wave file in the script, or
> substitute a variable that represents a wave file. It doesn't require
> any files other than files that are standard Windows installations.

> set wave = CreateObject ("WScript.Shell")
> wave.run ("sndrec32 /play /close %windir%\media\ding.wav")



> : Can someone tell me how to play WAV files?  I saw a sample script
> that is
> : supposed to do this, but it seems to require a file called
> mci32.ocx.  Where
> : can I get this and how do I install it?
> :
> :
> :



Tue, 19 Mar 2002 03:00:00 GMT  
 Playing WAV files
I think you can just go to start / run, and type REGSVR32 /i mci32.ocx  (with the file saved in %windir%/system32)

I like the code, works great on my win98

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K) http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Sorry, I should have been clearer.

> I am running this on NT 4.0 and Windows 2000 RC2.  Neither one of these have
> mci32.ocx installed.  Where does this file come from?  How can I install it
> on these OS's?  The error I get is "Error:  Class in not licensed for use"

> This is the script I am using:

> Set WSHShell = WScript.CreateObject("WScript.Shell")
> Set mci = WScript.CreateObject("MCI.MMcontrol")
> mci.FileName="c:\jungle.wav"
> mci.AutoEnable=1
> mci.Command="Open"
> mci.Command="Play"
> wscript.echo "Done"

> This script that I found uses mci32.ocx.  The technique you sent me is
> interesting, but it pops-up the media player.  This is a problem if you are
> running multiple wav files in a row.  THe mci32.ocx seems to be installed in
> windows 98.  I have a copy of it, but do not know how to register it so that
> NT can use it.

> Thanks for the response.

> Frank Mena



> > This sample script will play the wave file %windir%\media\ding.wav.
> > Just substitute the path to your own wave file in the script, or
> > substitute a variable that represents a wave file. It doesn't require
> > any files other than files that are standard Windows installations.

> > set wave = CreateObject ("WScript.Shell")
> > wave.run ("sndrec32 /play /close %windir%\media\ding.wav")



> > : Can someone tell me how to play WAV files?  I saw a sample script
> > that is
> > : supposed to do this, but it seems to require a file called
> > mci32.ocx.  Where
> > : can I get this and how do I install it?
> > :
> > :
> > :



Tue, 19 Mar 2002 03:00:00 GMT  
 Playing WAV files
I also hacked some of Michael Harris' code to play it in the browser.

set p = new clsProgress
'p.debug = true
p.show

set p = nothing
 wscript.quit

Class clsProgress
  Private ie
  Private bDebug
  Sub Class_Initialize()
    bDebug = False
    set ie = CreateObject("InternetExplorer.Application")
    with ie
      .toolbar = 0
      .menubar = 0
      .statusbar = 0
      .height = 0
      .navigate _
          "about:<html><head><bgsound%20src=c:/jungle.wav></head><body></body></html>"
      while .busy: wend
    end with
  End Sub

  Public Property Let Debug(bool)
    bDebug = CBool(bool)
  End Property

  Sub Show()
      ie.visible = true
  End Sub

  Sub SetMsg(msgtext)
    On Error Resume Next
    err.clear
    ie.document.body.innerhtml = msgtext
    if err and bDebug then
      msgbox "0x" & hex(err.number) & " " & err.description
      wscript.quit
    end if
    err.clear
  End Sub

  Sub Class_Terminate()
    On Error Resume Next
    ie.quit
    set ie = nothing
    err.clear
  End Sub

End Class

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K) http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm


I think you can just go to start / run, and type REGSVR32 /i mci32.ocx  (with the file saved in %windir%/system32)

I like the code, works great on my win98

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K) http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Sorry, I should have been clearer.

> I am running this on NT 4.0 and Windows 2000 RC2.  Neither one of these have
> mci32.ocx installed.  Where does this file come from?  How can I install it
> on these OS's?  The error I get is "Error:  Class in not licensed for use"

> This is the script I am using:

> Set WSHShell = WScript.CreateObject("WScript.Shell")
> Set mci = WScript.CreateObject("MCI.MMcontrol")
> mci.FileName="c:\jungle.wav"
> mci.AutoEnable=1
> mci.Command="Open"
> mci.Command="Play"
> wscript.echo "Done"

> This script that I found uses mci32.ocx.  The technique you sent me is
> interesting, but it pops-up the media player.  This is a problem if you are
> running multiple wav files in a row.  THe mci32.ocx seems to be installed in
> windows 98.  I have a copy of it, but do not know how to register it so that
> NT can use it.

> Thanks for the response.

> Frank Mena



> > This sample script will play the wave file %windir%\media\ding.wav.
> > Just substitute the path to your own wave file in the script, or
> > substitute a variable that represents a wave file. It doesn't require
> > any files other than files that are standard Windows installations.

> > set wave = CreateObject ("WScript.Shell")
> > wave.run ("sndrec32 /play /close %windir%\media\ding.wav")



> > : Can someone tell me how to play WAV files?  I saw a sample script
> > that is
> > : supposed to do this, but it seems to require a file called
> > mci32.ocx.  Where
> > : can I get this and how do I install it?
> > :
> > :
> > :



Tue, 19 Mar 2002 03:00:00 GMT  
 Playing WAV files
When I try and run REGSVR32, I get a pop-up error message:

mci32.ocx was loaded, but the Dllinstall entry point was not found.
Dllinstall may not be exported, or a corrupt version mci32.ocx may be in
memory.  Consider using PView to detect and remote it.

I have tried 2 different versions of mci32.ocx and the same thing happens.
Also, I get the error message on both NT 4.0 and Windows 2000 pro 2118.
Where do I get PView?

Thanks



I think you can just go to start / run, and type REGSVR32 /i mci32.ocx
(with the file saved in %windir%/system32)

I like the code, works great on my win98

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K)
http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Sorry, I should have been clearer.

> I am running this on NT 4.0 and Windows 2000 RC2.  Neither one of these
have
> mci32.ocx installed.  Where does this file come from?  How can I install
it
> on these OS's?  The error I get is "Error:  Class in not licensed for use"

> This is the script I am using:

> Set WSHShell = WScript.CreateObject("WScript.Shell")
> Set mci = WScript.CreateObject("MCI.MMcontrol")
> mci.FileName="c:\jungle.wav"
> mci.AutoEnable=1
> mci.Command="Open"
> mci.Command="Play"
> wscript.echo "Done"

> This script that I found uses mci32.ocx.  The technique you sent me is
> interesting, but it pops-up the media player.  This is a problem if you
are
> running multiple wav files in a row.  THe mci32.ocx seems to be installed
in
> windows 98.  I have a copy of it, but do not know how to register it so
that
> NT can use it.

> Thanks for the response.

> Frank Mena



> > This sample script will play the wave file %windir%\media\ding.wav.
> > Just substitute the path to your own wave file in the script, or
> > substitute a variable that represents a wave file. It doesn't require
> > any files other than files that are standard Windows installations.

> > set wave = CreateObject ("WScript.Shell")
> > wave.run ("sndrec32 /play /close %windir%\media\ding.wav")



> > : Can someone tell me how to play WAV files?  I saw a sample script
> > that is
> > : supposed to do this, but it seems to require a file called
> > mci32.ocx.  Where
> > : can I get this and how do I install it?
> > :
> > :
> > :



Wed, 20 Mar 2002 03:00:00 GMT  
 Playing WAV files
I'm sure PView would do nothing for you but give a little more info on the error. The ocx is probably win 9x specific. Using the browser as a player should hit the all platforms.

I played around with the code below, but I don't really see why it fails, either.

Set amc = WScript.CreateObject("AMOVIE.ActiveMovieControl.2")
amc.Filename="c:/windows/media/ding.wav"
amc.Autostart="-1"
amc.Run()

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K) http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> When I try and run REGSVR32, I get a pop-up error message:

> mci32.ocx was loaded, but the Dllinstall entry point was not found.
> Dllinstall may not be exported, or a corrupt version mci32.ocx may be in
> memory.  Consider using PView to detect and remote it.

> I have tried 2 different versions of mci32.ocx and the same thing happens.
> Also, I get the error message on both NT 4.0 and Windows 2000 pro 2118.
> Where do I get PView?

> Thanks



> I think you can just go to start / run, and type REGSVR32 /i mci32.ocx
> (with the file saved in %windir%/system32)

> I like the code, works great on my win98

> --
> mvp Mark L. Ferguson Please reply in newsgroup
> marfers notes for OE 5 > (16K)
> http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm


> > Sorry, I should have been clearer.

> > I am running this on NT 4.0 and Windows 2000 RC2.  Neither one of these
> have
> > mci32.ocx installed.  Where does this file come from?  How can I install
> it
> > on these OS's?  The error I get is "Error:  Class in not licensed for use"

> > This is the script I am using:

> > Set WSHShell = WScript.CreateObject("WScript.Shell")
> > Set mci = WScript.CreateObject("MCI.MMcontrol")
> > mci.FileName="c:\jungle.wav"
> > mci.AutoEnable=1
> > mci.Command="Open"
> > mci.Command="Play"
> > wscript.echo "Done"

> > This script that I found uses mci32.ocx.  The technique you sent me is
> > interesting, but it pops-up the media player.  This is a problem if you
> are
> > running multiple wav files in a row.  THe mci32.ocx seems to be installed
> in
> > windows 98.  I have a copy of it, but do not know how to register it so
> that
> > NT can use it.

> > Thanks for the response.

> > Frank Mena



> > > This sample script will play the wave file %windir%\media\ding.wav.
> > > Just substitute the path to your own wave file in the script, or
> > > substitute a variable that represents a wave file. It doesn't require
> > > any files other than files that are standard Windows installations.

> > > set wave = CreateObject ("WScript.Shell")
> > > wave.run ("sndrec32 /play /close %windir%\media\ding.wav")



> > > : Can someone tell me how to play WAV files?  I saw a sample script
> > > that is
> > > : supposed to do this, but it seems to require a file called
> > > mci32.ocx.  Where
> > > : can I get this and how do I install it?
> > > :
> > > :
> > > :



Wed, 20 Mar 2002 03:00:00 GMT  
 Playing WAV files
This modification to the script runs the wave file without showing
Sound Recorder.

set wave = CreateObject ("WScript.Shell")
wave.run "sndrec32 /play /close %windir%\media\ding.wav",0



Thu, 21 Mar 2002 03:00:00 GMT  
 Playing WAV files


Quote:
>When I try and run REGSVR32, I get a pop-up error message:

>mci32.ocx was loaded, but the Dllinstall entry point was not found.
>Dllinstall may not be exported, or a corrupt version mci32.ocx may be in
>memory.  Consider using PView to detect and remote it.

>I have tried 2 different versions of mci32.ocx and the same thing happens.
>Also, I get the error message on both NT 4.0 and Windows 2000 pro 2118.
>Where do I get PView?

1.

It's a licensed control.

2.

Try regsvr32 mci32.ocx (i.e. without the -i)

--
Robert Bradley

I am not a mindreader, so I don't know everything.



Thu, 21 Mar 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Need Help Playing WAV File

2. Best way to play wav-files with WSH

3. How to play *.WAV files

4. Delaying in Playing WAV Files with Windows Media Player 9

5. Playing .wav file using EMBED tag object

6. .vbs file to play a .wav if file size does not equal 0

7. Playing a .wav File from a .vbs File

8. Sound -> howto play wav files ?

9. Playing a WAV file in VBscript

10. Is it possible to Play and close a wav file using Soundrec32.exe

11. PLaying multiple .WAV files when page loads

12. Create a new .wav file from an existing .wav file based on the date

 

 
Powered by phpBB® Forum Software