get details of song being played (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 17:29
Joined
Sep 21, 2011
Messages
5,169
OK, let me tell you what I think your code is doing.
You are already getting the duration, as you pause the code for that period, before selecting and playing another file.?

You have not told me how you file structure is setup, despite my asking a good few posts back.?

To me it looks like all the files are in one folder.?
It also looks like you have no other types of files in there BUT audio files.?
The code is not indented, so that makes it harder to read.

Am I correct in these statements?

If you need help with this other project, post the code for that project, better still upload the file, as I had to create textboxes etc to work through the code you posted.
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
What, what should be.?

I would walk through the code line by line with F8 and look and see what it does. Inspect the variables by either hovering over them or ? variablename in the Immediate window.

You can set breakpoints in the left column (red dot) and the code will stop there.

Do yourself a favour and get a book on Access. It will save you a load of time and effort.

Not being rude, so ignore the titles. There is even a pdf to start with.?

https://www.google.com/search?q=dummies+guide+to+access+2010&oq=dummies+guide+to+access&aqs=chrome.2.69i57j0l5.12501j0j7&sourceid=chrome&ie=UTF-8
I've tried Access, could not get on with it and that was when I may have needed it for a job I was applying for. Now I dont need it, there is no way I could learn it I'm not that clever

macafee2
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:29
Joined
Sep 21, 2011
Messages
5,169
OK, I posted for Access, but what it and Excel have in common is VBA, and that is what you are trying to code in.
Look for a book on Excel VBA then.

Post your new project and I will try and assist as to how I would approach it.
I will not write it for you, but point you in what I think is the right direction.

Others will then be able to help as well.

Alternatively try and understand your first project especially the FileInfo sub and take it from there. You will find as you do these projects that some functions will become common to all.
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
OK, let me tell you what I think your code is doing.
You are already getting the duration, as you pause the code for that period, before selecting and playing another file.?

You have not told me how you file structure is setup, despite my asking a good few posts back.?

To me it looks like all the files are in one folder.?
It also looks like you have no other types of files in there BUT audio files.?
The code is not indented, so that makes it harder to read.

Am I correct in these statements?

If you need help with this other project, post the code for that project, better still upload the file, as I had to create textboxes etc to work through the code you posted.

sorry I mised that.
The songs are in a directory in My Documents and has artists name followed by song title and file extension then date file created and duration . Adele - All out of love.mp3 12/11/16 13.42 00.03:50

yes you are correct all songs in one directory and no other files in that directory.
I apologize for not answering before, i really did miss that.

I have no code for the other project as I do not know how to get the title of the song that is being played or the duration of the song being played

smiler44
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:29
Joined
Sep 21, 2011
Messages
5,169
I have no code for the other project as I do not know how to get the title of the song that is being played or the duration of the song being played

smiler44
Neither do I TBH. I would be looking at storing the duration as the files are being selected and summing the duration.

You are already using the duration of the file you are going to play to pause the selection for the next file to play, or so it seems to me.?

You could even write them to the sheet to show a sort of playlist. Excel itself could even add the duration and you would then check that cell.?

However I would take it in small steps and make it fancier after it is all working to your satisfaction.
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
OK, I posted for Access, but what it and Excel have in common is VBA, and that is what you are trying to code in.
Look for a book on Excel VBA then.

Post your new project and I will try and assist as to how I would approach it.
I will not write it for you, but point you in what I think is the right direction.

Others will then be able to help as well.

Alternatively try and understand your first project especially the FileInfo sub and take it from there. You will find as you do these projects that some functions will become common to all.
:)
all i want help with is getting the duration of the song being played or the name of the song being played. I think once I have this info I can proceed

smiler44
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
You have it the wrong way round.
You tell WMP what to play, so at that point YOU know what the filename is.
i do as in me but the macro doesn't and cant hard code the song title as next time i may select different songs .

smiler44
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
Neither do I TBH. I would be looking at storing the duration as the files are being selected and summing the duration.

You are already using the duration of the file you are going to play to pause the selection for the next file to play, or so it seems to me.?

You could even write them to the sheet to show a sort of playlist. Excel itself could even add the duration and you would then check that cell.?

However I would take it in small steps and make it fancier after it is all working to your satisfaction.
no no no :) you are thinking of an existing macro that selects a song, i need a new one and this macro will not select any songs, just work out the duration of the song being played or give me the song title of the song being played.

We need to ignore any existing macro and start a fresh :)

smiler44
 

June7

AWF VIP
Local time
Today, 08:29
Joined
Mar 9, 2014
Messages
2,793
If you manually open WMP in Windows and select playlist/library/album/artist and then click play, I don't see how you can get file info. Somewhere you must give instruction on what song(s) to send to player.
 
Last edited:

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
If you manually open WMP in Windows and select playlist/library/album/artist and then click play, I don't see how you can get file info. Somewhere you must give instruction on what song(s) to send to player.
for this project, i dont press the shuffle button, once i have manually selected the songs i press play.
i select windows explorer/documents/directory holding songs/ the songs i want to play/play

smiler44
 

June7

AWF VIP
Local time
Today, 08:29
Joined
Mar 9, 2014
Messages
2,793
That link is about the WindowsMediaPlayer ActiveX control that would be embedded on worksheet or Access form. I don't think it pertains to WMP app opened independently. I tried code to address the app, like with Outlook or Excel, and it fails.

Doesn't matter if you select files in Windows Explorer or in the WMP, there is no code managing this process.
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:29
Joined
Sep 21, 2011
Messages
5,169
June7,
That shows you how far I am out of my depth. :)

That link is about the WindowsMediaPlayer ActiveX control that would be embedded on worksheet or Access form. I don't think it pertains to WMP app opened independently. I tried code to address the app, like with Outlook or Excel, and it fails.

Doesn't matter if you select files in Windows Explorer or in the WMP, there is no code managing this process.
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:29
Joined
Sep 21, 2011
Messages
5,169
Not being condescending, honest, but I speak it as i see it.
What you have achieved with your skill level is impressive.

However you have to know your limits.? The fact that you have had no response other than what has passed, would infer to me that this is new to even the experts?

You already have a method of passing filenames to WMP to play, at the moment it is random, but the same method could be used to play selected files.?

Alternatively June7 states that link I posted works with a WMP activeX control.?
That appears to allow you to add to a playlist, but at the same time the logic is you select the file, and when you do so, you already know how to get the duration.?

So do not stay hard wired on one particular way, but explore other methods.?

Good luck with it regardless.
 

smiler44

Registered User.
Local time
Today, 17:29
Joined
Jul 15, 2008
Messages
637
Not being condescending, honest, but I speak it as i see it.
What you have achieved with your skill level is impressive.

However you have to know your limits.? The fact that you have had no response other than what has passed, would infer to me that this is new to even the experts?

You already have a method of passing filenames to WMP to play, at the moment it is random, but the same method could be used to play selected files.?

Alternatively June7 states that link I posted works with a WMP activeX control.?
That appears to allow you to add to a playlist, but at the same time the logic is you select the file, and when you do so, you already know how to get the duration.?

So do not stay hard wired on one particular way, but explore other methods.?

Good luck with it regardless.

thank you I'm trying using a media player active x to see where this gets me. I'll have to learn how to use it but time is on my side

smiler44
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom