Play a .wav file in my VB6 program? 
Author Message
 Play a .wav file in my VB6 program?

How can I play a .wav file from my VB6 app?

I want to develop a VB6 app that can play a .wav file through the
computer's built-in sound system. The files it plays will not be music
- they will be pre-recorded voice messages.

I downloaded and tested the ShellExecute program from Randy Birch's
site. It plays the .wav file alright but it invokes Windows Media
Player to do the actual playing. I would like to have the file play
without anything visible happening on the screen. IOW, I would like to
be able to click on a button and have the sound file play.

Is there any way this can be done?

Also, is it possible that I could provide the ability to CREATE the
sound files from within my VB program?

Thanks.



Sat, 12 May 2012 23:02:45 GMT  
 Play a .wav file in my VB6 program?

How can I play a .wav file from my VB6 app?

I want to develop a VB6 app that can play a .wav file through the
computer's built-in sound system. The files it plays will not be music
- they will be pre-recorded voice messages.

I downloaded and tested the ShellExecute program from Randy Birch's
site. It plays the .wav file alright but it invokes Windows Media
Player to do the actual playing. I would like to have the file play
without anything visible happening on the screen. IOW, I would like to
be able to click on a button and have the sound file play.

Is there any way this can be done?

Also, is it possible that I could provide the ability to CREATE the
sound files from within my VB program?

There are several methods you can use to play a .wav file. One is to use the sndPlaySound API
function call:

http://support.microsoft.com/kb/86281

With respect to creating the sound file you probably need to provide a little more info as to how
you plan to generate these files.

Paul
~~~~
Microsoft MVP (Visual Basic)



Sat, 12 May 2012 23:15:17 GMT  
 Play a .wav file in my VB6 program?

Yes you can do both; however, I have found that sndPlaySound is not very
reliable especially on Vista.  Sometimes nothing happens, sometimes if
sounds like a needle being dragged over a record and most times it works.
Anyone know a better method?

As far as recording, you can use the PC microphone to record mono or stereo.
See planet source code vb for examples.
http://www.planet-source-code.com/vb/default.asp?lngWId=1

Search for Audio Record
Search for Play Wave

Question?  Has anyone figured out the alternatives to DirectX with VB6 in
Vista?


Quote:
> How can I play a .wav file from my VB6 app?

> I want to develop a VB6 app that can play a .wav file through the
> computer's built-in sound system. The files it plays will not be music
> - they will be pre-recorded voice messages.

> I downloaded and tested the ShellExecute program from Randy Birch's
> site. It plays the .wav file alright but it invokes Windows Media
> Player to do the actual playing. I would like to have the file play
> without anything visible happening on the screen. IOW, I would like to
> be able to click on a button and have the sound file play.

> Is there any way this can be done?

> Also, is it possible that I could provide the ability to CREATE the
> sound files from within my VB program?

> Thanks.



Sat, 12 May 2012 23:31:22 GMT  
 Play a .wav file in my VB6 program?


Quote:
> How can I play a .wav file from my VB6 app?

Google is your firend.  There are numerous examples on the web
on how to do that.

Quote:
> Also, is it possible that I could provide the ability to CREATE the
> sound files from within my VB program?

Have a look at the sound demonstration here:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7...

LFS



Sat, 12 May 2012 23:54:21 GMT  
 Play a .wav file in my VB6 program?


Quote:
>How can I play a .wav file from my VB6 app?

>I want to develop a VB6 app that can play a .wav file through the
>computer's built-in sound system. The files it plays will not be music
>- they will be pre-recorded voice messages.

>I downloaded and tested the ShellExecute program from Randy Birch's
>site. It plays the .wav file alright but it invokes Windows Media
>Player to do the actual playing. I would like to have the file play
>without anything visible happening on the screen. IOW, I would like to
>be able to click on a button and have the sound file play.

>Is there any way this can be done?

>Also, is it possible that I could provide the ability to CREATE the
>sound files from within my VB program?

>Thanks.

Paul / Lorin / Larry - Thanks

The sndPlaySound API seems to do what I want (at least on my WinXPPro
development machine).



Sun, 13 May 2012 00:04:35 GMT  
 Play a .wav file in my VB6 program?

Quote:
> How can I play a .wav file from my VB6 app?

I have a similar need and found this page:

http://www.vb-helper.com/howto_play_mp3.html

Works with MP3s and WAVs, at least the ones I tested :-) Functionality
is integrated, i.e. does not open any external player. HTH Regards Saga




Sun, 13 May 2012 00:27:18 GMT  
 Play a .wav file in my VB6 program?

Quote:
> . . . I have found that sndPlaySound is not very reliable
> especially on Vista.  Sometimes nothing happens,
> sometimes if sounds like a needle being dragged over
> a record and most times it works. Anyone know
> a better method?

I haven't had that problem with sndPlaySound myself, although personally I
prefer to use the ActiveMovie Type Library, which I think is just a wrapper
around the MMC and which can play many kinds of media file. Set a reference
to ActiveMovie Control Type Library and use the following code as a starter:

Option Explicit
Private player1 As Object

Private Sub Command1_Click()
Set player1 = New FilgraphManager
player1.RenderFile "c:\temp\orbison.mp3"
player1.Run
End Sub

Mike



Sun, 13 May 2012 01:09:39 GMT  
 Play a .wav file in my VB6 program?

Quote:

>I want to develop a VB6 app that can play a .wav file through the
>computer's built-in sound system. The files it plays will not be music
>- they will be pre-recorded voice messages.

Do you have something against using the Media Player control?


Sun, 13 May 2012 05:57:15 GMT  
 Play a .wav file in my VB6 program?


Quote:

>>I want to develop a VB6 app that can play a .wav file through the
>>computer's built-in sound system. The files it plays will not be music
>>- they will be pre-recorded voice messages.

>Do you have something against using the Media Player control?

Yeah - it's not appropriate in this situation.

This app will be used in an industrial situation. It will, in effect,
be giving a voice to a machine. When the machine encounters an error
condition or if an operator's attention is needed, it will send a code
number to this app which will, in turn, play the selected,
pre-recorded message out to a loud speaker.



Mon, 14 May 2012 04:12:04 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. How do I play wav files etc in a VB.net program

2. Play WAV file from VB6 and VB.NET

3. Playing WAV files from VB programs

4. Play a wav file on click the programs exit button

5. Playing a WAV-file in VB6

6. VB6 - play 24 bit wav files?

7. Playing a WAV File stored as a VB6 resource

8. Playing WAV files and MIDI files

9. Playing .wav files or .mid files

10. Playing a .wav File from a .vbs File

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

12. How to play .wav in VB6

 

 
Powered by phpBB® Forum Software