CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: music

  1. #1
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    music

    What control would I use to play music on my form?
    What would the code look like? What type of music file would I use?


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: music

    Microsoft Mulrimedia Control, for example(look for components do add it to your toolbar), to play .wav and .mdi files...
    For code example, I cannot help right know. Maybe later...
    Cesare Imperiali


    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: music

    Here is an example of code
    Do not forget the code to close mmc control.
    Maybe you can find more information in MSDN

    Private Sub Command1_Click()
    'type of use you're going to do of mmc
    MMControl1.DeviceType = "WaveAudio"
    'the file you want to load
    MMControl1.FileName = "C:\WINDOWS\alarm.WAV"
    'open the file
    MMControl1.Command = "Open"
    'make it work
    MMControl1.Command = "play"
    End Sub

    Private Sub MMControl1_Done(NotifyCode As Integer)
    'event triggered at end
    'close control
    MMControl1.Command = "Close"
    'clear filename
    MMControl1.FileName = ""
    End Sub

    Best regards
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured