|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
how to play audio files in VB
Hi friends,
I want to play a wav file when the user login into the system, when he clicks on button and when he logs out of the system. Can someone give me sample code for this Any help will be appreciated. Thanx in advance. |
|
#2
|
||||
|
||||
|
Hi friends,
THis can be done using API functions Public Const SND_APPLICATION = &H80 ' look for application specific association Public Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry Public Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier Public Const SND_ASYNC = &H1 ' play asynchronously Public Const SND_FILENAME = &H20000 ' name is a file name Public Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound Public Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file Public Const SND_NODEFAULT = &H2 ' silence not default, if sound not found Public Const SND_NOSTOP = &H10 ' don't stop any currently playing sound Public Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy Public Const SND_PURGE = &H40 ' purge non-static events for task Public Const SND_RESOURCE = &H40004 ' name is a resource name or atom Public Const SND_SYNC = &H0 ' play synchronously (default) Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long wherever u want the sound to play use PlaySound "C:\winnt\media\chimes.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC Quote:
|
|
#3
|
||||
|
||||
|
Yep use msci commands as said by hithere.
I did a project where i created a media player where you could open up mp3 files, avi, mpeg and play them, stop them etc. It was a simple project. I will find it and post it on here for you. You can then analyse the code, and see how it works. I used no activex components. |
|
#4
|
||||
|
||||
|
Hi i'm having trouble uploading the file.
Do you have an email a/c i can send it to you on? |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > how to play audio files in VB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|