1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:27:35 +00:00

LibAudio: Add a sample count hinting mechanism to audio encoding

This commit is contained in:
kleines Filmröllchen 2023-08-18 21:08:59 +02:00 committed by Andrew Kaster
parent 0960a92670
commit b4b411b8a3
2 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,10 @@ public:
// This method makes sure that all samples are encoded and written out.
// This method is called in the destructor, but since this can error, you should call this function yourself before disposing of the decoder.
virtual ErrorOr<void> finalize() = 0;
// Provides a hint about the total number of samples to the encoder, improving some encoder's performance in various aspects.
// Note that the hint does not have to be fully correct; wrong hints never cause errors, not even indirectly.
virtual void sample_count_hint([[maybe_unused]] size_t sample_count) { }
};
}