In the kira audio library, there are the StaticSoundData and StreamingSoundData types. StaticSoundData decodes the entire audio file in advance, whereas StreamingSoundData decodes frames on demand (using a background thread and a ring buffer).
In web_audio_api, the equivalent to StaticSoundData is decode_audio_data_sync. The closest equivalent to StreamingSoundData seems to be MediaElement. However, MediaElement only supports loading files from disk, whereas kira also supports in-memory byte streams (any std::io::Cursor).
Would it be possible to add support for loading any stream (not just files) from MediaElement? If so, what should the API look like?
In the kira audio library, there are the
StaticSoundDataandStreamingSoundDatatypes.StaticSoundDatadecodes the entire audio file in advance, whereasStreamingSoundDatadecodes frames on demand (using a background thread and a ring buffer).In
web_audio_api, the equivalent toStaticSoundDataisdecode_audio_data_sync. The closest equivalent toStreamingSoundDataseems to beMediaElement. However,MediaElementonly supports loading files from disk, whereas kira also supports in-memory byte streams (anystd::io::Cursor).Would it be possible to add support for loading any stream (not just files) from
MediaElement? If so, what should the API look like?