mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
LibAudio: Use ByteBuffer::slice_view() to avoid double memory usage.
We only need a temporary copy for passing to ABuffer::from_pcm_data().
This commit is contained in:
parent
6f397e23f1
commit
be1025c03f
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ RefPtr<ABuffer> AWavLoader::parse_wav(ByteBuffer& buffer)
|
|||
// Just make sure we're good before we read the data...
|
||||
ASSERT(!stream.handle_read_failure());
|
||||
|
||||
auto sample_data = buffer.slice(stream.offset(), data_sz);
|
||||
auto sample_data = buffer.slice_view(stream.offset(), data_sz);
|
||||
|
||||
dbgprintf("Read WAV of format PCM with num_channels %d sample rate %d, bits per sample %d\n", num_channels, sample_rate, bits_per_sample);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue