# Sound won't play MP3 on Windows

**URL:** <https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514>\
**Category:** Windows\
**Created:** [27 May 2020 01:16 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514 "2020-05-27T01:16:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [27 May 2020 01:16 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/1 "2020-05-27T01:16:17Z")

</div>

I can’t get MP3 audio to play on Windows using the Sound class. Works fine on macOS. WAV files play fine on Windows, but not MP3. I get no error, the audio just doesn’t play, and .IsPlaying immediately returns False.

Is this supposed to work? I tried it on two PCs (Windows 10 and Windows 7). I searched the Xojo forum and Feedback and didn’t find anything relevant (well, one issue back in 2015 where MP3 playing was broken, but later fixed).

Does MP3 work in the Sound class/object in Windows for anyone else?

Note that I’ve tried this in several Xojo version back to 2017r1.1 with no luck.

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://ifnotnil.com/user_avatar/ifnotnil.com/monkeybreadsoftware/32/451_2.png) [@MonkeybreadSoftware](https://ifnotnil.com/u/MonkeybreadSoftware)\
**Post date:** [27 May 2020 05:53 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/2 "2020-05-27T05:53:29Z")

</div>

Check the [WindowsPlayerMBS](https://monkeybreadsoftware.net/class-windowsplayermbs.shtml) and [MFPMediaPlayerMBS](https://monkeybreadsoftware.net/class-mfpmediaplayermbs.shtml) classes in [MBS Xojo Plugins](https://www.monkeybreadsoftware.de/xojo/).

---

<div class="post-metadata">

**Author:** ![Emile](https://ifnotnil.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@Emile](https://ifnotnil.com/u/Emile)\
**Post date:** [27 May 2020 14:51 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/3 "2020-05-27T14:51:26Z")

</div>

Far away before Real Studio, I realized that my macOS project (with sounds) does not worked on Windows, but I never had then the idea to check a different kind of music file type.

I left the project as it was.

All along the years, big project were starting to be small projects, then hopeless project. ☹

No Great Project to watch here, Stay Home ! 😉

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [27 May 2020 15:25 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/4 "2020-05-27T15:25:53Z")

</div>

WAV is JUST a container format (much like QuickTime)

Places like stack overflow have piles of suggestions like using MCI to play the mp3  
(see [https://stackoverflow.com/questions/2049825/simplest-way-to-play-mp3-from-visual-c](https://stackoverflow.com/questions/2049825/simplest-way-to-play-mp3-from-visual-c))

MS has Core Audio but its all C++ code and API’s so I’m not sure its directly callable from Xojo using declares

The Win32 PlaySound function is pretty simple - but it plays WAV files but WAV is just the container format more than anything

Is this supposed to play arbitrary sounds files ?  
Or only ones built into your app ?

---

<div class="post-metadata">

**Author:** ![Meestor\_X](https://ifnotnil.com/user_avatar/ifnotnil.com/meestor_x/32/567_2.png) [@Meestor\_X](https://ifnotnil.com/u/Meestor_X)\
**Post date:** [27 May 2020 16:13 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/5 "2020-05-27T16:13:30Z")

</div>

> [@jmadren](#):
>
> Does MP3 work in the Sound class/object in Windows for anyone else?

Yup. No problems here, Mac or Windows.

If you find only certain files will play in Windows, you may have a codec issue. If you’d like to attach the file, I can test it for you.

I also have a sample project that uses the Sound object if that’s helpful.

---

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [27 May 2020 16:59 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/6 "2020-05-27T16:59:03Z")

</div>

> [@npalardy](#):
>
> Is this supposed to play arbitrary sounds files ?  
> Or only ones built into your app ?

These are audio recordings of verbal instructions. There are dozens of them. I’m storing them in a SQLite db (along with images) for easy organization/distribution and to keep the end user from messing with them. They were originally WAV files that I converted to MP3 to save space (along with the original BMP images converted to PNG). Makes a big difference when dealing with dozens of audio and hundreds of image files.

The MP3s play fine in other Windows apps, just not Xojo’s.

> [@Meestor\_X](#):
>
> No problems here, Mac or Windows.
> 
> If you’d like to attach the file, I can test it for you.

Thanks. Try [this one](https://www.dropbox.com/s/g5dpicjk3qhzrke/first%20set%20of%20instructions.mp3?dl=1).

---

<div class="post-metadata">

**Author:** ![Meestor\_X](https://ifnotnil.com/user_avatar/ifnotnil.com/meestor_x/32/567_2.png) [@Meestor\_X](https://ifnotnil.com/u/Meestor_X)\
**Post date:** [27 May 2020 17:30 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/7 "2020-05-27T17:30:03Z")

</div>

> Thanks. Try [this one](https://www.dropbox.com/s/g5dpicjk3qhzrke/first%20set%20of%20instructions.mp3?dl=1).

It has an invalid tag. (The date tag)

Removing the tag makes it play properly. [Here’s the repaired file](https://www.dropbox.com/s/t852l1gybyxmmec/first%20set%20of%20instructions.mp3?dl=0).

What program are you using to create your mp3 files?

---

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [27 May 2020 18:20 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/8 "2020-05-27T18:20:57Z")

</div>

> [@Meestor\_X](#):
>
> It has an invalid tag. (The date tag)
> 
> Removing the tag makes it play properly. [Here’s the repaired file](https://www.dropbox.com/s/t852l1gybyxmmec/first%20set%20of%20instructions.mp3?dl=0).
> 
> What program are you using to create your mp3 files?

I used [Permute](https://software.charliemonroe.net/permute/) to batch convert all the WAV files (and also the images).

What did you use to remove the date tag? Is the tag in a fixed position where I could remove it within Xojo? (since I already have them all loaded into the db)

Interesting thing is that WMP and Groove play the files just fine. Why is Xojo tripping up on it?

---

<div class="post-metadata">

**Author:** ![Meestor\_X](https://ifnotnil.com/user_avatar/ifnotnil.com/meestor_x/32/567_2.png) [@Meestor\_X](https://ifnotnil.com/u/Meestor_X)\
**Post date:** [27 May 2020 20:28 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/9 "2020-05-27T20:28:42Z")

</div>

> [@jmadren](#):
>
> I used [Permute](https://software.charliemonroe.net/permute/) to batch convert all the WAV files (and also the images).
> 
> What did you use to remove the date tag? Is the tag in a fixed position where I could remove it within Xojo? (since I already have them all loaded into the db)
> 
> Interesting thing is that WMP and Groove play the files just fine. Why is Xojo tripping up on it?

Many MP3 players just ignore the metadata tags. It’s hard to say why Xojo chokes on it without knowing what library it uses to play media.

Permute clearly has a bug if it’s creating badly-formatted tags. You should let them know. Especially since it’s a paid piece of software.  
I don’t know if you really want to try and create a Xojo tag analyzer/repair tool, there’s plenty free ones out there. However, if you’re [really keen](http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm)…

I just used [Mp3Tag](https://www.mp3tag.de/en/index.html) - one of the greatest (albeit windows only) shareware programs for mass tagging and editing of any tagged media. You could fix all your mp3’s in one click.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [27 May 2020 21:17 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/10 "2020-05-27T21:17:02Z")

</div>

There used to be some code around that would handle ID3 tags in pure xojo code

---

<div class="post-metadata">

**Author:** ![Meestor\_X](https://ifnotnil.com/user_avatar/ifnotnil.com/meestor_x/32/567_2.png) [@Meestor\_X](https://ifnotnil.com/u/Meestor_X)\
**Post date:** [27 May 2020 22:09 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/11 "2020-05-27T22:09:54Z")

</div>

> **[Reading and writing ID3 tags in an MP3 file](http://basicobjects.blogspot.com/2014/05/reading-and-writing-id3-tags-in-mp3-file.html)**
>
> One of the things that is fairly easy to make in RealBasic (or Xojo) is of course a small media player. The MoviePlayer component allows you...

---

<div class="post-metadata">

**Author:** ![jmadren](https://ifnotnil.com/user_avatar/ifnotnil.com/jmadren/32/65_2.png) [@jmadren](https://ifnotnil.com/u/jmadren)\
**Post date:** [27 May 2020 22:35 UTC](https://ifnotnil.com/t/sound-wont-play-mp3-on-windows/514/12 "2020-05-27T22:35:28Z")

</div>

At first I tried using MoviePlayer to play the files, which worked in Windows, but wouldn’t on Mac. Aaarg! Cross-platform my ass! This past year or so has led me to understand “cross” in cross-platform as its alternate meaning. 😠

After reviewing some of the Tag code, I just went with Mp3Tag to strip all tags from all files and re-import them into the db. Everything now works as I had initially designed it. 😓

Thanks all.
