1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 21:47:43 +00:00

LibAudio: Allow loading sounds from memory

The Loader and WavLoaderPlugin classes now have methods for loading
from a ByteBuffer, in addition to streaming from disk.
This commit is contained in:
Julian Offenhäuser 2020-12-02 15:44:45 +01:00 committed by Andreas Kling
parent dff5983706
commit 21977a2188
5 changed files with 110 additions and 154 deletions

View file

@ -36,4 +36,12 @@ Loader::Loader(const StringView& path)
m_plugin = nullptr;
}
Loader::Loader(const ByteBuffer& buffer)
{
m_plugin = make<WavLoaderPlugin>(buffer);
if (m_plugin->sniff())
return;
m_plugin = nullptr;
}
}