Skip to content

Commit

Permalink
wav: format 1 and 3 mean LE PCM but no implied bit size
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Nov 26, 2024
1 parent b3db725 commit 98ded90
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions format/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion format/riff/testdata/end-of-file.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion format/riff/testdata/fmt_cb_size_unknown.wav.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions format/riff/testdata/pcm.avi.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion format/riff/testdata/stereo.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 98ded90

Please sign in to comment.