Adds key functionality for basic MIDI synthesization
- Add a MidiRenderer skeleton with basic playback - Add MidiDecoder with placeholder synthesizer (JSyn) impl - Make MidiExtractor feed placeholder data - Add Renderer extension loaders for MIDI PiperOrigin-RevId: 448212797
This commit is contained in:
parent
9b07d71f66
commit
2725b4c479
@ -484,6 +484,19 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
extensionRendererIndex--;
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> clazz = Class.forName("androidx.media3.decoder.midi.MidiRenderer");
|
||||
Constructor<?> constructor = clazz.getConstructor();
|
||||
Renderer renderer = (Renderer) constructor.newInstance();
|
||||
out.add(extensionRendererIndex++, renderer);
|
||||
Log.i(TAG, "Loaded MidiRenderer.");
|
||||
} catch (ClassNotFoundException e) {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating MIDI extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
// Full class names used for constructor args so the LINT rule triggers if any of them move.
|
||||
Class<?> clazz = Class.forName("androidx.media3.decoder.opus.LibopusAudioRenderer");
|
||||
|
Loading…
x
Reference in New Issue
Block a user