mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibAudio: WAV: Don't emit the very last sample in each decoded batch.
This is a total hack, because I haven't really looked into why these are happening. Somehow we're producing one extra sample and it's glitching up the sound stream ever so slightly.
This commit is contained in:
parent
be31e2232c
commit
b44d3faa1c
1 changed files with 5 additions and 0 deletions
|
@ -257,5 +257,10 @@ RefPtr<ABuffer> ABuffer::from_pcm_data(ByteBuffer& data, int num_channels, int b
|
|||
// don't belong.
|
||||
ASSERT(!stream.handle_read_failure());
|
||||
|
||||
// HACK: This is a total hack to remove an unnecessary sample at the end of the buffer.
|
||||
// FIXME: Don't generate the extra sample... :^)
|
||||
for (int i = 0; i < 1; ++i)
|
||||
fdata.take_last();
|
||||
|
||||
return ABuffer::create_with_samples(move(fdata));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue