Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in read of RIFF signature..? #31

Open
christophe-hall opened this issue Feb 9, 2023 · 2 comments
Open

Bug in read of RIFF signature..? #31

christophe-hall opened this issue Feb 9, 2023 · 2 comments

Comments

@christophe-hall
Copy link

christophe-hall commented Feb 9, 2023

WAV with RIFF chunks like:

image

is read by wavefile with a funky signature like:

{
  "chunkId": "RIFF",
  "chunkSize": 639470,
  "format": "WAVE",
  "subChunks": [
    {
      "chunkId": "fmt ",
      "chunkSize": 16,
      "chunkData": {
        "start": 20,
        "end": 36
      }
    },
    {
      "chunkId": "data",
      "chunkSize": 639096,
      "chunkData": {
        "start": 44,
        "end": 639140
      }
    },
    {
      "chunkId": "LIST",
      "chunkSize": 68,
      "format": "INFO",
      "subChunks": [
        {
          "chunkId": "INAM",
          "chunkSize": 14,
          "chunkData": {
            "start": 639160,
            "end": 639174
          }
        },
        {
          "chunkId": "ISFT",
          "chunkSize": 34,
          "chunkData": {
            "start": 639182,
            "end": 639216
          }
        },
        {
          "chunkId": "cue ",
          "chunkSize": 76,
          "chunkData": {
            "start": 639224,
            "end": 639300
          }
        },
        {
          "chunkId": "LIST",
          "chunkSize": 102,
          "format": "adtl",
          "subChunks": [
            {
              "chunkId": "ltxt",
              "chunkSize": 20,
              "chunkData": {
                "start": 639320,
                "end": 639340
              }
            },
            {
              "chunkId": "labl",
              "chunkSize": 16,
              "chunkData": {
                "start": 639348,
                "end": 639364
              }
            },
            {
              "chunkId": "labl",
              "chunkSize": 16,
              "chunkData": {
                "start": 639372,
                "end": 639388
              }
            },
            {
              "chunkId": "labl",
              "chunkSize": 14,
              "chunkData": {
                "start": 639396,
                "end": 639410
              }
            },
            {
              "chunkId": "smpl",
              "chunkSize": 60,
              "chunkData": {
                "start": 639418,
                "end": 639478
              }
            }
          ]
        },
        {
          "chunkId": "smpl",
          "chunkSize": 60,
          "chunkData": {
            "start": 639418,
            "end": 639478
          }
        }
      ]
    },
    {
      "chunkId": "cue ",
      "chunkSize": 76,
      "chunkData": {
        "start": 639224,
        "end": 639300
      }
    },
    {
      "chunkId": "LIST",
      "chunkSize": 102,
      "format": "adtl",
      "subChunks": [
        {
          "chunkId": "ltxt",
          "chunkSize": 20,
          "chunkData": {
            "start": 639320,
            "end": 639340
          }
        },
        {
          "chunkId": "labl",
          "chunkSize": 16,
          "chunkData": {
            "start": 639348,
            "end": 639364
          }
        },
        {
          "chunkId": "labl",
          "chunkSize": 16,
          "chunkData": {
            "start": 639372,
            "end": 639388
          }
        },
        {
          "chunkId": "labl",
          "chunkSize": 14,
          "chunkData": {
            "start": 639396,
            "end": 639410
          }
        },
        {
          "chunkId": "smpl",
          "chunkSize": 60,
          "chunkData": {
            "start": 639418,
            "end": 639478
          }
        }
      ]
    },
    {
      "chunkId": "smpl",
      "chunkSize": 60,
      "chunkData": {
        "start": 639418,
        "end": 639478
      }
    }
  ]
}

This causes an exception where wavefile makes one LIST type (INFO or adtl) a subchunk of the other LIST type.

@christophe-hall christophe-hall changed the title Choke on reading files containing cue point labels..? Bug in read of RIFF signature..? Feb 13, 2023
@erikh2000
Copy link

I think I saw the same problem. I'll add a little more information here.

I get an exception inside of readLISTINFOSubChunks_() where the second subChunk param has a subchunk similar to the one shown above. This causes an exception on this line:

this.head = subChunk.chunkData.start;

...and you can see that the code here is ready to deal with the passed-in structure.

If someone will help me resolve my build issue, I'm happy to contribute a failing test and maybe a fix. The WAV files that fail for me are generated in Audition and contain markers.

@erikh2000
Copy link

Here is a WAV file that should reproduce the exception: female-sad-2.wav

I have all rights to the file and it's MIT-licensed from my repo. I am fine with it being included as a test wav in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants