Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also added the necessary plumbing to load from RAM.
It's missing AIFF, and metadata reading since those API are heavily file-based for now.
Note that this is not exactly what's proposed in #91, since the goal is also to allow to "copy" these embedded samples as printable characters (e.g. in an edit box on the web, or a pastebin).
The syntax is as follows:
Samples like this will be loaded fully in RAM; I made some modifications to the file pool to check both "fully loaded" and preloaded files on requests, which wasn't the case before.
The
encoding=base64
is required to try and keep a compatibility path with the Rapture encoding mentioned in #91 down the line.When reading an opcode value, the parser now behaves differently if the opcode name is
data
: it will ignore comments since base64 has the/
sign, and will only stop on EOF, a new<
character, or a new#
character.The underlying base64 decoder ignores whitespace, and can support optional padding with
=
.Now that I think about it and write it down, it's not going to be compatible as is with #91 because the parser for the latter stops at a different character (
$
). Maybe a different opcode name (e.g.base64data=
anddata=
) to allow the parser to parse these items differently? @jpcima, your thoughts?Missing or would-be-nice, possibly for further PRs:
AudioReader
to read the raw data directly, regardless of the source. This part was not obvious when I refactored this so for the time being only basic metadata will be read mostly for WAV files. Once done, thepath
parameter added to theAudioReader
constructors is unneeded.