Results 1 to 11 of 11

Thread: Demo Program I did for a radio engineer

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2025
    Posts
    7

    Demo Program I did for a radio engineer

    I was contacted by a local radio station about developing an application to assist in creating their work scheduling sheets,

    It seems that Microsoft screwed them all up. The previous versions of media player showed the duration of a song. This new one does not do that. This made it difficult as now they had to look up the data from other sources.

    What is presented here is a demo to show I could do what they wanted.

    It was also a chance for me to dig deeper into the new Windows Media Player. It is much clearer how it sets up and reports the open and play status as they occur.

    Jack

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2025
    Posts
    7

    Re: Demo Program I did for a radio engineer

    Looks like the attachment didn;t go through. Don't have a clue as to why.

  3. #3
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,357

    Re: Demo Program I did for a radio engineer

    Valid file extensions: 7z asa asmx asp aspx bas bmp bz2 c cls cpp cs ctl doc docx frm frx gif gz h hpp jpe jpeg jpg pdf php png psd rar res txt vb xlt xml zip
    What type of file is your extension?

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2025
    Posts
    7

    Re: Demo Program I did for a radio engineer

    Quote Originally Posted by Steve R Jones View Post
    What type of file is your extension?
    It was a Zip file. It looked like it was sent, I never got any kind of error message.

    I have no idea why it didn.t go.

  5. #5
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,269

    Re: Demo Program I did for a radio engineer

    Quote Originally Posted by John Rizzo View Post
    It was a Zip file. It looked like it was sent, I never got any kind of error message.

    I have no idea why it didn.t go.
    Max-Size exceeded? Binaries inside?

    as to your initial thing (Duration of mp3 for Radio Station):
    https://stackoverflow.com/questions/...-ffmpeg-output

    I would probably throw everything at ffprobe outputting it to a CSV
    No need for any fancy program
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  6. #6
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    3,560

    Re: Demo Program I did for a radio engineer

    With regard to the duration. There are calculations you can do to determine the length of the audio dependent upon audio type. You'd have to look up what other people have done in this regard but it ought to be possible to extrapolate the duration from the various types by searching online, you can then convert that to VB6. It relates to filesize and and the bitrate. I have done it myself for MP3/WAV types I think, if I can find the code I will dig it out and post it here. Don't hold your breath.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,667

    Re: Demo Program I did for a radio engineer

    Windows natively supports duration for mp3 and wav since Windows 7 and many other audio types in 10. Just ask Windows:

    [VB6, Vista+] A compact function to retrieve any property by name, locally formatted

    Duration = GetPropertyDisplayString("C:\path\to\file.mp3", "System.Media.Duration")

    Returns it already formatted in hh:mm:ss

  8. #8
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,269

    Re: Demo Program I did for a radio engineer

    Quote Originally Posted by fafalone View Post
    Windows natively supports duration for mp3 and wav since Windows 7 and many other audio types in 10. Just ask Windows:

    [VB6, Vista+] A compact function to retrieve any property by name, locally formatted

    Duration = GetPropertyDisplayString("C:\path\to\file.mp3", "System.Media.Duration")

    Returns it already formatted in hh:mm:ss
    Very nice, faf.
    Kudos.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2025
    Posts
    7

    Re: Demo Program I did for a radio engineer

    Quote Originally Posted by fafalone View Post
    Windows natively supports duration for mp3 and wav since Windows 7 and many other audio types in 10. Just ask Windows:

    [VB6, Vista+] A compact function to retrieve any property by name, locally formatted

    Duration = GetPropertyDisplayString("C:\path\to\file.mp3", "System.Media.Duration")

    Returns it already formatted in hh:mm:ss
    I was aware of that function, but from what I understand it puts quite a burden on the cpu and should only be use minimally.
    I don't know if that is true or not, but it was trivial to grab and then computation was easy; divide by 60 then mod by 60. don't think there are many songs or commercials on the radio that exceed that.

    Jack

  10. #10
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,667

    Re: Demo Program I did for a radio engineer

    It's a fairly heavyweight option yes; but I'm not sure how much time you can really save when in any case you'd still have to open the file and read it, since that's the slowest step; and how many files it would take reading at once for that difference to matter from a practical standpoint.

    I'd bet the i/o is the bottleneck and unless Windows is reading the entire file first and another method could get it from the headers, there's not going to be a significant difference until files at once is into the 5 digits.

    (The method from my post is also what Windows uses when you open a folder of MP3s in Explorer and the Duration column is used; so if that's not too slow, my code won't be either. Making the IPropertyDescription module level that's only done once would improve performance too.).

  11. #11
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,269

    Re: Demo Program I did for a radio engineer

    Quote Originally Posted by fafalone View Post
    It's a fairly heavyweight option yes; but I'm not sure how much time you can really save when in any case you'd still have to open the file and read it, since that's the slowest step; and how many files it would take reading at once for that difference to matter from a practical standpoint.

    I'd bet the i/o is the bottleneck and unless Windows is reading the entire file first and another method could get it from the headers, there's not going to be a significant difference until files at once is into the 5 digits.

    (The method from my post is also what Windows uses when you open a folder of MP3s in Explorer and the Duration column is used; so if that's not too slow, my code won't be either. Making the IPropertyDescription module level that's only done once would improve performance too.).
    I remember doing a proof-of-concept in FreePascal with the ffmpeg-libs some years ago.
    IIRC, you could read out the Duration of any multimedia-file (Audio, Video) not from Metadata, but calculated on the fly by ffmpeg, involving frames per second, size of each frame (bitrate?), count of frames, and what not.
    Don't remember exactly.

    Though i do remember the result was near instantenous
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width