how to play wav file

Thread Solved
Reply

Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

how to play wav file

 
0
  #1
Apr 4th, 2008
hi...
i want to play wav file on my form.
ex : media file on windows -> C:\WINDOWS\MEDIA\TADA.WAV
how can i do this??
please help me

thanks. best regards
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: how to play wav file

 
0
  #2
Apr 4th, 2008
but i don't wanna to use media player or other component, cause it make me to add new component.

please help me Gurus...
Last edited by november_pooh; Apr 4th, 2008 at 2:14 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

Re: how to play wav file

 
1
  #3
Apr 4th, 2008
if u didn't want to use any component, u can use api file to play it.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: how to play wav file

 
0
  #4
Apr 4th, 2008
please give an example...i don't know how to use api...
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: how to play wav file

 
0
  #5
Apr 4th, 2008
anyone please....
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: how to play wav file

 
5
  #6
Apr 4th, 2008
try this following code :
  1. Private Const SND_APPLICATION = &H80 ' look for application specific association
  2. Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
  3. Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
  4. Private Const SND_ASYNC = &H1 ' play asynchronously
  5. Private Const SND_FILENAME = &H20000 ' name is a file name
  6. Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
  7. Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
  8. Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
  9. Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
  10. Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
  11. Private Const SND_PURGE = &H40 ' purge non-static events for task
  12. Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
  13. Private Const SND_SYNC = &H0 ' play synchronously (default)
  14. Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
  15.  
  16. Private Sub Form_Load()
  17. PlaySound "C:\WINDOWS\MEDIA\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
  18.  
  19. End Sub
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: how to play wav file

 
0
  #7
Apr 4th, 2008
thanks sawamura for the direction..
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: how to play wav file

 
0
  #8
Apr 4th, 2008
thanks for the example jx_man.
you're very helping, it was i looking for.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,640
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: how to play wav file

 
1
  #9
Apr 4th, 2008
you're welcome friend.
Happy coding
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC