Results 1 to 12 of 12

Thread: Playing .ogg, .mp3 and .wav files.

  1. #1

    Thread Starter
    Member MadLadDesigns's Avatar
    Join Date
    Feb 2025
    Location
    UK
    Posts
    34

    Playing .ogg, .mp3 and .wav files.

    I'm creating an app which has a section in which the user can load and play up to 8 overlapping audio files. At the moment I'm using the Windows Media Player .dll and everything works perfectly.

    Name:  Audio Tab.jpg
Views: 149
Size:  37.5 KB

    Unfortunately, this can't play .ogg files (and I think the WMP dll is depreciated?)

    How can I get the same functionality as the WMP but be able to play all 3 audio formats?

    Any help would be greatly appreciated.
    Andy
    [MadLad Designs]

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,747

    Re: Playing .ogg, .mp3 and .wav files.

    Probably not supported but I haven't every played an ogg file.
    Check:
    https://stackoverflow.com/questions/...ogg-mp4-in-net
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

  4. #4

    Thread Starter
    Member MadLadDesigns's Avatar
    Join Date
    Feb 2025
    Location
    UK
    Posts
    34

    Re: Playing .ogg, .mp3 and .wav files.

    Thank you. I'll take a look at these later when I get the chance.
    Andy
    [MadLad Designs]

  5. #5
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,973

    Re: Playing .ogg, .mp3 and .wav files.

    theTrick has some very usable code for handling and playing MP3 files.

    WMP is deprecated but should work for some time yet, however, it is developing issues playing some existing formats that used to work well on XP/Win 7 &c, now have problems on Win 10/11. Time to dump it. Sad but true.
    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.

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,747

    Re: Playing .ogg, .mp3 and .wav files.

    I have a complete sample on the codebank taking advantage of the windows API but I won;t post it because it may be obsolete (i think it's over 8 years sample).
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  7. #7
    Hyperactive Member -Franky-'s Avatar
    Join Date
    Dec 2022
    Location
    Bremen Germany
    Posts
    391

    Re: Playing .ogg, .mp3 and .wav files.

    Starting with Windows 10, I would use Media Foundation. Especially with the IMFMediaEngine and IMFMediaEngineEx interfaces, you can quickly create a media player. However, Media Foundation cannot play OGG files. There are "Web Media Extensions" in the Microsoft Store that can also decode OGG. I haven't tested whether Media Foundation can play OGG with the extension installed. I also wouldn't use mixed media files (WAV, MP3, OGG, etc.) in one program. The easiest way is to use a media format that is natively supported in Windows, without having to install additional codecs.

  8. #8
    Lively Member
    Join Date
    Mar 2024
    Posts
    99

    Re: Playing .ogg, .mp3 and .wav files.

    I can confirm that the "Web Media Extensions" package in the Microsoft Store does in fact include .OGG/Vorbis playback ability.

    It's a very quick and simply install.

    https://xiph.org/vorbis/ has numerous tools (all simple .exe files to run from a command line) to encode and decode .OGG/Vorbis files. If you don't want to go the binary (MUCH FASTER) they also offer command line tools to add/modify metadata. The section with the metadata is near the beginning, easy to find/decode/encode.

  9. #9

    Thread Starter
    Member MadLadDesigns's Avatar
    Join Date
    Feb 2025
    Location
    UK
    Posts
    34

    Re: Playing .ogg, .mp3 and .wav files.

    duplicate
    Last edited by MadLadDesigns; Mar 25th, 2025 at 04:28 PM. Reason: Duplicate
    Andy
    [MadLad Designs]

  10. #10

    Thread Starter
    Member MadLadDesigns's Avatar
    Join Date
    Feb 2025
    Location
    UK
    Posts
    34

    Re: Playing .ogg, .mp3 and .wav files.

    The app I'm creating is not a music player per-say, it plays audio files for atmosphere. I have many .ogg, .wav & .mp3 files I've bought as Humble Bundles.

    So, it's not possible to play all 3 formats easily?

    Quote Originally Posted by -Franky- View Post
    Starting with Windows 10, I would use Media Foundation. Especially with the IMFMediaEngine and IMFMediaEngineEx interfaces, you can quickly create a media player. However, Media Foundation cannot play OGG files. There are "Web Media Extensions" in the Microsoft Store that can also decode OGG. I haven't tested whether Media Foundation can play OGG with the extension installed. I also wouldn't use mixed media files (WAV, MP3, OGG, etc.) in one program. The easiest way is to use a media format that is natively supported in Windows, without having to install additional codecs.
    Andy
    [MadLad Designs]

  11. #11
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,973

    Re: Playing .ogg, .mp3 and .wav files.

    This isn't really a VB.NET language problem, it is a problem with operating systems and the tools it uses to recognise and play media formats. You are stepping into a world of problems by just dipping your toe into the water.
    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.

  12. #12
    Hyperactive Member -Franky-'s Avatar
    Join Date
    Dec 2022
    Location
    Bremen Germany
    Posts
    391

    Re: Playing .ogg, .mp3 and .wav files.

    Quote Originally Posted by MadLadDesigns View Post
    So, it's not possible to play all 3 formats easily?
    It's possible to play all three audio formats. The prerequisite is that you have the appropriate codecs installed on your PC, or the audio interface you're using (WMP, DirectSound, MediaFoundation, VLC, etc.) already includes suitable codecs. I haven't tried it. If you install the "Web Media Extensions" from the Microsoft Store, WMP might be able to play OGG files. It might also work if you install the codec from xiph.org. -> https://downloads.xiph.org/releases/...7220-win32.exe

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