Commit Graph
214 Commits
Author SHA1 Message Date
dotCooCoo 44afdcfbe1 Merge main into fix/audio-wav-repair 2026-11-28 02:27:23 -08:00
BFlat ca57833b96 Merge pull request #2600 from dotCooCoo/feat/audio-wav-float-header-bext
craft-audio: wav_float_header_with_bwf writes a growing float WAV with a bext chunk
2026-11-28 11:41:21 +07:00
dotCooCoo c76b8b38db audio: reject unsupported SMPTE 302M header channels 2026-11-26 15:04:29 -08:00
FredApps cb6f192259 Merge pull request #1764 from el-j/feat/audio-s302m
craft-audio: SMPTE ST 302M packet decoder and encoder (s302m)
2026-11-26 14:31:27 +01:00
FredApps 05d9aa927a Merge main (3b09a644a5) into feat/audio-s302m
Conflicts:
crates/audio/Cargo.toml

Conflict in crates/audio/Cargo.toml: main folded every [[test]] binary into the library's test executable (tests/main.rs); dropped the [[test]] list and added s302m_oracle to tests/main.rs behind feature s302m. Ran: cargo test -p craft-audio --lib --features s302m s302m (8 passed), clippy -p craft-audio --all-targets --features s302m -D warnings (clean).
2026-11-26 19:22:55 +07:00
FredApps 3b3671bb29 Merge main (3b09a644a5) into fix/alac-shift-per-packet
Conflicts:
crates/audio/src/alac/encoder.rs

