mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 11:23:45 +02:00
FLAC: Add appendOnly option for FlaxMuxer, fix FlacDemuxer reading it (#325)
* implement in FlacOutputFormatOptions * implement in flac-muxer.ts * Fix demuxer: Handle minimumFrameSize = 0, maxiumFrameSize = 0 * add a test * Update flac-demuxer.ts * Update flac.test.ts * clean up comments for minima and maxima * Add FlacOutputFormatOptions.appendOnly to docs --------- Co-authored-by: Vanilagy <[email protected]>
This commit is contained in:
@@ -303,9 +303,16 @@ const output = new Output({
|
||||
The following options are available:
|
||||
```ts
|
||||
type FlacOutputFormatOptions = {
|
||||
appendOnly?: boolean;
|
||||
|
||||
onFrame?: (data: Uint8Array, position: number) => unknown;
|
||||
};
|
||||
```
|
||||
- `appendOnly`\
|
||||
Configures the output to only append new data at the end, useful for live-streaming the file as it's being created. When enabled, the STREAMINFO block will not be finalized with accurate min/max block sizes, frame sizes, or total sample count, so don't use this option when you want to write out a clean file for later use.
|
||||
::: info
|
||||
This option ensures [append-only writing](#append-only-writing).
|
||||
:::
|
||||
- `onFrame`\
|
||||
Will be called for each FLAC frame that is written.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user