borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to create a music player program)Next Topic (play stops when selecting another song) New Topic New Poll Post Reply
AndreaVB Forum : Multimedia : How do you
Poster Message
MarcD
Level: Guest


icon How do you

How do you use VB.Net or VB6 which ever you know, to play any and all music types without opening a program to play for you.

I know this is a big question, but I ask that you help me in any way possiable.

MP3, WAV, MIDI, TL and WMV if possiable.

24-08-2004 at 09:55 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: How do you

Don't know about all music types, but have you tried using the "Windows Media Player" control?



Steve

25-08-2004 at 12:03 PM
View Profile Send Email to User Show All Posts | Quote Reply
MarcD
Level: Guest

icon Re: How do you

Though it is somthing I need true. But I can't figure out how to make it play a spicific file. Can any one point me to a good tutorial or show me how to make it play from path ect.

26-08-2004 at 04:56 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: How do you

Have a look at the attached project.


Steve  

____________________________
Attached:
Project1.zip 6 KB (Downloads: 17)

26-08-2004 at 06:40 PM
View Profile Send Email to User Show All Posts | Quote Reply
MarcD
Level: Guest

icon Re: How do you

Ok thankyou. Now I just have (hopfully) one more question:

How would I go about making it play a file, but it it'self being a .dll or OCX? I need it for a game maker I am making.

26-08-2004 at 07:13 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: How do you

This one uses the reference not the control.

Here's the calling program code.
Private x As MySounds.clsMedia

Private Sub Command1_Click()

    x.Play "c:\sounds\sound.mp3"

End Sub

Private Sub Form_Load()

    Set x = New MySounds.clsMedia

End Sub

Private Sub Form_Unload(Cancel As Integer)

    Set x = Nothing

End Sub


and heres the class I created, you create your own dll from that.

' include reference to "Windows Media Player"
' not the control

Private WithEvents p As MediaPlayer.MediaPlayer

Public Sub Play(filename As String)

    p.Open filename

End Sub

Public Sub Finish()

    p.Stop

End Sub


Private Sub Class_Initialize()

    Set p = New MediaPlayer.MediaPlayer
    
End Sub

Private Sub Class_Terminate()

    p.Stop
    Set p = Nothing
    
End Sub


Steve



26-08-2004 at 09:45 PM
View Profile Send Email to User Show All Posts | Quote Reply
MarcD
Level: Guest

icon Re: How do you

Ok, made my DLL. Thanks. If I have any more problems I will PM you or post on this thread.

26-08-2004 at 11:02 PM
| Quote Reply
MarcD
Level: Guest

icon Re: How do you

Ok, now when I try using it with VB.Net It tells me there is no set entry point. Did I not specify one? Or do I have to specify one?

01-09-2004 at 09:07 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: How do you

Have to pass on the vb.net bit.

02-09-2004 at 07:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: How do you

Well, could be u have declared ur dll unappropriate. Send ur code so we can look at it

____________________________
If you find the answer helpful, please mark this topic as solved.

02-09-2004 at 09:43 PM
View Profile Send Email to User Show All Posts | Quote Reply
MarcD
Level: Guest

icon Re: How do you

It's the one steve_w posted .

05-09-2004 at 01:49 AM
| Quote Reply
AndreaVB Forum : Multimedia : How do you
Previous Topic (How to create a music player program)Next Topic (play stops when selecting another song) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder