How do I make sound effects....

I recently asked, how do I add sound referring to mp3's and I got a good answer by adding windows media player but now I have new problem. I want to make sound effects for commands, such as if I place an options button on my form, I want this to make a sound when pushed. This may be basic to some of yall guru's but I can't figure it out. Please help.... thanx By the way, I've been asking a lot of questions here with less answers from my end I would like to thank all the people who have responded and helped me.

Comments

  • [b][red]This message was edited by Fallen at 2002-10-18 5:1:30[/red][/b][hr]
    : I recently asked, how do I add sound referring to mp3's and I got a good answer by adding windows media player but now I have new problem. I want to make sound effects for commands, such as if I place an options button on my form, I want this to make a sound when pushed. This may be basic to some of yall guru's but I can't figure it out. Please help.... thanx By the way, I've been asking a lot of questions here with less answers from my end I would like to thank all the people who have responded and helped me.
    :

    Your best bet would be to use DirectX - DirectMusic. For this you are going to need the DirectX SDK which you should be able to get from either a decent site, or free on a cd with some book that deals with DirectX. I`m currently writting a small dll that will hopefully handle the DirectX stuff without needing to know how it works, kinda like a dll for a dll ;-) If you want to email me or something reguarding this feel free. ([email protected])

    Hope This Helps :)


  • : [b][red]This message was edited by Fallen at 2002-10-18 5:1:30[/red][/b][hr]
    : : I recently asked, how do I add sound referring to mp3's and I got a good answer by adding windows media player but now I have new problem. I want to make sound effects for commands, such as if I place an options button on my form, I want this to make a sound when pushed. This may be basic to some of yall guru's but I can't figure it out. Please help.... thanx By the way, I've been asking a lot of questions here with less answers from my end I would like to thank all the people who have responded and helped me.
    : :
    :
    : Your best bet would be to use DirectX - DirectMusic. For this you are going to need the DirectX SDK which you should be able to get from either a decent site, or free on a cd with some book that deals with DirectX. I`m currently writting a small dll that will hopefully handle the DirectX stuff without needing to know how it works, kinda like a dll for a dll ;-) If you want to email me or something reguarding this feel free. ([email protected])
    :
    : Hope This Helps :)
    :
    :
    :

    Another way for something as simple as you are talking about, is the MMControl. Place it on your formm and make all buttons invisible and the border mciNone. Use code like (adjusted to your needs):

    Option Explicit
    Private strAudioFile As String

    Private Sub Form_Unload(Cancel As Integer)
    MMControl1.Command = "Close"
    End Sub

    Private Sub Option1_Click()
    strAudioFile = "c:vsprojectssystemsoundfxs1.wav" 'Alien
    PlayAudio
    End Sub

    Private Sub Option2_Click()
    strAudioFile = "c:vsprojectssystemsoundfxs2.wav" 'Drum
    PlayAudio
    End Sub

    Private Sub Option3_Click()
    strAudioFile = "c:vsprojectssystemsoundfxs3.wav" 'Drops
    PlayAudio
    End Sub

    Private Sub Option4_Click()
    strAudioFile = "c:vsprojectssystemsoundfxs4.wav" 'Tap
    PlayAudio
    End Sub

    Public Sub PlayAudio()
    'Play the audio file in strAudio
    ' Close the MCI WaveAudio device.
    MMControl1.Command = "Close"

    ' Set properties needed by MCI to open.
    MMControl1.Notify = False
    MMControl1.Wait = True
    MMControl1.Shareable = False
    MMControl1.DeviceType = "WaveAudio"
    MMControl1.FileName = strAudioFile

    ' Open the MCI WaveAudio device.
    MMControl1.Command = "Open"

    ' Play the audio
    MMControl1.Command = "Play"
    End Sub 'end PlayAudio()
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories