Coder Social home page Coder Social logo

wavreader's Introduction

WavReader

Console utilities for reading wave format (.wav) header and data written in C++, C++/Qt, Java.

Includes

The header of a WAV file

![here] (/wav-sound-format.gif "WAV header")

  • The "RIFF" chunk descriptor:

    1-4 "RIFF" Marks the file as a riff file. Characters are each 1 byte long

    5-8 File size (integer) Size of the overall file - 8 bytes, in bytes (32-bit integer).

    9-12 "WAVE" File Type Header. For our purposes, it always equals "WAVE".

  • The "fmt" sub-chunk:

    13-16 "fmt " Format chunk marker. Includes trailing null

    17-20 16 Length of format data as listed above

    23-24 2 Number of Channels - 2 byte integer

    25-28 44100 Sample Rate - 32 byte integer. CSample Rate = Number of Samples per second, or Hertz.

    29-32 176400 (Sample Rate * BitsPerSample * Channels) / 8. Byte rate

    33-34 4 (BitsPerSample * Channels) / 8.1 - 8 bit mono2 - 8 bit stereo/16 bit mono4 - 16 bit stereo

    35-36 16 Bits per sample

  • The "data" sub-chunk:

    37-40 "data" Marks the beginning of the data section.

    41-44 File size (data) Size of the data section.

    44-.. Data samples

The file could have another sub-chunks.

wavreader's People

Contributors

tkaczenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wavreader's Issues

WavReader_Java: toInt conversion bug

WavReader.toInt(int start, boolean endian) yields the wrong sample rate. I would suggest following fix:

    private int toInt(int start, boolean endian) {
        int k = (endian) ? 1 : -1;
        if (!endian) {
            start += 3;
        }

        return ((buf[start] & 0xFF) << 24) |
                ((buf[start + k] & 0xFF) << 16) |
                ((buf[start + k * 2] & 0xFF) << 8) |
                (buf[start + k * 3] & 0xFF);
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.