DonationCoder.com Forum

Main Area and Open Discussion => Living Room => Topic started by: tomos on February 01, 2013, 04:34 AM

Title: Mp3 File Format Issue Split From Silly Humor Thread
Post by: tomos on February 01, 2013, 04:34 AM
 An educational broadcast about the "F" word.....
 (see attachment in previous post (https://www.donationcoder.com/forum/index.php?topic=16974.msg316456#msg316456))

 :-\ I've tried three different players and cant get that to play (Trout/WMP/VLC). Tried downloading in a different browser too in case.
It's only 157kb, could that be correct? (Edit/ yes seems to be correct)
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Renegade on February 01, 2013, 04:42 AM
The size is correct. I had a difficult time as well. I think there's something odd in the WAV, but was too lazy to figure out what. Maybe pure PCM? It played in ALShow (a video player), but not in ALSong (an MP3 player).  :huh:
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Stoic Joker on February 01, 2013, 06:31 AM
It played for me in WMP on Win7, but it wouldn't play in WMP on my Win8 laptop.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 01, 2013, 05:03 PM
  An educational broadcast about the "F" word.....
 (see attachment in previous post (https://www.donationcoder.com/forum/index.php?topic=16974.msg316456#msg316456))

 :-\ I've tried three different players and cant get that to play (Trout/WMP/VLC). Tried downloading in a different browser too in case.
It's only 157kb, could that be correct? (Edit/ yes seems to be correct)


  I forgot, I have all of my .wav files l3enc encoded.  It keeps them in the wav format, but they're crunched down using MPEG Layer-3.  That's why it's so small.  With XP, you can open it in the default Windows .snd player (sndrec32.exe) and select "Properties", then "Convert Now".  Click the "Save As", give it a name, then "OK" and "OK" again and it will restore it back to a normal huge .wav.  Sorry bout dat.   :-[
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: TaoPhoenix on February 01, 2013, 07:21 PM

 :-\ I've tried three different players and cant get that to play (Trout/WMP/VLC). Tried downloading in a different browser too in case.
It's only 157kb, could that be correct? (Edit/ yes seems to be correct)


Heh were you saying a particular word after trying all that?  :Thmbsup:
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 02, 2013, 05:30 AM
I forgot, I have all of my .wav files l3enc encoded.  It keeps them in the wav format, but they're crunched down using MPEG Layer-3.  That's why it's so small.  With XP, you can open it in the default Windows .snd player (sndrec32.exe) and select "Properties", then "Convert Now".  Click the "Save As", give it a name, then "OK" and "OK" again and it will restore it back to a normal huge .wav.  Sorry bout dat.   :-[
Out of curiosity: why keep them in .wav instead of native .mp3? You lose ID3 tag support, and need specific codecs in order to play those .wavs, and not all software that can handle .wac supports chunks that aren't raw pcm audio.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 02, 2013, 06:24 PM
I forgot, I have all of my .wav files l3enc encoded.  It keeps them in the wav format, but they're crunched down using MPEG Layer-3.  That's why it's so small.  With XP, you can open it in the default Windows .snd player (sndrec32.exe) and select "Properties", then "Convert Now".  Click the "Save As", give it a name, then "OK" and "OK" again and it will restore it back to a normal huge .wav.  Sorry bout dat.   :-[
Out of curiosity: why keep them in .wav instead of native .mp3? You lose ID3 tag support, and need specific codecs in order to play those .wavs, and not all software that can handle .wac supports chunks that aren't raw pcm audio.

The MPEG Layer-3 wav's operates much faster than .mp3 and don't require special players once installed, it decodes on the fly in windows.  If I remember correctly, they also make much smaller files than .mp3's.  I only use mp3 format for actual music files.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 02, 2013, 07:11 PM
The MPEG Layer-3 wav's operates much faster than .mp3 and don't require special players once installed, it decodes on the fly in windows.  If I remember correctly, they also make much smaller files than .mp3's.  I only use mp3 format for actual music files.

Where did you get that info from? That sounds like something from an AOL wav trader chatroom, where they compress the crap out of sound files till they make a distinct "sucking" sound when played, and only because files over a certain size or with a different file extension will not play in AOL chatrooms. But they will tell you there is no difference in sound quality and what they do is better, because the file size is smaller.

They are wrong.

MPEG Layer-3 is essentially the same as MP3. They are not smaller files than MP3's unless they are compressed more, which doing that makes them lose more quality, just like you'd lose quality doing the same to an MP3.

The .wav file extension causes the file not to support ID tags, unless you use crapware that makes the files support it, in which case the files will become playable only in that crapware unless you change the file extension to .mp3.

Now I don't know what you mean by this part:

don't require special players once installed, it decodes on the fly in windows.

Do you mean you can use it for system sounds? That it works in Windows Media Player? Something else? What is "once installed"? What exactly is being installed?

The truth is that the file will only work for system sounds if the file size is under a certain threshold. I know this because I used to do this to make full song wav files to use as startup wavs on my old snail PC. I would select songs of a length near the same as how long it took for the system to startup and be ready for use, then set them as the startup wav, so I could use it as a timer. Turn the power on and walk away till the song was over. But if the file size was too big, it wouldn't play at all, and I'd have to compress it some more. Since the speakers on that PC were crap, it didn't matter how good the file sounded, it would end up sounding like crap any way. :D

The wav file you have will not automatically work in various players, just simply because it's a wav. In fact, it will probably work in more players if you simply rename the file, changing the .wav extension to .mp3. Try it and see how it works in all the players where it didn't before. And once you do, it will magically support ID tags, too.

Those three letters, W-A-V are sometimes magic, but sometimes the two letters M-P and the number 3 are even more magical. And in the case of your compressed wavs, that's the only difference between them and MP3's...the three characters after the dot. There is no magic in the file itself.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 02, 2013, 07:32 PM
Where did you get that info from? That sounds like something from an AOL wav trader chatroom, where they compress the crap out of sound files till they make a distinct "sucking" sound when played, and only because files over a certain size or with a different file extension will not play in AOL chatrooms. But they will tell you there is no difference in sound quality and what they do is better, because the file size is smaller.

They are wrong.

MPEG Layer-3 is essentially the same as MP3. They are not smaller files than MP3's unless they are compressed more, which doing that makes them lose more quality, just like you'd lose quality doing the same to an MP3.

The .wav file extension causes the file not to support ID tags, unless you use crapware that makes the files support it, in which case the files will become playable only in that crapware unless you change the file extension to .mp3.

Now I don't know what you mean by this part:

don't require special players once installed, it decodes on the fly in windows.

Do you mean you can use it for system sounds? That it works in Windows Media Player? Something else? What is "once installed"? What exactly is being installed?

The truth is that the file will only work for system sounds if the file size is under a certain threshold. I know this because I used to do this to make full song wav files to use as startup wavs on my old snail PC. I would select songs of a length near the same as how long it took for the system to startup and be ready for use, then set them as the startup wav, so I could use it as a timer. Turn the power on and walk away till the song was over. But if the file size was too big, it wouldn't play at all, and I'd have to compress it some more. Since the speakers on that PC were crap, it didn't matter how good the file sounded, it would end up sounding like crap any way. :D

The wav file you have will not automatically work in various players, just simply because it's a wav. In fact, it will probably work in more players if you simply rename the file, changing the .wav extension to .mp3. Try it and see how it works in all the players where it didn't before. And once you do, it will magically support ID tags, too.

Those three letters, W-A-V are sometimes magic, but sometimes the two letters M-P and the number 3 are even more magical. And in the case of your compressed wavs, that's the only difference between them and MP3's...the three characters after the dot. There is no magic in the file itself.

  It's actually different from a .mp3 and won't work if renamed to .mp3.  Once the codec is installed you can use it with system sound files.  Small sound files won't crunch down, which is true for just about any cruncher.  You can choose what level of crunching so as to not take too much away, but for mono files it really don't make a difference.
  Once the codec is installed, it works on anything that you have set your .wav files to be played with, whether that's Window Media Player, Windows Sound Player, or whatever.  The L3enc works in the background when called upon by the system.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: 4wd on February 02, 2013, 07:53 PM
It's actually different from a .mp3 and won't work if renamed to .mp3.  Once the codec is installed you can use it with system sound files.  Small sound files won't crunch down, which is true for just about any cruncher.  You can choose what level of crunching so as to not take too much away, but for mono files it really don't make a difference.
  Once the codec is installed, it works on anything that you have set your .wav files to be played with, whether that's Window Media Player, Windows Sound Player, or whatever.  The L3enc works in the background when called upon by the system.

Sounds more like it's just MP3 encoded data within a WAV container, (ie. it has a header of RIFF) - so renaming it to .mp3 won't work because the MP3 header info required by a true MP3 decoder is missing and anything that can only handle valid WAV files won't work because the data will appear corrupt.  Hence the need for a codec.

[ You are not allowed to view attachments ]

MPC-BE (http://dev.mpc-next.ru/) plays it without a problem.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 02, 2013, 07:56 PM
It's actually different from a .mp3 and won't work if renamed to .mp3.

But I just did and it worked. I renamed your file from .wav to .mp3 and it worked fine. And it now supports tags. And the sound quality, no matter what file extension is used, is really bad, as I expected from the small file size.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: 4wd on February 02, 2013, 08:02 PM
It's actually different from a .mp3 and won't work if renamed to .mp3.

But I just did and it worked. I renamed your file from .wav to .mp3 and it worked fine. And it now supports tags. And the sound quality, no matter what file extension is used, is really bad, as I expected from the small file size.

But was this on a stock system with no extra codecs installed using the default Windows playback program?

eg. I can change it to .ogg, .mkv, .mp4, etc and it will still playback in MPC-BE without a problem on my W7 system.

Copy it across to an XP system with no codecs and it doesn't play at all, no matter what extension it's got.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 02, 2013, 08:18 PM
Was it made on a stock system with no extra codecs installed, using only software or components that ships with Windows?


Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 02, 2013, 11:04 PM
The MPEG Layer-3 wav's operates much faster than .mp3 and don't require special players once installed, it decodes on the fly in windows.
"Operates much faster", how? Do you mean because you can use the extremely stripped-down sndrec32 to play it rather than starting some bigger/slower media player? Or something else?

I can see it sorta makes sense if you want to have your Windows system sounds mp3 compressed, or for other applications that don't support mp3 (it'll only work for mp3-wave if those applications uses Windows APIs - a fair amount of programs, and especially games, parses the .wav by hand, and only supports raw PCM audio - and possibly even only one hardcoded format).

But you do need the codec installed, then, which not many people have these days - especially since all audio players tend to come with built-in mp3 support these days :)

If I remember correctly, they also make much smaller files than .mp3's.  I only use mp3 format for actual music files.
Given the same (constant) bitrate, a WAV with mp3 audio should actually be slightly larger than normal mp3, since the wav container headers are in addition to the mp3 stream headers. If you see a size difference of more than a few handfuls of bytes, you're encoding the wav-mp3s with a lower bitrate than the mp3 you're comparing to.

Those three letters, W-A-V are sometimes magic, but sometimes the two letters M-P and the number 3 are even more magical. And in the case of your compressed wavs, that's the only difference between them and MP3's...the three characters after the dot. There is no magic in the file itself.
The file formats are different, though - and while the audio stream itself is the same compression format, being in a .wav container can matter - an application might not support mp3, but if it uses Windows APIs to handle it's .wav files, it should be able to play back pretty much any audio format you have a codec installed for.

Was it made on a stock system with no extra codecs installed, using only software or components that ships with Windows?
Tinman says he uses l3enc - I'm not sure whether he uses the original l3enc.exe, or compressed by opening input file and selecting l3enc codec - but at any rate, l3enc was the first mp3 compressor (and probably the first codec as well?), developed by Fraunhofer. It has pretty bad quality compared to today's codecs (it had to cut corners to run at acceptable speed - when I first got l3enc.exe, my system was a 486dx4-100), and unless you're using RADiUMs hacked version you're limited to 128kbps (iirc RADiUM not only hacked the codec to support the higher bitrates, but also optimized the (binary) code making it some 5-10% faster...)

Sounds more like it's just MP3 encoded data within a WAV container, (ie. it has a header of RIFF) - so renaming it to .mp3 won't work because the MP3 header info required by a true MP3 decoder is missing and anything that can only handle valid WAV files won't work because the data will appear corrupt.  Hence the need for a codec.
You're right that it's mp3 encoded data in a .wav file - as your screenshot also clearly shows :)

However, you're slightly wrong about the header stuff. The following is off top of my head, so might not be 100% correct, but... here goes:
MP3 files don't have headers in the same sense that most other file formats do - which is normally a header located at the beginning of the file, in a fixed format. MP3 isn't a "container format", it's basically just a bunch of MPEG frames that happen to be in the same file. MPEG was made to support "muxing" (having both audio and video in one stream (or file), which means you need to chop up your video and audio streams to pieces and interleave them, since you can't "seek" in streamed audio... and it would've been problematic for optical media which are very slow at seeks)).

So, MPEG revolves around "frames" which can (theoretically) appear anywhere inside your stream (or file). Since the format need to support streams with many small frames, both for muxing reasons as well as jumping into the middle of a streamed broadcast without waiting too long for a sync frame, the identifier (the "MP3 Sync Word") is very short. And it's not very unique - so it wouldn't be a good idea to scan through a file looking for this signature.

ID3 tags are a bit of a mess, but I'm too fuzzy on the details to say much more about them than that. But without them, since MP3 isn't a container format, you'd have to read through the entire MP3 file in order to know it's playtime... so they're definitely welcome :)

...anyway, file doesn't want to play here, whether I keep the file extension as .wav or change to .mp3 - tried Windows Media Player, mpc-hc (http://mpc-hc.sourceforge.net/) or foobar2000. Win7-x64 without any codec packs installed - I might even have removed some, since I tweaked the install a lot (I did keep WMP, though). No go, even if I trash the wav headers.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: 4wd on February 03, 2013, 01:20 AM
The following is off top of my head, so might not be 100% correct, but...

You're correct - been a while since I did anything more than "just" encode files.  :)

...anyway, file doesn't want to play here, ...

My bad, it was actually getting picked up by the LAV codec:  :-[

[ You are not allowed to view attachments ]
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 03, 2013, 04:50 PM
Was it made on a stock system with no extra codecs installed, using only software or components that ships with Windows?

  It's been soooooo long ago.  I encoded these years ago, back in the W95 days.  The reason I'm thinking it was already a codec in Windows is because I used sndrec.exe to encode, which is the original default .wav sound player.  I renamed the file to .mp3 and Windows Media Player won't play it, so I don't know what you did.
  What this codec does, you select any .wav that's been encoded, and no matter what player you use, whether it supports .mp3 or not, it will play it as a normal .wav.  I only used it for all the small sound files that cluttered up the system's "Media" folder in W95, including the Windows system sound files.  If I remember correctly, any .wav file above 30Kb could be encoded.  And of course, depending on what bitrate you select is how big the file is going to be.  For the normal Windows sounds, which were all mono, could be crunched down quite a bit before you would notice any difference.  During the period, this codec would make much smaller files than the normal .mp3, even at the same bitrate.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 05, 2013, 10:31 AM
It's been soooooo long ago.  I encoded these years ago, back in the W95 days.  The reason I'm thinking it was already a codec in Windows is because I used sndrec.exe to encode, which is the original default .wav sound player.
That must've been because you installed the fraunhofer (aka l3enc) codec - and a commercial version, at that? Can't remember which Windows version introduced MP3 codec support, but iirc it was decode-only. For some reason, I don't have sndrec32 on any of my Windows VMs, so I can't check out if it let you specify codec on save.

I renamed the file to .mp3 and Windows Media Player won't play it, so I don't know what you did.
It has a WAVE header - some programs would try to interpret that and ignore the file extension (and then fail when you don't have the specified codec installed). Other will interpret as mp3, but will expect the file to start with an MP3 frame (or an ID3 tag).

During the period, this codec would make much smaller files than the normal .mp3, even at the same bitrate.
Given the same bitrate and method (which was Constant Bit Rate back in those days), that's simply impossible. Back in the early days (after the very early days, when it was the only codec around), the Fraunhofer codec had better quality than competing codecs, at least at lower bitrates. But constant bitrate means constant bitrate - same size, but possibly difference in quality, depending on psychoacoustics.

EDIT: curiosity got the better of me - interested me that nothing wanted to eat it as "mp3", even with the WAVE header removed, and I was a bit puzzled that I couldn't find a frame sync word. So, I downloaded GSpot (http://www.headbands.com/gspot/) to inspect the file, and it says the codec is DSP Group TrueSpeechw@8KHz... no wonder nothing wants to play it back as mp3 :)
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 05, 2013, 04:36 PM
EDIT: curiosity got the better of me - interested me that nothing wanted to eat it as "mp3", even with the WAVE header removed, and I was a bit puzzled that I couldn't find a frame sync word. So, I downloaded GSpot (http://www.headbands.com/gspot/) to inspect the file, and it says the codec is DSP Group TrueSpeechw@8KHz... no wonder nothing wants to play it back as mp3 :)


I had no troubles getting Trout to play it as MP3.  ;)
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 05, 2013, 05:16 PM
I had no troubles getting Trout to play it as MP3.  ;)
Doesn't work for me, neither with .wav nor .mp3 extension (trout v1.0.6). With .mp3 extension, it does seem to try to parse it as mp3 rather than wav (given that bitrate, sample, channels and length are all wrong), the specs for the .wav version look sane - but can obviously not be played since I don't have the codec installed.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 05, 2013, 11:56 PM
Well, it works both ways in Trout, for me. I am a little behind on the updates (1.0.4 build 93), if that makes any difference.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 06, 2013, 06:11 AM
Well, it works both ways in Trout, for me. I am a little behind on the updates (1.0.4 build 93), if that makes any difference.
Could you try the most recent version? If that still works, could you try using a hex editor (HxD (http://mh-nexus.de/en/hxd/) is pretty nice if you don't have on lying around) to overwrite the "WAVE" header string with something else, and see if it still works? Also, is this a freshly re-downloaded version of Define.wav, or have you had it open in any other application after changing extension to .mp3?

Perhaps we can get Skwire to comment on how he parses files... and perhaps we can get mouser to cut all the file-discussion from this thread and put it into a new one :-)
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 06, 2013, 07:02 AM
Could you try the most recent version?

Still works.

If that still works, could you try using a hex editor (HxD (http://mh-nexus.de/en/hxd/) is pretty nice if you don't have on lying around) to overwrite the "WAVE" header string with something else, and see if it still works?

Now it doesn't.

Also, is this a freshly re-downloaded version of Define.wav, or have you had it open in any other application after changing extension to .mp3?

Started with a fresh copy for this little experiment.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 06, 2013, 07:11 AM
Thanks for your testing, app!

Since it doesn't work when you nuke the WAVE header, my guess is your version parses as .wav, regardless of the file extension. If you load the pristine copy into trout with .wav and .mp3 extensions, does it show the same information for both? It's weird that our versions (seem to!) handle things differently, as I couldn't find anything in the changelog that suggests file parsing has been changed between our respective versions.

Anyway, I get the following results:
[ You are not allowed to view attachments ]
Certainly seems to me as if trout tries to parse the file as .mp3 based on the file extension, but fails since it isn't mp3?

EDIT: just grabbed a copy of FFmpeg (http://www.ffmpeg.org/download.html), which has built-in (rather than codec) support for TrueSpeech - it's able to play back the .wav file, and the player indeed also identifies it as TrueSpeech (and doesn't care about .wav vs .mp3 extension, so it's parsing the file contents).
[ You are not allowed to view attachments ]
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 06, 2013, 01:56 PM
Here is how it looks here:

[ You are not allowed to view attachments ]

Fresh clean unmodified copy, with both .wav and .mp3 file extensions, loaded into the latest version of Trout.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: app103 on February 06, 2013, 02:10 PM
Your FFmpeg screenshot mentions the file being created with GoldWave, which is not the sndrec.exe which shipped with Win95 that Tinman says he created the file in. I am guessing it was an older version of this app (http://www.goldwave.com/) that he used.
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 06, 2013, 09:11 PM
  Gee, I didn't mean to start such an ordeal over one lousy wav file.  Anyhow, I'm uploading the original (I do believe) codec that I installed.  This is a self-installing zip file, but you need to rename it back to .exe.
[ You are not allowed to view attachments ]
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Renegade on February 07, 2013, 05:28 AM
Meh, file formats and compression are just some of those fun things!  :-*
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: f0dder on February 07, 2013, 06:57 AM
Fresh clean unmodified copy, with both .wav and .mp3 file extensions, loaded into the latest version of Trout.
That's pretty weird! But you can clearly see that it hasn't been able to parse the file as MP3, since bitrate, samplerate and channels are wrong. Perhaps it just directly feeds the file to a 3rd-party library, which then correctly parses the data as WAVE nonetheless?

Your FFmpeg screenshot mentions the file being created with GoldWave, which is not the sndrec.exe which shipped with Win95 that Tinman says he created the file in. I am guessing it was an older version of this app (http://www.goldwave.com/) that he used.
Indeed - shouldn't really make much of a difference, though, any WAVE editor that supports the codecs available on the system would produce more or less the same output.

  Gee, I didn't mean to start such an ordeal over one lousy wav file.  Anyhow, I'm uploading the original (I do believe) codec that I installed.  This is a self-installing zip file, but you need to rename it back to .exe. (see attachment in previous post (https://www.donationcoder.com/forum/index.php?topic=33942.msg317215#msg317215))
:) - well, unless somebody has played tricks on you, that codec isn't the codec used to compress the Define.wav. That file is clearly TrueSpeech and not mp3-encoded... just tested on a clean XP VM, installing the l3codec above still doesn't enable me to open the file.

It also seems that the codec is decode-only (unless Audacity isn't able to use system codecs) - which is fine and well, since the compression-enabled codec iirc was commercial :)

Meh, file formats and compression are just some of those fun things!  :-*
Indeed - this was a fun bit of detective work :)
Title: Re: Mp3 File Format Issue Split From Silly Humor Thread
Post by: Tinman57 on February 07, 2013, 01:43 PM
Indeed - this was a fun bit of detective work :)

  That explains a few things then.  I never coded that wav file, it was already coded when I downloaded it.  I've got such a large collection of those wav files from the past that it's hard for me to keep up with, especially since I've slept many times since then...   ;)