Skip to main content

Topic: WMA Lossless truncates last few samples of some files. (Read 19131 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Costas
  • [*]
WMA Lossless truncates last few samples of some files.
WMA Lossless is obviously supposed to fully preserve the source data, however
it appears that sometimes the last few samples of a file will be thrown away.

(Note: For those interested in recreating the problem I have uploaded a "problematic" wav file here: http://rapidshare.com/files/REMOVED* )

If I convert the above file to WMAL using dBpoweramp and Windows Media Audio 9.2 Lossless codec I get (when After Encoding Verify Audio option is checked):

Error converting to Windows Media Audio 10, '06 - Melibea - Boheme.wav' to '06 - Melibea - Boheme.wma'
  Error audio file failed verification '06 - Melibea - Boheme.wma'.

If I convert the above file to WMAL using Windows Media Encoder, I get no messages but then if I bit-compare the results using foobar2000 I get:

Comparing:
"06 - Melibea - Boheme.wav"
"06 - Melibea - Boheme.wma"
Comparing failed (length mismatch : 5:35.440000 vs 5:35.439819, 14792904 vs 14792896 samples).

Can anyone help?

Moderation: Removed sample. I haven't downloaded it but from the size of it it is longer than the 30 sec we allow here.
  • Last Edit: 09 January, 2008, 12:59:39 PM by Jan S.

  • pdq
  • [*][*][*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #1
I would guess that the length of the file doesn't match the length specified in the header, so when the file is converted, only the actual data are converted, leaving a file whose length doesn't match the original header. What was used to create the original wav file?

Try decoding the lossless file to wav and compare that to the original file, but compare the data only, not the headers.

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #2
It is not a header issue, I have validated this issue.

  • kjoonlee
  • [*][*][*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #3
I think truncation with WMA "Lossless" has been reported before, at least at Hydrogenaudio.

  • Flepp
  • [*]
WMA Lossless truncates last few samples of some files.
Reply #4
Hi

I did the test with WMAL and could not find any issue.

I compared the CRC's with Dbpoweramp and found no difference.
When converting back to wav i found a small difference at the end of the file when doing a binary compare with fc/b command.
But difference was in the Meta part of the file. I removed all Metadata from both files and fc/b gave me no difference.

So your problem might have something to do with the foobar compare module.


Flepp

  • kjoonlee
  • [*][*][*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #5
I can't find any more posts at the moment, but problems with truncation have been reported with other programs.

http://www.hydrogenaudio.org/forums/index....showtopic=54490

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #6
Hi

I did the test with WMAL and could not find any issue.

I compared the CRC's with Dbpoweramp and found no difference.
When converting back to wav i found a small difference at the end of the file when doing a binary compare with fc/b command.
But difference was in the Meta part of the file. I removed all Metadata from both files and fc/b gave me no difference.

So your problem might have something to do with the foobar compare module.


Flepp


The loss of samples seems quite rare, I tried 2000 files and none did it, but I have a specific file which does.

  • ozmosis82
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #7
I experienced this issue quite some time ago when I first decided to archive my CD collection losslessly. I initially chose WMA Lossless (I wasn't privy to other lossless formats yet) and encoded a number of albums. A year or so later (after much education on the subject of codecs) I decided to move to WavPack and noticed that a number of my gapless albums didn't transition as they were supposed to. There was an audible pop between tracks. I re-ripped the CD in question to see if it had always been there, and found that the transition was seamless.

(It was at this point that I became incredibly paranoid about lossless archiving, I might add.)

Since then, I've been incredibly careful and selective about how I back up my music collection. I use FLAC now and haven't looked back since. Having to go through and re-rip/encode all of those CDs was NOT something I ever want to have to do again... especially since my CD collection has only grown exponentially since then.

[EDIT: Grammar]
  • Last Edit: 17 December, 2007, 03:36:41 PM by ozmosis82

  • maiki
  • [*][*]
WMA Lossless truncates last few samples of some files.
Reply #8
WMA Lossless is obviously supposed to fully preserve the source data, however
it appears that sometimes the last few samples of a file will be thrown away.


OK, I have downloaded and tested your WAVE file and the conclusion is:

your wave file is corrupted

It contains some "metadata" that should NOT be in there.

There is absolutely nothing wrong with WMA lossless, there is absolutely nothing worng with FLAC. Both encoders encode your corrupt wave file but when I decode them back, I get a different wave than your original.

This is what FLAC encoder reports:

06.wav: 100% complete, ratio=0,67806.wav: WARNING: skipping unknown sub-chunk 'LIST' (use --keep-foreign-metadata to keep)
06.wav: wrote 40001107 bytes, ratio=0,676


comparison:

the original wave file you provided: 59 171 758 bytes
encoded into WMA lossless: 39 380 187 bytes
decoded back from WMA: 59 171 628 bytes

the original wave file you provided: 59 171 758 bytes
encoded into FLAC: 40 001 107 bytes
decoded back from FLAC: 59 171 660 bytes

Since I have tested faithfullness of lossless encoders before and it did not give me any problems with any of my CD rips regarding these issues, I highly suspect you are using a buggy software (or/and) settings to rip CDs.

note: I have just tested one of my CD rips and it gives me identical files after re-decoding using WMA lossless...


conclusion #2: WMA Lossless wins the round, your wave file takes the loss
  • Last Edit: 07 January, 2008, 08:53:54 PM by maiki

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #9
>OK, I have downloaded and tested your WAVE file and the conclusion is:
>your wave file is corrupted
>It contains some "metadata" that should NOT be in there.

Wrong - LIST chunks are valid in Wave files, Microsoft created wave files here is their take:

http://msdn2.microsoft.com/en-us/library/ms713231.aspx
---------

I have tested the wave file above it does encode to a wma file which is missing samples. When comparing audio files, Never compare just file sizes, Never run a CRC or md5 on the whole file, run it on the uncompressed audio data inside. Our [audio crc] calculation codec says about this file:

CRC32      Filename

E28F11B9   Z:\06 - Melibea - Boheme.wav
24318D58   Z:\06 - Melibea - Boheme.wma


========================================
Audio Details for: Z:\06 - Melibea - Boheme.wav

    Sample Count: 14,792,904

========================================
Audio Details for: Z:\06 - Melibea - Boheme.wma

    Sample Count: 14,792,859

as you can see there are samples missing from the WMA lossless file, these samples were encoded to WMA lossless, they do not come out though.

>Since I have tested faithfullness of lossless encoders before and it did
>not give me any problems with any of my CD rips regarding these
>issues, I highly suspect you are using a buggy software (or/and)
>settings to rip CDs.

By only testing say 1000 files you might never find the bug, when millions of files are being used and compared then bugs can appear.
  • Last Edit: 08 January, 2008, 04:55:31 AM by spoon

  • Jillian
  • [*][*]
WMA Lossless truncates last few samples of some files.
Reply #10
So WMA Lossless is lossy?

  • maiki
  • [*][*]
WMA Lossless truncates last few samples of some files.
Reply #11
But even if we admit that the file is not corrupted, still, FLAC also fails to encode it properly. So why do you blame WMA lossless for that? Anyway, that file is strange and has been probably separated from some cue sheet.

  • Cosmo
  • [*][*][*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #12
101 Error
  • Last Edit: 11 March, 2008, 08:58:29 AM by Cosmo

  • maiki
  • [*][*]
WMA Lossless truncates last few samples of some files.
Reply #13
So I think somebody competent should post this issue to Microsoft then.

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #14
They were notified, on their own forums...back in the day I used to have the contact details of the head of WMA division, no longer though.

  • TechVsLife
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #15
Can someone confirm that *FLAC* also fails to encode it properly?  Thanks.

But even if we admit that the file is not corrupted, still, FLAC also fails to encode it properly. So why do you blame WMA lossless for that? Anyway, that file is strange and has been probably separated from some cue sheet.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
WMA Lossless truncates last few samples of some files.
Reply #16
Upon closer examination you can see that maiki doesn't know what he's talking about.
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • TechVsLife
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #17
initially read the thread as concluding that the problem was WMAL-specific, but I wasn't sure on a re-reading.  --so the source file did not cause any problems with FLAC?  And does anyone know if this problem still arises with the most recent WMAL encoder/decoders or with the wma SDK?  Thanks.

Moderation: Removed useless quotation of previous post.
  • Last Edit: 02 January, 2009, 01:30:36 PM by greynol

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
WMA Lossless truncates last few samples of some files.
Reply #18
so the source file did not cause any problems with FLAC?
The file simply had some metadata that flac discarded (yes, I looked at it before the link was removed because it violated the TOS).  If the "--keep-foreign-metadata" switch had been used then it would have been kept.  This really should be self-evident from reading maiki's post.

And does anyone know if this problem still arises with the most recent WMAL encoder/decoders or with the wma SDK?
I don't know and I'm not sure that it was ever a problem with the codec as it was implemented in WMP.

Please don't resurrect three threads asking the same basic question.  It is also a violation of the TOS, number 6 to be specific.
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • TechVsLife
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #19
Thanks, that hadn't been clear to me from the thread (that he failed to use the right switch in testing flac).  My apologies on the Tos Six violation.

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #20
The problem was / is (still on going): the files encode correctly but will not decode using the latest WMA SDK, WMP does not use their own SDK so is unaffected.

  • TechVsLife
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #21
Thanks, good to know my files are ok.  I'll have to see if the decoding issue still exists when a new SDK is released for wmp12/windows7.

Moderation: Removed unnecessary quote of previous post.  Also, it is customary to put the quote above your reply.  Please try to do this in the future.
  • Last Edit: 02 January, 2009, 01:28:54 PM by greynol

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
WMA Lossless truncates last few samples of some files.
Reply #22
Isn't the SDK separate entity from WMP and Windows, or am I missing something?
  • Last Edit: 02 January, 2009, 01:29:45 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • spoon
  • [*][*][*][*][*]
  • Administrator
WMA Lossless truncates last few samples of some files.
Reply #23
I think you have seen the last WMP 11 SDK, the reason being is it has been depreciated, I think MS now expect WMA handling to use the sound API in Vista and newer to read / write WMA...interesting as even XP has been dropped, not that I think there will be much changes now to WMA.
  • Last Edit: 02 January, 2009, 03:57:03 PM by spoon

  • TechVsLife
  • [*][*][*]
WMA Lossless truncates last few samples of some files.
Reply #24
Quote
Isn't the SDK separate entity from WMP and Windows, or am I missing something?
[/size]
Separate, but I believe usually released about the same time.
Quote
Removed unnecessary quote of previous post. Also, it is customary to put the quote above your reply. Please try to do this in the future.

[/color]I'll cut back on quoting. As far as "top" posting, I actually thought that was more widely used--it's the default in gmail and outlook:
http://en.wikipedia.org/wiki/Posting_style
On the whole I find it easier to read when there IS top posting--if the message is part of a thread and one isn't cutting up the original post with interspersed replies (as here). However, when in Rome etc. Let me know if I'm in Rome.
  • Last Edit: 02 January, 2009, 06:22:48 PM by TechVsLife