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:
parent
dff5983706
commit
21977a2188
5 changed files with 110 additions and 154 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue