Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 9th, 2005, 12:54 AM
hithere's Avatar
hithere hithere is offline
Learner
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: India
Posts: 450 hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 12 h 13 m 21 sec
Reputation Power: 18
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.

Reply With Quote
  #2  
Old August 9th, 2005, 05:31 AM
hithere's Avatar
hithere hithere is offline
Learner
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: India
Posts: 450 hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 12 h 13 m 21 sec
Reputation Power: 18
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:
Originally Posted by hithere
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.

Reply With Quote
  #3  
Old August 12th, 2005, 05:49 PM
snipered's Avatar
snipered snipered is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2005
Location: Birmingham, England
Posts: 909 snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 20 h 48 m 50 sec
Reputation Power: 11
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.

Reply With Quote
  #4  
Old August 20th, 2005, 05:09 PM
snipered's Avatar
snipered snipered is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2005
Location: Birmingham, England
Posts: 909 snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 20 h 48 m 50 sec
Reputation Power: 11
Hi i'm having trouble uploading the file.

Do you have an email a/c i can send it to you on?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > how to play audio files in VB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT