There are numerous VBA samples for reading the duration of an audio file from the stored file properties, but I've not seen of a method to determine the duration of a file when the duration has not been lodged with the file in the first place. (see screen snapshot below)
Size-in-bytes is a rough guide, but MP3 files vary in construction, I gather: method of compression, also I assume that there is a fixed overhead.
I have been using, as a rough guide, a factor of 7000 bytes per millisecond (I divide the file size in bytes by 7 and then SLEEP the program for that many milliseconds).
Hans has previously pointed to John Walkenbach's DisplayMP3Info procedure, which works fine ( ) except that it cannot read the duration from the file information if the information has not previously been stored there.
I need a reasonably good way to partition a set of files into groups that will constitute about 80 minutes playing time; I will MOVE each group from a source folder into individual BURN folders prior to using CDBurnerXP to create CDs that are chock-full of music.
DETERMINE the duration of an MP3 audio file
-
- PlutoniumLounger
- Posts: 15640
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
DETERMINE the duration of an MP3 audio file
You do not have the required permissions to view the files attached to this post.
Last edited by ChrisGreaves on 25 Nov 2013, 01:17, edited 1 time in total.
There's nothing heavier than an empty water bottle
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DETERMINE the duration of an MP3 audio file
John Walkenbach has a newer version of that workbook - see MP3 File Lister. It works OK for me on Windows 7.
Best wishes,
Hans
Hans
-
- PlutoniumLounger
- Posts: 15640
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: DETERMINE the duration of an MP3 audio file
Thanks Hans, I'll take a look.HansV wrote:John Walkenbach has a newer version of that workbook - see MP3 File Lister. It works OK for me on Windows 7.
(Minutes later: (see image below))
In the meantime I RTM and discovered that CDBurnerXP will burn to multiple CDs, "Disk Spanning" they call it.
http://www.howtogeek.com/76264/how-to-burn-data-across-multiple-dvd-or-cd-discs/
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: DETERMINE the duration of an MP3 audio file
So strange to see the "B:\" drive listing...
Don't tell me your music is still being stored on those old 3.5" floppies???
Don't tell me your music is still being stored on those old 3.5" floppies???
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15640
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: DETERMINE the duration of an MP3 audio file
Anything for you, Rudi.Rudi wrote:So strange to see the "B:\" drive listing... Don't tell me your music is still being stored on those old 3.5" floppies???
OK: "My music is not still being stored on those old 3.5 inch floppies" (although you did ask me NOT to tell you that they WERE ...).
No. The B-drive on my computer is a SUBST drive, points to a folder on my T drive.
Code: Select all
::
:: Make the daily blotter folder as drive "B"lotter
::
call T:\BatLap\setdate
call T:\BatLap\settime
T:
CD T:\Blotter\
if exist %yr%%mt%%dy% GoTo NotFirstBoot
echo First boot
MD %yr%%mt%%dy%
subst B: T:\Blotter\%Daily%
%pause%
call T:\BatLap\Lap_FirstBoot.bat
%pause%
:NotFirstBoot
subst B: T:\Blotter\%Daily%
%pause%
"Blotter" because I am (ahem!) old enough to remember the cleaning ladies who removed the top sheet of blotting paper from the holder on the executive's desk. The top sheet carried yesterday's doodles & scribblings, and important phone numbers before they were copied into the back of the executive's (paper) diary.
T: is, of course, the drive letter of the TrueCrypt drive once I've entered in the appropriate password.
Code: Select all
::
:: Mount the encrypted drive
::
if not exist T: "C:\Program Files\TrueCrypt\TrueCrypt.exe" /q /lT /v\Device\Harddisk0\Partition3
Which are themselves backed up by one of their own!
Code: Select all
title %0 - robocopy t:\ y:\LAP291 /s /r:0 /w:0
:: Backing up the current data to the old backup.
set pause=
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /q /lY /v\Device\Harddisk2\Partition1
%pause%
if exist Y:\nul goto 20Backup
echo I could not mount the backup drive
pause
goto 99exit
:20Backup
robocopy t:\ y:\LAP291 /s /r:0 /w:0
%pause%
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /dismount Y /force /q
%pause%
:99exit
There's nothing heavier than an empty water bottle
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: DETERMINE the duration of an MP3 audio file
Wow...that is a lengthy (and detailed) reply Chris.
I feel quite guilty replying with a simple .... OK.
I feel quite guilty replying with a simple .... OK.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlutoniumLounger
- Posts: 15640
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: DETERMINE the duration of an MP3 audio file
To B: or not to B:, that is the (driving) question ...Rudi wrote:Wow...that is a lengthy (and detailed) reply Chris.
I feel quite guilty replying with a simple .... OK.
Whether 'tis nobler in the RamDisk [ed: Thanks Chris; we'll let you know ...]
There's nothing heavier than an empty water bottle