Embeded audio

spinkung

Registered User.
Local time
Today, 08:36
Joined
Dec 4, 2006
Messages
267
Hi all,

Just a quickie....

is there a way to embed a music player in an access form (VLC for instance) and select songs from it?

can someone point me in the direction of references i might need, code etc.

Many thanks.
 
not sure what you mean by "VLC". There are media player "controls" that you can drop onto a form, and there are multiple methods of playing songs - how you want those integrated into your Access application will determine the best way to do this. Also, we would need to know why file types you anticipate using.

Can you elaborate on what usage you are creating this for?

It might be as simple as going into the form design and going to the Control Toolbox and selecting the Windows Media Player control and dropping it onto the form. From there, I haven't done much before now, but you could use the auto-complete feature in VBA and reference the control to see what properties and methods are available.
 
Hi, thanks fo the reply.

I am creating a DB that i want to have a form with a media player that i can load MP3's into and play. I have no idea what objects to use or how to use them and cant find much on it on the net?

VLC is just a media player like Windows Media Player.

Thanks.
 
While you are in form design mode (open an existing form in Edit/Design mode, or create a new form), goto the View menu then Toolbars, then Toolbox (make sure there is not already a check mark next to Toolbox, if so, then skip this step, you already have the right toolbar opened).

You should see a toolbar that starts out with a standard Windows arrow pointer, then next to that is a wand with stars (it's the "Wizard" button and it is 2 state, meaning it is going to either be depressed or not depressed and remain in that state until it is manually changed - if you are new to MS Access, I would suggest leaving it depressed).

The next group of icons on the toolbar are 2 A's (one upper and 1 lower case), then an AB| These are for labels and textbox controls resectively. There should be a series of more icons that represent other "controls" (in order that they appear by default); an option group, a toggle button, an option button, a checkbox, a dropdown list, a listbox and a standard button. After these are several more, then there is an icon that has a hammer and a wrench, clicking on this will give you more options that you could probably count (I don't know because I've never tried ;-) The very last control in this list is the Windows Media Player control. Click on that and then click somewhere on your form, it will place the "control" onto your form, and you're about as far as I've gone with doing this.

Okay, so I just droped the control onto a new form to play with really quick before I have to send this off and get some work done. What I ended up doing after dropping the control onto my form is go into the Forms On_Open event and wrote the following code

Code:
Private Sub Form_Open(Cancel As Integer)
Dim myPlayer As WindowsMediaPlayer

Set myPlayer = New WindowsMediaPlayer

myPlayer.openPlayer

End Sub

When I did this it produced an error at Set myPlayer = new windowsmediaplayer, so I obviously know not what I'm doing.

I did a search for "windows media player" vba control (using the quotation marks) and found a site that is using Excel for this instead of Access - but I believe Access VBA is a lot easier to pick up than Excel and Access itself is more powerful (for those who know how to use it rather than just those who know Excel as their only tool of choice), so I would recommend using the following website as a guide but doing this in Access.

http://www.protosw.com/docs/tutorials/the-vba-module-creating-user-forms

If you run into some problems keep posting here, and I will try helping you through it, since I have used other type of "controls" like Windows Media Player, except not this one specifically (I once designed an application around a similar control that created and manipulated CAD drawing files, so it will be very similar in nature to what I did for that).
 
Exellent, thanks for your reply its set me off on the right foot. I now have a player thats playing files i select from a url.

I'll post the code tomorrow and keep you updated on any problems i come across.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom