Howdy, Stranger!

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

Categories

How do I make sound effects....

ImDaFrEaKImDaFrEaK Member Posts: 29
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

  • FallenFallen Member Posts: 32
    [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. (VB@Fallensworld.co.uk)

    Hope This Helps :)


  • RSlaydenRSlayden Member Posts: 22
    : [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. (VB@Fallensworld.co.uk)
    :
    : 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()
  • Andre YoungAndre Young USAMember Posts: 0

    __ [ http://forcoder.org ] free ebooks and video tutorials about // C++ Python Go Objective-C Java Visual Basic JavaScript C PHP Swift MATLAB Perl PL/SQL Delphi C# Scratch Visual Basic .NET Assembly R Ruby Scala Julia Erlang Logo Dart ABAP Bash Transact-SQL D ML SAS COBOL Fortran FoxPro Crystal F# VBScript Hack Alice Clojure Ada Scheme Apex LabVIEW Kotlin Lua Prolog Awk Rust Lisp // ____________

Sign In or Register to comment.