Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Sound in visual basic 6.0
Old
  (#1)
Jeroen van vliet
Guest
 
Posts: n/a
Default Sound in visual basic 6.0 - 06-04-2007, 08:56 AM

Hello all,

I have an ado control with an access dbase and i want to make a button that
when its clicked a specified wav or mp3 file will be played in accordance
with each record on the access database. Does anyone know how do do this?

Jeroen


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Sound in visual basic 6.0
Old
  (#2)
edoepke
Guest
 
Posts: n/a
Default Re: Sound in visual basic 6.0 - 06-04-2007, 08:56 AM

This will get you started on how to play music files. Modify it and you
should be able to get close to what you want.



Private WithEvents p As MediaPlayer.MediaPlayer

'Place 2 Command Buttons on your form and name them "cmdPlay" and "cmdStop".
To control the volume, place a slider control on your form and 'set the Min
to -10000 (No volume) and the Max to 0 (Full Volume). Set the SelStart
Property to somewhere in the middle of your range. I've also 'placed a Label
with the caption "Volume". Now paste the following code into your project.

Private Sub cmdPlay_Click()
ButtonControl
p.Volume = Slider1.Value
'I've defined MySelection from a selected item in a listbox control
p.Open MySelection
End Sub

Private Sub cmdStop_Click()
p.Stop
ButtonControl
End Sub

Public Sub ButtonControl()
p.Stop
cmdStop.Enabled = Not cmdStop.Enabled
cmdPlay.Enabled = Not cmdPlay.Enabled
Slider1.Visible = Not Slider1.Visible
Label2.Visible = Not Label2.Visible
End Sub

Private Sub Slider1_Scroll()
p.Volume = Slider1.Value
End Sub

"Jeroen van vliet" <EMAIL REMOVED> wrote in message
news:brd94f$1d4$EMAIL REMOVED...
> Hello all,
>
> I have an ado control with an access dbase and i want to make a button

that
> when its clicked a specified wav or mp3 file will be played in accordance
> with each record on the access database. Does anyone know how do do this?
>
> Jeroen
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Sound in visual basic 6.0
Old
  (#3)
Lachuh
Guest
 
Posts: n/a
Default Re: Sound in visual basic 6.0 - 06-04-2007, 08:57 AM

Thanks for the reply, but i want to get the wav files from the adocontrol
how do i do this? How do i get the wav files?
"edoepke" <EMAIL REMOVED> schreef in bericht
news:hsidnZLJYd8YGUaiRVn-EMAIL REMOVED...
> This will get you started on how to play music files. Modify it and you
> should be able to get close to what you want.
>
>
>
> Private WithEvents p As MediaPlayer.MediaPlayer
>
> 'Place 2 Command Buttons on your form and name them "cmdPlay" and

"cmdStop".
> To control the volume, place a slider control on your form and 'set the

Min
> to -10000 (No volume) and the Max to 0 (Full Volume). Set the SelStart
> Property to somewhere in the middle of your range. I've also 'placed a

Label
> with the caption "Volume". Now paste the following code into your project.
>
> Private Sub cmdPlay_Click()
> ButtonControl
> p.Volume = Slider1.Value
> 'I've defined MySelection from a selected item in a listbox control
> p.Open MySelection
> End Sub
>
> Private Sub cmdStop_Click()
> p.Stop
> ButtonControl
> End Sub
>
> Public Sub ButtonControl()
> p.Stop
> cmdStop.Enabled = Not cmdStop.Enabled
> cmdPlay.Enabled = Not cmdPlay.Enabled
> Slider1.Visible = Not Slider1.Visible
> Label2.Visible = Not Label2.Visible
> End Sub
>
> Private Sub Slider1_Scroll()
> p.Volume = Slider1.Value
> End Sub
>
> "Jeroen van vliet" <EMAIL REMOVED> wrote in message
> news:brd94f$1d4$EMAIL REMOVED...
> > Hello all,
> >
> > I have an ado control with an access dbase and i want to make a button

> that
> > when its clicked a specified wav or mp3 file will be played in

accordance
> > with each record on the access database. Does anyone know how do do

this?
> >
> > Jeroen
> >
> >

>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top