Go Back   Access World Forums > Apps and Windows > Excel

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-22-2019, 11:51 PM   #16
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

Probably better to upload the file?

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 12:09 AM   #17
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,957
Thanks: 120
Thanked 3,331 Times in 3,005 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: get details of song being played

I realise you want this for Excel.
However if you run my app in Access, select the folder(s) continuing your songs, you can get all the track details for the entire set of files at once with no code needed. Then export the data to Excel. Job done!
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Spam, spam, spam, spam, spam, spam, spam (Terry Jones - RIP)
isladogs is offline   Reply With Quote
Old 05-23-2019, 12:10 AM   #18
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

What is this meant to be doing?
Code:
''''''''''''''''''''''''''''''''''''''''
   'Sheet1.TextBox2.Value = Range("a3").Text
   Range("a2").Value = Sheet1.TextBox2.Value 'time music played before current song
   Sheet1.TextBox2.Value = Range("a3").Text ' total time music played after current song
ss = Right(b, 2) ' gets far right 2 charectors

mm = Mid(b, 4, 2) 'starting at 4 from left, gets the 4th and 5th charector

b = mm * 60 + ss
          
pause (b) ' how long to wait in seconds before playing next song

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 12:23 AM   #19
smiler44
Newly Registered User
 
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Re: get details of song being played

Quote:
Originally Posted by isladogs View Post
I realise you want this for Excel.
However if you run my app in Access, select the folder(s) continuing your songs, you can get all the track details for the entire set of files at once with no code needed. Then export the data to Excel. Job done!
isladogs, may be i dont quite understand. Once I have the attributes what can I do with them? I dont know (my code does not know) what song is being played and so cannot look the attributes up for that song.


I need to obtain via code the duration of the song currently being played or the title of the song being played so I can look the duration up.

perhaps instead of selecting the songs via windows explorer i should do it via Excel where i could already have obtained the duration...... thats a way to do it but i wont learn much that way

If i go with my original method i would learn more I think..... but then???

smiler44
smiler44 is offline   Reply With Quote
Old 05-23-2019, 12:28 AM   #20
smiler44
Newly Registered User
 
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Re: get details of song being played

Quote:
Originally Posted by Gasman View Post
What is this meant to be doing?
Code:
''''''''''''''''''''''''''''''''''''''''
   'Sheet1.TextBox2.Value = Range("a3").Text
   Range("a2").Value = Sheet1.TextBox2.Value 'time music played before current song
   Sheet1.TextBox2.Value = Range("a3").Text ' total time music played after current song
ss = Right(b, 2) ' gets far right 2 charectors

mm = Mid(b, 4, 2) 'starting at 4 from left, gets the 4th and 5th charector

b = mm * 60 + ss
          
pause (b) ' how long to wait in seconds before playing next song

i think it pauses excel for the duration of the current song being played so it finishes before excel plays the next song.
i can also see how long music has been playing for before and after the current song

smiler44
smiler44 is offline   Reply With Quote
Old 05-23-2019, 12:49 AM   #21
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

Quote:
Originally Posted by Gasman View Post
June7
Would I need a particular reference? I am puzzled as I just copied your code and changed the filename, so keen to find out why it does not work.
Well I tried a new DB and it worked.
Tried it in my test DB and it worked, so even more puzzled.
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 12:58 AM   #22
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

You are already doing that in sub FileInfo with variable b

Not exactly the best naming convention I admit.

Also what reference is required for this ?

objShell As IShellDispatch4

Quote:
Originally Posted by smiler44 View Post
isladogs, may be i dont quite understand. Once I have the attributes what can I do with them? I dont know (my code does not know) what song is being played and so cannot look the attributes up for that song.


I need to obtain via code the duration of the song currently being played or the title of the song being played so I can look the duration up.

perhaps instead of selecting the songs via windows explorer i should do it via Excel where i could already have obtained the duration...... thats a way to do it but i wont learn much that way

If i go with my original method i would learn more I think..... but then???

smiler44

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 01:10 AM   #23
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

What is your structure for your music.?
You call RecursiveDir yet it does not appear to walk through any folders.?
Do you just have a folder with all the music in it.?

My structure is
Music\Artist\Album\Tracks
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 03:52 AM   #24
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

I'm a little intrigued with this project. I remember you starting it a while back.

How do you manage file paths with spaces in them, as my WMP balks at those.?
I've fixed that problem, but was wondering how you coped.?

Also you pass in the name of the file you are going to open into FileInfo sub, so you know the name of the file and the same sub gives you the duration.?
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 06:21 AM   #25
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,957
Thanks: 120
Thanked 3,331 Times in 3,005 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: get details of song being played

Hi smiler
I assumed that you wanted to save the track info to Excel then use Excel as a media player somehow. That's certainly possible in Access. Doing that means the file info is extracted and displayed automatically.
However, as it appears that's not what you want, I'll drop out of this thread.
Good luck
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Spam, spam, spam, spam, spam, spam, spam (Terry Jones - RIP)
isladogs is offline   Reply With Quote
Old 05-23-2019, 08:48 AM   #26
smiler44
Newly Registered User
 
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Re: get details of song being played

Gents I must tell you I'm no expert in coding as you can see. I have never done it for a living but have used and crated macros for work. I've had no training and a lot of stuff even if I use it I dont understand it, mainly because I did not create it. I have found a lot of stuff on the internet and it has either done just what I need or I have managed to manipulate it do do what I want.

The code I posted above is a working project that does just what I want for that project but now i want another project and I'm lost in obtaining what should be very simple information.

smiler44
smiler44 is offline   Reply With Quote
Old 05-23-2019, 09:21 AM   #27
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

Well what you were originally asking for can be found in the FileInfo sub.

However you would need to understand what it does to be able to use it.
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 05-23-2019, 09:36 AM   #28
smiler44
Newly Registered User
 
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Re: get details of song being played

Quote:
Originally Posted by Gasman View Post
Well what you were originally asking for can be found in the FileInfo sub.

However you would need to understand what it does to be able to use it.
Am I right in thinking that the song title is known when the fileinfo function runs? In this new situation, I have not been able to acquire the title.
If you could help me get the title of the song being played by windows media player I'd appreciate it.

smiler44
smiler44 is offline   Reply With Quote
Old 05-23-2019, 09:58 AM   #29
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,623
Thanks: 1
Thanked 630 Times in 623 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: get details of song being played

As suggested, why don't you provide the workbook for analysis?

The FileInfo function requires file name to be passed to it as argument. Yet I don't see the function called. The sub randomlyselectsong has the file name. It sets the variable filetoplay and sends that value to the player. This is where you should put code to get the file duration, just before Shell command opening the file in player. Modify the code I provided. It can be a function with arguments or include the 3 lines of code within your procedure. Only instead of Debug.Print, set a variable.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
June7 is online now   Reply With Quote
Old 05-23-2019, 10:16 AM   #30
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,798
Thanks: 455
Thanked 908 Times in 872 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: get details of song being played

June,
It is called from RecursiveDir sub.?

A lot of the variables are global.

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Song Lyrics NauticalGent The Watercooler 36 10-18-2018 12:10 PM
Song and Band names KenHigg Politics & Current Events 2 12-05-2014 08:51 PM
Add a song to iTunes speakers_86 General 7 02-23-2012 09:03 PM
Well its been a while since I played with Queries so some noob help please. jam Queries 5 06-01-2009 06:23 AM
hymnal and song subform mikevds Forms 2 03-18-2009 09:08 AM




All times are GMT -8. The time now is 09:50 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World