473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sound in visual basic 6.0

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
Jul 17 '05 #1
2 10131
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" <as****@asdasd.nl> wrote in message
news:br**********@reader11.wxs.nl...
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

Jul 17 '05 #2
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" <ed*****@comcast.net> schreef in bericht
news:hs********************@comcast.com...
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" <as****@asdasd.nl> wrote in message
news:br**********@reader11.wxs.nl...
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


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter | last post by:
Hi all, I'm using windows media player as an object in visual basic 6. I have two sound cards in the PC. The default sound card is used for explorer "clicks" and statup / shutdown sounds in...
1
by: Mike Newman | last post by:
Does anyone know if it is possible to program the PC's sound card using Visual Studio.NET in basic? If so, how can I get some information? I just want to sound notes of a specified frequency...
5
by: Larry L | last post by:
I want to play a repetitive sound, and have a user click on a button each time it plays (say 5-10 times) and measure how far off he is from the sound each time. The only way I know to play a...
2
by: scottech | last post by:
I'm not sure if this is the 'right' place to post -- I'm just getting used to the VB newsgroups, but I need assistance and am hoping I can either get the assistance or some help in pointing me the...
2
by: Peteroid | last post by:
Can anybody point me to or give a simple source example of a managed C++ application that can play a wav sound file? I know a little about playSound(), but it doesn't seem to like to compile (even...
5
by: Mike Newman | last post by:
Does anyone know if it is possible to program the PC's sound card using Visual Studio.NET in basic? If so, how can I get some information? I just want to sound notes of a specified frequency...
0
by: mike | last post by:
Sound problems resuming from Hibernation I have an MP3 player that plays MP3s off DVD. Uses mci sendstring errreturn = mciSendString("play sound", rs, 128, cb) Been working great for...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
4
by: Benzerari | last post by:
Hi All; Please, if any one knows the visual basic code, to be added to a Stop button in order to stop playing some sound of (*.Wav) type. I have achieved to find the code for start playing sound...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.