[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-devel
Subject:    [SoX-devel] [ sox-Bugs-3481510 ] Warning on reading IEEE float wave file
From:       SourceForge.net <noreply () sourceforge ! net>
Date:       2012-10-16 10:26:11
Message-ID: E1TO4Ll-0007ZD-Qv () sfs-ml-3 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #3481510, was opened at 2012-01-29 19:40
Message generated for change (Comment added) made by nu774
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3481510&group_id=10706

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: nu774 (nu774)
Assigned to: Ulrich Klauer (uklauer)
Summary: Warning on reading IEEE float wave file

Initial Comment:
When feeding 32bit IEEE float wave file (with WAVE_FORMAT_EXTENSIBLE header), \
mysterious warning is always shown like this: "WARN wav: wave header missing FmtExt \
chunk" This is because missing condition in if statement around line 629 of wav.c.
Adding condition on WAVE_FORMAT_IEEE_FLOAT will fix this issue.

    if (wav->formatTag != WAVE_FORMAT_PCM &&
        wav->formatTag != WAVE_FORMAT_ALAW &&
        wav->formatTag != WAVE_FORMAT_MULAW) {
        if (len >= 2) {
            lsx_readw(ft, &wExtSize);
            len -= 2;
        } else {
            lsx_warn("wave header missing FmtExt chunk");
        }
    }

Also, in the same function, by the following check, currently 64bit float wav cannot \
be read. By adding case 8: condition, it can at least be read (though it's converted \
to 32bit float internally).

    switch (bytespersample)
    {
    case 1:
      if (ft->encoding.encoding == SOX_ENCODING_UNKNOWN)
        ft->encoding.encoding = SOX_ENCODING_UNSIGNED;
      break;

    case 2: case 3: case 4:
      if (ft->encoding.encoding == SOX_ENCODING_UNKNOWN)
        ft->encoding.encoding = SOX_ENCODING_SIGN2;
      break;

    default:
      lsx_fail_errno(ft,SOX_EFMT,"Sorry, don't understand .wav size");
      return SOX_EOF;
    }


----------------------------------------------------------------------

Comment By: nu774 (nu774)
Date: 2012-10-16 03:26

Message:
Please read this page:
http://msdn.microsoft.com/en-us/windows/hardware/gg463006.aspx

In this page, structure WAVEFORMATIEEEFLOATEX  is described, and cbSize is
set to 22 (same as integer PCM case). It is simply typedef-ed alias for
WAVEFORMATEXTENSIBLE structure, declared in mmreg.h of Windows SDK header. 
So, there's no trailing after that. Same as integer PCM.

----------------------------------------------------------------------

Comment By: Ulrich Klauer (uklauer)
Date: 2012-10-16 01:42

Message:
I'm not sure about the first issue. I think the WAV spec (which is a
difficult read) could be interpreted in such a way that *only*
WAVE_FORMAT_PCM files may leave out the extended part. It seems that is how
http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html reads
it. In that case, the warning would be legitimate, and we should even give
it on a-law and mu-law files without the extension. So I haven't touched
this, only changed the wording of the warning to say "extended part of fmt
chunk" instead of "FmtExt chunk".

The second issue is clearly a bug, which is now fixed in git (commit
fc127d0).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3481510&group_id=10706

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic