Results 1 to 3 of 3

Thread: Play a music file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ca
    Posts
    93
    Well I put in a midisequence in my tool box from custiom controls, and I put a song in it in the fourm. It shows
    |the midi icon|
    | my song |
    I have made a menu with a music option, the options in it are
    on
    off
    And I wanted to make it so when you click on on the midi will turn on and when you click off it'll turn off. How can I do that. The name of the midi sequence in the form is midi1.
    Timbudtwo
    I have no life, only one with computers.

    VB 6.0 Enterprise Edition
    [hr]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    In the toolbar buttonclick event put a boolean switch to go true when false and vice verse
    Code:
    static switch as boolean
    switch=not switch
    if switch then
    'turn on the midi
    else
    'turn off the midi
    end if
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    You can also use the mciSendString API to play MIDI's, which might be better in your case because you just want ON and OFF features.

    Code For module.
    Code:
    Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    To Play the MIDI.
    Code:
    mciSendString "open C:\MyMidi.mid", 0, 0, 0
    mciSendString "play background", 0, 0, 0
    To Stop the MIDI
    Code:
    mciSendString "close background", 0, 0, 0

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