Conflict in crates/audio/src/alac/encoder.rs: main's test cleanup removed bad_input_is_refused; kept that removal and this PR's new silence/quiet/shift tests. Ran: cargo test -p craft-audio --lib --features alac-decode,alac-encode alac (13 passed).
2026-11-26 19:22:50 +07:00
FredApps 582549275d Merge branch 'main' into claude/packet-encoder-2064de 2026-11-26 10:17:30 +01:00
dotCooCoo e42b53f2b2 Merge main into fix/audio-wav-repair 2026-11-25 23:31:21 -08:00
dotCooCoo 5a35ae1c40 Merge main into feat/audio-wav-float-header-bext 2026-11-25 22:57:20 -08:00
dotCooCoo d5d1e37f9c Merge main into fix/audio-wav-repair 2026-11-25 19:42:38 -08:00
dotCooCoo 6faceab4a1 Merge main into feat/audio-wav-float-header-bext 2026-11-25 19:08:41 -08:00
BFlat d7977fc26c Merge pull request #2598 from dotCooCoo/feat/audio-vorbis-wav-order
craft-audio: vorbis::wav_order and vorbis::layout map decoded channels to WAV order
2026-11-26 10:03:47 +07:00
aiongg 79c5c887ae tests: is_multiple_of for the gate-sample strides 2026-11-24 20:34:27 +00:00
aiongg b0695c24f7 craft-audio tests: hostile sweeps run 1/N at the gate, encoder mode sweeps use 1 s signals 2026-11-24 19:48:08 +00:00
el-j c59c4c7d3a Reject unsupported bit depths in SMPTE 302M header frame_bytes 2026-11-23 16:43:04 +01:00
el-j 9a6c56a97e Merge remote-tracking branch 'origin/main' into feat/audio-s302m 2026-11-23 16:41:51 +01:00
alehel 84710336ce docs(audio): clarify packet encoder memory bounds 2026-11-23 10:15:27 +01:00
alehel 8823b00c20 Merge main and preserve packet encoding and FLAC decoding modules 2026-11-23 08:28:35 +01:00
aiongg cf35f7dbae Merge remote-tracking branch 'upstream/main' into next-sync-1123
# Conflicts:
#	Cargo.toml
#	crates/audio/src/track.rs
2026-11-23 01:29:52 +00:00
Terra854 6a061a30bd audio: decode FLAC frames through TrackDecoder (#2868)
* audio: decode FLAC frames through TrackDecoder

* audio: keep FLAC state out of the decoder enum layout
2026-11-21 14:04:27 -05:00
dotCooCoo 20a4c50d45 craft-audio: repair_wav refuses a short first ds64 and writes the pad byte last
The WAV reader takes an RF64 file's data size from the first ds64 chunk of
16 bytes or more. repair_wav skipped a first ds64 chunk under 28 bytes and
wrote the sizes into a later one, so the frame count it returned differed
from what decoding gave. It now returns Malformed for a first ds64 chunk of
16 to 27 bytes, before writing anything.

repair_wav wrote the pad byte of odd-length data before the size fields. A
write error after the pad left 8-bit mono data of even length with the old
size, which a second repair refused. The pad byte is now written last.
2026-11-20 15:56:01 -08:00
dotCooCoo 40a85523df craft-audio: repair_wav refuses the extensible fmt fields the reader refuses
An extensible fmt chunk with a cbSize below 22, or with more valid bits
than bits per sample, passed repair_wav's checks and was rewritten,
while the WAV reader rejects it as malformed. repair_wav now returns
AudioError::Malformed for both, and its docs list the case.
2026-11-20 15:23:42 -08:00
dotCooCoo 21d0cd6a4a craft-audio: repair_wav and the WAV reader use the first ds64 and fact chunks
An RF64 file with a second ds64 chunk before its data had repair_wav
write the 24-byte size table over the start of that later chunk, leaving
the leading ds64 with its stale sizes, and the reader took the data size
from the last ds64 it met. EBU Tech 3306 places ds64 first after WAVE,
and both now use the first one. repair_wav also writes the frame count
into the first fact chunk instead of the last.
2026-11-20 15:13:20 -08:00
dotCooCoo 53df8e8c07 craft-audio: repair_wav refuses sample widths the WAV reader cannot decode
repair_wav accepted any bit width for PCM and IEEE float, so a 16-bit
float file or PCM wider than 32 bits had its sizes rewritten and was
reported repaired, though the WAV reader still refuses it. repair_wav
now returns Unsupported unless the file is PCM of 1 to 32 bits or float
of 32 or 64 bits, the widths the reader decodes, and leaves the file
unchanged.
2026-11-20 14:44:15 -08:00
dotCooCoo 3228207a0a craft-audio: repair_wav finishes an interrupted RF64 promotion
When repair_wav turns a RIFF file past 4 GiB into RF64, it renames the
JUNK chunk after WAVE to ds64 before it writes RF64. A write error
between the two left a RIFF file with a ds64 chunk there, and every
later repair returned TooLarge. repair_wav now takes a 28-byte ds64
chunk right after WAVE in a RIFF file as the slot to promote.

In a RIFF file, a ds64 chunk further on is no longer used. Before, a
later ds64 chunk took the place of the leading JUNK chunk, so the file
became RF64 with JUNK as its first chunk and the later chunk's table
length was set to 0.
2026-11-20 11:34:58 -08:00
dotCooCoo d24067aac4 craft-audio: repair_wav reads Ambisonic PCM and empties the ds64 table
repair_wav refused an extensible WAV with the Ambisonic PCM or float
subformat, which the WAV reader reads as PCM. The Ambisonic GUID tail
now lives with the other shared WAVE constants and both sides check it.

When a RIFF file past 4 GiB becomes RF64, the last 4 bytes of the
leading JUNK chunk become the ds64 table length. repair_wav wrote only
the first 24 bytes, so a JUNK chunk holding other bytes left a table
length that names entries the file does not have. It now writes a
table length of 0.
2026-11-20 11:21:15 -08:00
dotCooCoo 91ef7aaf78 craft-audio: spell center in American English in the vorbis::layout doc comment 2026-11-20 11:16:36 -08:00
dotCooCoo 5d9da61dae craft-audio: repair_wav docs name each field it rewrites and every error
The repair_wav doc comment said every chunk before the data keeps its
contents, but repair rewrites the frame count in a fact chunk, the start
of an existing ds64 chunk, and turns the leading 28-byte JUNK chunk into
ds64 when a RIFF file passes 4 GiB. It now lists the fields it writes
and the bytes it leaves alone. The Errors section now names every case:
Malformed also for the data chunk before fmt, a short fmt chunk, 0
channels or bits, a block size that does not match, no data chunk in the
first 100,000 chunks, and RF64 without ds64; Unsupported for an
extensible format whose subformat is not PCM or float; and Io.
2026-11-20 11:11:10 -08:00
dotCooCoo 16db9400e1 craft-audio: repair_wav rewrites the sizes of a WAV left unfinished by a crash
A recorder that writes the WAV header first and rewrites it as the file
grows leaves stale RIFF, data, ds64 and fact sizes when the process dies.
repair_wav walks the chunks up to the data chunk, counts the whole frames
the file holds and rewrites those fields in place, keeping bext and every
other chunk. It writes the pad byte an odd data length needs, turns a file
past 4 GiB into RF64 when it starts with the JUNK chunk FileEncoder and
wav_float_header reserve, and returns the frame count and the length to
truncate the file to. A finished file is left as it is. Compressed formats,
headers whose block size does not match the channels and bit depth, and
unfinished 8-bit mono data of even length (where a pad byte cannot be told
from a sample) are refused.
2026-11-20 10:55:51 -08:00
dotCooCoo 41920cf890 craft-audio: wav_float_header_with_bwf writes a growing float WAV with a bext chunk
wav_float_header always wrote its header without BWF metadata, so a recorder
that wanted a bext chunk had to splice one into the returned bytes at a fixed
offset. wav_float_header_with_bwf takes a BwfInfo and writes the same header
with the bext chunk in place. Its length still does not depend on the frame
count, so the header is rewritten in place as the file grows, and the finished
file matches encode() with the same BWF metadata byte for byte.
2026-11-20 10:36:32 -08:00
dotCooCoo 843cb77484 craft-audio: vorbis::wav_order and vorbis::layout map decoded channels to WAV order
The Vorbis decoder returns channels in Vorbis I order (L C R ... LFE), and
the rest of craft-audio works in WAV order. vorbis::wav_order(channels)
gives the reorder for 3, 5, 6, 7 and 8 channels, and vorbis::layout(channels)
gives the speakers of the result. For 7 channels the layout is 6.1 with a
back center and side surrounds, which ChannelLayout::default_for(7) does
not give.
2026-11-20 10:34:25 -08:00
aiongg ca58dfe6c9 Merge storytold main into next (19 Nov sync)
Merges main at d7c9632bfb.

- Cargo.toml: both sides' new workspace crates (next's font-subset, harfbuzz-subset-sys and
  host; main's gpu, gpu-null, gpu-providers and gpu-wgpu).
- crates/jpeg: next split lib.rs into modules; main's reduced-size decoding goes to them: the
  scaled IDCT, reconstruction and render_scaled to idct.rs, MAX_SHRINK, reduced_estimate and
  decode_reduced stay public in lib.rs. Main's new test added; the frame test next removed
  stays removed.
- crates/audio, crates/media: next builds the integration tests into the library's test
  executable (autotests off, tests/main.rs); main's new DSD and MPEG-TS mux tests are modules
  there behind their features instead of [[test]] targets, and the mux tests reach their shared
  helper module through the integration module.
- crates/media/src/matroska/track.rs: main's new FFV1 codec-parameter test added; the test
  modules next removed stay removed.
- crates/file-formats: main's JXL capability test, which asks the codec whether JXL reads,
  replaces next's interim check.
2026-11-19 16:22:24 +00:00
el-j 123878b446 Merge origin/main into feat/audio-s302m 2026-11-19 16:51:37 +01:00
el-j df2dcced49 craft-audio: cover 20-bit in s302m oracle tests and clean up unused binding 2026-11-19 09:50:52 +01:00
el-j 7b1a8f4515 craft-audio: validate DSF container bounds and DSDIFF channel counts (#1787) 2026-11-19 09:26:19 +01:00
ljkx cec20449a2 fix(audio): an empty WAV data chunk before a LIST chunk is no audio (#2123) (#2246)
A `data` chunk of size 0 counted as empty only when the RIFF size matched
the file. A writer that appends a `LIST` chunk after writing the RIFF size
leaves it stale, so the reader took the file for an unfinished recording
and decoded the `LIST` chunk's bytes as samples (8 frames of noise instead
of none).

A size-0 `data` chunk is now also empty when whole chunks follow it and the
first one has an id that follows audio (LIST, bext, cue, JUNK, ...). A
recording that was never finalised (PCM after the header) and bytes that
only start like a chunk still decode as audio.
2026-11-18 15:30:49 -05:00
el-j e20290fb43 Check padding addition for DSDIFF size calculation 2026-11-18 21:23:33 +01:00
el-j 4e6a89f006 audio: bound s302m Header::frame_bytes arithmetic against overflow 2026-11-18 21:11:24 +01:00
el-j 669c839251 audio: DSD review fixes (DSDIFF text and padding, channel layouts, ID3 decoding, factor-64 decimation) 2026-11-18 19:45:16 +01:00
el-j 3478b2099b Merge main into feat/audio-s302m 2026-11-18 19:40:56 +01:00
el-j f771b496fa Merge main into feat/audio-dsd 2026-11-18 19:40:45 +01:00
aiongg 4d22e6b958 Merge storytold main d6b5b16bbb into next (18 Nov sync)
- Workflows: main's per-crate layout, with next in the push triggers, Linux only for pushes to
  next, next's crate features (keymap egui, window and update ui) and test paths (crw samples and
  the pdf fixtures run inside the lib's test binary). The workspace gate keeps --keep-going and
  the facade-as-an-app clippy from next's ui.yml. Per-crate doc steps live in docs.yml, which also
  documents craft-ui, the ui-* crates, craft-doc and craft-pdf with every feature. docpath, i18n,
  print and ui workflows go, as on main. actions.lock lists docs.yml and theme.yml.
- Main's cloud and share UI (account, cloud, share, presence, the overflow menu and split button)
  lives in the new crate craft-cloud-ui as main wrote it; the craft-ui facade forwards share and
  cloud and re-exports account, cloud, share and presence, so craft-cloud-local builds unchanged.
- audio and media: main's new tests join tests/main.rs under their features.
- cms: main's new synth and FOGRA39 tests, with the fogra39() helper they use.
- nextest: no gpu group on unix; next's tests create no GPU device.
2026-11-18 01:22:22 +00:00
alehel 618423d68d Merge remote-tracking branch 'origin/main' into apply-1378c
# Conflicts:
#	crates/audio/Cargo.toml
2026-11-17 18:53:19 +01:00
el-jandDylan M. Taylor 0649a07aa1 craft-audio: ITU-T G.726 ADPCM speech codec (#1531) (#1792)
* craft-audio: ITU-T G.726 ADPCM speech codec (#1531)

* fix(audio): mask G726 sample codewords before adaptation

---------

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-17 12:15:52 -05:00
Dylan M. Taylor 2d6d39f1a9 Merge pull request #1959 from el-j/feat/audio-vorbis-decode
craft-audio: native Vorbis I decoder (#1547)
2026-11-17 11:55:19 -05:00
Dylan M. Taylor 25a882c1ce fix(audio): stop DSF audio at the declared data chunk 2026-11-17 10:12:56 -05:00
Dylan M. Taylor cbbba064fd Merge remote-tracking branch 'origin/main' into fix/dsd-chunk-bounds
# Conflicts:
#	crates/audio/Cargo.toml
#	crates/audio/src/lib.rs
2026-11-17 09:58:22 -05:00
Dylan M. Taylor 00048fdadf Merge remote-tracking branch 'origin/main' into fix/vorbis-codebook-size
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-17 09:08:44 -05:00
Dylan M. Taylor 363a51967b fix(audio): bound Vorbis decode allocations and strengthen oracles 2026-11-17 09:07:52 -05:00
Dylan M. Taylor e5db2c26b9 Merge remote-tracking branch 'origin/main' into fix/adpcm-layout-overflow
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-17 09:01:31 -05:00