Results 1 to 6 of 6

Thread: Stupid Q but needing answer! Sound

  1. #1

    Thread Starter
    Hyperactive Member ..:RUDI:..'s Avatar
    Join Date
    Aug 2005
    Location
    Yorkshire, England! c0d: Da Vinci
    Posts
    344

    Stupid Q but needing answer! Sound

    Hi,

    I would like to play a *.wav file and was wondering what the most simple way to do it was

    Thanks in advance,
    Rudi



    My Personal Home | MageBB Home | Elders Online
    Yes, Noteme is my father.

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Stupid Q but needing answer! Sound

    Quote Originally Posted by ..:RUDI:..
    Hi,

    I would like to play a *.wav file and was wondering what the most simple way to do it was

    Thanks in advance,
    Rudi
    The allapi guide (from http://www.allapi.net) has some demo code. This is a transcription:
    VB 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. Private Sub Form_Load()
    16.     'KPD-Team 2000
    17.     'URL: [url]http://www.allapi.net/[/url]
    18.     'E-Mail: [email][email protected][/email]
    19.     PlaySound "C:\WINDOWS\MEDIA\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
    20. End Sub
    Last edited by krtxmrtz; Aug 3rd, 2005 at 05:36 AM.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    Hyperactive Member ..:RUDI:..'s Avatar
    Join Date
    Aug 2005
    Location
    Yorkshire, England! c0d: Da Vinci
    Posts
    344

    Re: Stupid Q but needing answer! Sound

    Thanks



    My Personal Home | MageBB Home | Elders Online
    Yes, Noteme is my father.

  4. #4
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Stupid Q but needing answer! Sound

    Quote Originally Posted by ..:RUDI:..
    Thanks
    Did it work? I have no sound card in the office computer and couldn't try it out.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  5. #5

    Thread Starter
    Hyperactive Member ..:RUDI:..'s Avatar
    Join Date
    Aug 2005
    Location
    Yorkshire, England! c0d: Da Vinci
    Posts
    344

    Re: Stupid Q but needing answer! Sound

    yes it works, but could you tell me were you found that (The actual page link) so that I can stop it from repeating?



    My Personal Home | MageBB Home | Elders Online
    Yes, Noteme is my father.

  6. #6
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Stupid Q but needing answer! Sound

    Quote Originally Posted by ..:RUDI:..
    yes it works, but could you tell me were you found that (The actual page link) so that I can stop it from repeating?
    I see the link is not working because a right bracket slipped into the URL tag. You can download the guide directly clicking on http://users.chello.be/cr27630/3.7/agsetup.exe
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width