473,385 Members | 1,890 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,385 software developers and data experts.

use vb6 to play an MP3 sound, cmd button event

17
how do i get vb6 to play a short MP3 sound file when i click a button, if its even possible. ive looked around and found some vb6 MP3 players, so i asume it is possible, but mostly all im finding is code for playing WAV files.
any response is greatly apreciated
Oct 30 '07 #1
4 11198
kadghar
1,295 Expert 1GB
I think i've seen that question answered before around here, have you searched it?
try using sndPlaySound

Just declare it:

Private Declare Function sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)

and use it:

sndPlaySound "C:\mySound.wav", &H1

you can search the values of the uFlags in google.

HTH
Oct 30 '07 #2
dennijr
17
I think i've seen that question answered before around here, have you searched it?
try using sndPlaySound

Just declare it:

Private Declare Function sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)

and use it:

sndPlaySound "C:\mySound.wav", &H1

you can search the values of the uFlags in google.

HTH
yea, i did search it, but like i said, mainly all i found was wav files, and the other problem is that u cant search 3 letter words in the search thing, so i cant search for say "vb6, mp3, etc". and did u notice that what u added was .wav aswell, not mp3? i tried to replace .wav with .mp3 but it wont work.
Oct 30 '07 #3
vdraceil
236 100+
yea, i did search it, but like i said, mainly all i found was wav files, and the other problem is that u cant search 3 letter words in the search thing, so i cant search for say "vb6, mp3, etc". and did u notice that what u added was .wav aswell, not mp3? i tried to replace .wav with .mp3 but it wont work.
Windows Media Player Control can play .mp3 files
paste a wmp control in your form and include the following code
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmd_click
  2. wmp.url="\\file_path\filename.mp3"
  3. End Sub
Oct 30 '07 #4
dennijr
17
ty, thats the quick easy fix i needed, and the visible = false setting makes it even better :)
Oct 30 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: | last post by:
Hi everybody. Need your help. How can I play sound (.wav-file / camera click) on mouseclick? TIA willy wuff ...
1
by: svpsiva | last post by:
How to play sound in j2sdk1.4.2_07??
0
by: yuen | last post by:
How to play sound by C# without using WMP?
0
by: seo gang ho | last post by:
this is my source :$ (tone generator) how to play sound in outputbuffer? please help me...teach me detail...:$ using System;
1
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be"...
10
by: CM | last post by:
Hi, I used to use the following code to play sound in VB6: Public Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _ (ByVal lpszSoundName As String, ByVal uFlags As...
1
by: tinmaung | last post by:
hi please help me i want to know how to play sound in java application i don't mean java applet if you can, please send me how to write coding to play sound in application.
1
by: anuvanand1 | last post by:
I am in need of user defined function for Play sound .........
3
by: jamessarvs | last post by:
Windows Media Player cannot play the file because there is a problem with your sound device. There might not be a sound device installed on your computer, it might be in use by another program, or it...
1
by: nicolecastel | last post by:
Hello I want to play sound in three external sound cards at the same time,I mean when I click in a button I can hear sound from three speakers which are related to my three sound cards. I have a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.