From 98ded90735ca22704633aa424b22190889c6e66d Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Tue, 26 Nov 2024 10:33:03 +0100 Subject: [PATCH] wav: format 1 and 3 mean LE PCM but no implied bit size --- format/media.go | 8 ++++---- format/riff/testdata/end-of-file.fqtest | 2 +- format/riff/testdata/fmt_cb_size_unknown.wav.fqtest | 2 +- format/riff/testdata/pcm.avi.fqtest | 4 ++-- format/riff/testdata/stereo.fqtest | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/format/media.go b/format/media.go index 25260b3e0..d01c620ac 100644 --- a/format/media.go +++ b/format/media.go @@ -246,9 +246,9 @@ var ISO_23091_2_MatrixCoefficients = scalar.UintMap{ // based on ffmpeg libavformat/riff.c const ( - WAVTagPCM_S16LE = 0x0001 + WAVTagPCM = 0x0001 WAVTagADPCM_MS = 0x0002 - WAVTagPCM_F32LE = 0x0003 + WAVTagPCM_Float = 0x0003 WAVTagPCM_ALAW = 0x0006 WAVTagPCM_MULAW = 0x0007 WAVTagWMAVOICE = 0x000a @@ -321,9 +321,9 @@ const ( ) var WAVTagNames = scalar.UintMapSymStr{ - WAVTagPCM_S16LE: "pcm_s16le", + WAVTagPCM: "pcm", WAVTagADPCM_MS: "adpcm_ms", - WAVTagPCM_F32LE: "pcm_f32le", + WAVTagPCM_Float: "pcm_float", WAVTagPCM_ALAW: "pcm_alaw", WAVTagPCM_MULAW: "pcm_mulaw", WAVTagWMAVOICE: "wmavoice", diff --git a/format/riff/testdata/end-of-file.fqtest b/format/riff/testdata/end-of-file.fqtest index 434629fea..865650f45 100644 --- a/format/riff/testdata/end-of-file.fqtest +++ b/format/riff/testdata/end-of-file.fqtest @@ -8,7 +8,7 @@ $ fq -d wav dv end-of-file.wav | | | [0]{}: chunk 0xc-0x24 (24) 0x000| 66 6d 74 20| fmt | id: "fmt" 0xc-0x10 (4) 0x010|10 00 00 00 |.... | size: 16 0x10-0x14 (4) -0x010| 01 00 | .. | audio_format: "pcm_s16le" (1) 0x14-0x16 (2) +0x010| 01 00 | .. | audio_format: "pcm" (1) 0x14-0x16 (2) 0x010| 02 00 | .. | num_channels: 2 0x16-0x18 (2) 0x010| 44 ac 00 00 | D... | sample_rate: 44100 0x18-0x1c (4) 0x010| 10 b1 02 00| ....| byte_rate: 176400 0x1c-0x20 (4) diff --git a/format/riff/testdata/fmt_cb_size_unknown.wav.fqtest b/format/riff/testdata/fmt_cb_size_unknown.wav.fqtest index 151a6a45a..d2c263647 100644 --- a/format/riff/testdata/fmt_cb_size_unknown.wav.fqtest +++ b/format/riff/testdata/fmt_cb_size_unknown.wav.fqtest @@ -7,7 +7,7 @@ $ fq dv fmt_cb_size_unknown.wav | | | [0]{}: chunk 0xc-0x28 (28) 0x00| 66 6d 74 20| fmt | id: "fmt" 0xc-0x10 (4) 0x10|14 00 00 00 |.... | size: 20 0x10-0x14 (4) -0x10| 01 00 | .. | audio_format: "pcm_s16le" (1) 0x14-0x16 (2) +0x10| 01 00 | .. | audio_format: "pcm" (1) 0x14-0x16 (2) 0x10| 02 00 | .. | num_channels: 2 0x16-0x18 (2) 0x10| 44 ac 00 00 | D... | sample_rate: 44100 0x18-0x1c (4) 0x10| 20 62 05 00| b..| byte_rate: 352800 0x1c-0x20 (4) diff --git a/format/riff/testdata/pcm.avi.fqtest b/format/riff/testdata/pcm.avi.fqtest index 880cab1f1..8f22d2785 100644 --- a/format/riff/testdata/pcm.avi.fqtest +++ b/format/riff/testdata/pcm.avi.fqtest @@ -70,7 +70,7 @@ $ fq dv pcm.avi | | | [1]{}: chunk 0xa4-0xbc (24) 0x00a0| 73 74 72 66 | strf | id: "strf" (Stream format) 0xa4-0xa8 (4) 0x00a0| 10 00 00 00 | .... | size: 16 0xa8-0xac (4) -0x00a0| 01 00 | .. | format_tag: "pcm_s16le" (1) 0xac-0xae (2) +0x00a0| 01 00 | .. | format_tag: "pcm" (1) 0xac-0xae (2) 0x00a0| 01 00| ..| channels: 1 0xae-0xb0 (2) 0x00b0|44 ac 00 00 |D... | samples_per_sec: 44100 0xb0-0xb4 (4) 0x00b0| 88 58 01 00 | .X.. | avg_bytes_per_sec: 88200 0xb4-0xb8 (4) @@ -242,5 +242,5 @@ $ fq dv pcm.avi * |until 0x38b1.7 (628) | | | | | type: "auds" | | | handler: "\x01\x00\x00\x00" - | | | format_tag: "pcm_s16le" (1) + | | | format_tag: "pcm" (1) | | | extended_chunks[0:0]: 0x390a-0x390a (0) diff --git a/format/riff/testdata/stereo.fqtest b/format/riff/testdata/stereo.fqtest index 2da687796..c48e85e88 100644 --- a/format/riff/testdata/stereo.fqtest +++ b/format/riff/testdata/stereo.fqtest @@ -8,7 +8,7 @@ $ fq -d wav dv stereo.wav | | | [0]{}: chunk 0xc-0x24 (24) 0x000| 66 6d 74 20| fmt | id: "fmt" 0xc-0x10 (4) 0x010|10 00 00 00 |.... | size: 16 0x10-0x14 (4) -0x010| 01 00 | .. | audio_format: "pcm_s16le" (1) 0x14-0x16 (2) +0x010| 01 00 | .. | audio_format: "pcm" (1) 0x14-0x16 (2) 0x010| 02 00 | .. | num_channels: 2 0x16-0x18 (2) 0x010| 44 ac 00 00 | D... | sample_rate: 44100 0x18-0x1c (4) 0x010| 10 b1 02 00| ....| byte_rate: 176400 0x1c-0x20 (4)