Skip to content

v0.8.0

Compare
Choose a tag to compare
@jstrait jstrait released this 22 Jun 20:46
· 577 commits to master since this release
  • Wave files using WAVEFORMATEXTENSIBLE format (format code 65534) can now be read.
    • Notes/Limitations
      • The same formats supported in "vanilla" Wave files are supported when reading WAVEFORMATEXTENSIBLE files. That is, PCM (8/16/24/32 bits per sample) or IEEE_FLOAT (32/64 bits per sample).
      • The channel speaker mapping field is not exposed.
      • The number of valid bits per sample must match the sample container size. For example, if a file has a sample container size of 24 bits and each sample is 24 bits, then it can be read. If the container size is 32 bits and each sample is 24 bits, it can't be read.
      • Writing files using WAVEFORMATEXTENSIBLE format is not supported - all files will be written as a "vanilla" file regardless of the number of channels or sample format.
  • Reader and Writer can now be constructed using with an open IO instance, to allow reading/writing using an arbitrary IO-like object (File, StringIO, etc). Previously, they could only be constructed from a file name (given by a String). Thanks to @taf2 for suggesting this feature and providing an example pull request.
  • The buffer size in Reader.each_buffer() is now optional. If not given, a default buffer size will be used.
  • Two Duration objects will now evaluate to equal if they represent the same amount of time, due to an overridden definition of ==. Thanks to @chrylis for suggesting this improvement.
  • A ReaderClosedError is now raised (instead of IOError) when attempting to read from a closed Reader instance. However, ReaderClosedError extends IOError, so this should be a backwards compatible change.
  • A WriterClosedError is now raised (instead of IOError) when attempting to read from a closed Writer instance. However, WriterClosedError extends IOError, so this should be a backwards compatible change.
  • Backwards Incompatible Changes
    • Reader.file_name and Writer.file_name have been removed. When a Reader or Writer instance is constructed from an IO instance, this field wouldn't necessarily have a sensible value. Since I don't know of an obvious use-case for these fields, going ahead and removing them altogether.
    • The long deprecated ability to provide the sample format for a Format instance as an integer (implying PCM format, with the number being the bits per sample) has been removed. For example, this is no longer valid: Format.new(:mono, 16, 44100). Instead, use Format.new(:mono, :pcm_16, 44100).