Audio-Scan

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - Changed Newx/Newxz calls to use older New/Newz API to support older Perls.

0.43    2009-10-16 15:00:00
        - Increase max buffer size yet again (to 20MB), this time someone had 16MB
          of artwork!
        - libid3tag: Don't re-generate frametype.c, compat.c, and genre.dat as this
          can fail if gperf is not available.

0.42    2009-10-13 10:45:00
        - Bug 14728, fixed issue in libid3tag where default ID3v2.3 UTF-16 byte
          order was set to big-endian instead of little-endian when no BOM
          was present.  Several other tag readers also default to little-endian
          so this appears to be the de-facto standard, even though the v2.3 spec
          says all Unicode text must have a BOM.
        - Bug 14705, Fixed libid3tag to return frames parsed so far when it runs into
          an invalid frame.
        - Bug 14658, MP4: fixed signed char issue on some PPC platforms.

0.41    2009-10-12 10:30:00
        - FLAC: Re-factored FLAC code to remove libFLAC dependency.
        - FLAC: API change: more accurate seeking via find_frame, which
          now takes an offset in milliseconds instead of bytes and seeks
          to the correct audio frame containing the desired sample.
        - FLAC: Added support for reading ID3v2 tags.

src/id3.c  view on Meta::CPAN

      break;

    case UTF_16BE:
      byteorder = UTF16_BYTEORDER_BE;

    case UTF_16:
      bptr = buffer_ptr(id3->buf);

      switch ( (bptr[0] << 8) | bptr[1] ) {
      case 0xfeff:
        DEBUG_TRACE("    UTF-16 BOM is big-endian\n");
        byteorder = UTF16_BYTEORDER_BE;
        buffer_consume(id3->buf, 2);
        read += 2;
        break;

      case 0xfffe:
        DEBUG_TRACE("    UTF-16 BOM is little-endian\n");
        byteorder = UTF16_BYTEORDER_LE;
        buffer_consume(id3->buf, 2);
        read += 2;
        break;
      }

      /* Bug 14728
        If there is no BOM, assume LE, this is what appears in the wild -andy
      */
      if (byteorder == UTF16_BYTEORDER_ANY) {
        DEBUG_TRACE("    UTF-16 byte order defaulting to little-endian, no BOM\n");
        byteorder = UTF16_BYTEORDER_LE;
      }

      read += buffer_get_utf16_as_utf8(id3->buf, id3->utf8, len - read, byteorder);
      break;

    case UTF_8:
      read += buffer_get_utf8(id3->buf, id3->utf8, len);
      break;

t/mp3.t  view on Meta::CPAN


        is( $tags->{TPE1}, $a, 'ID3v2.3 ISO-8859-1 artist ok' );
        is( $tags->{TALB}, $b, 'ID3v2.3 ISO-8859-1 album ok' );
        is( $tags->{TIT2}, $c, 'ID3v2.3 ISO-8859-1 title ok' );
    }

    # Make sure it's been converted to UTF-8
    is( utf8::valid( $tags->{TPE1} ), 1, 'ID3v2.3 ISO-8859-1 is valid UTF-8' );
}

# ID3v2.3 UTF-16 with no BOM (defaults to LE), bug 14728
{
    my $s = Audio::Scan->scan_tags( _f('v2.3-utf16any.mp3') );

    my $tags = $s->{tags};

    is( $tags->{TPE1}, "Guns N' Roses", 'ID3v2.3 UTF-16 title ok' );
    is( $tags->{TALB}, 'Use Your Illusion II', 'ID3v2.3 UTF-16 title ok' );
}

# ID3v2.3 UTF-16BE

t/mp3.t  view on Meta::CPAN


# Bug 16073, zero-byte frames
{
    my $s = Audio::Scan->scan( _f('v2.3-zero-frame.mp3') );
    my $tags = $s->{tags};

    ok( !exists $tags->{WCOM}, 'v2.3 zero-frame WCOM not present ok' );
    is( $tags->{TDRC}, 1982, 'v2.3 zero-frame TDRC ok' );
}

# Bug 16079, TCON with BOM but no text
{
    my $s = Audio::Scan->scan( _f('v2.3-empty-tcon2.mp3') );
    my $tags = $s->{tags};

    ok( !exists $tags->{TCON}, 'v2.3 empty TCON not present ok' );
    is( $tags->{TALB}, 'Unbekanntes Album', 'v2.3 empty TCON TALB ok' );
}

# RT 57664, invalid AENC tag
{



( run in 0.733 second using v1.01-cache-2.11-cpan-e9daa2b36ef )