Skip to content

Commit

Permalink
Small improvements to error message wording
Browse files Browse the repository at this point in the history
In particular, the new wording includes the common name of the
relevant format (i.e. WAVE_FORMAT_EXTENSIBLE), since the format
code of 65534 might be cryptic on its own.
  • Loading branch information
jstrait committed Dec 30, 2022
1 parent 8ba79c1 commit b1a1750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wavefile/chunk_readers/format_chunk_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def read

if format_chunk[:audio_format] == FORMAT_CODES[:extensible]
if format_chunk[:extension_size] < 22
raise_error InvalidFormatError, "The format chunk extension size of #{format_chunk[:extension_size]} bytes is too small. Since this format chunk has a format code of #{FORMAT_CODES[:extensible]}, the extension must be at least 22 bytes long."
raise_error InvalidFormatError, "The format chunk extension size of #{format_chunk[:extension_size]} bytes is too small. Since the format chunk has a format code of #{FORMAT_CODES[:extensible]} (i.e. WAVE_FORMAT_EXTENSIBLE), the extension size must be at least 22 bytes."
end

format_chunk[:valid_bits_per_sample] = raw_bytes.slice!(0...2).unpack(UNSIGNED_INT_16).first
Expand Down

0 comments on commit b1a1750

Please sign in to comment.