Exoplayer: Unable to play MIDI files

Created on 23 May 2018  路  2Comments  路  Source: google/ExoPlayer

I am trying to play a MIDI file using ExoPlayer, but it doesn't seem to be working:

05-22 17:57:20.676 E/ExoPlayerImplInternal: Source error.
    com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor) could read the stream.
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractorHolder.selectExtractor(ExtractorMediaPeriod.java:931)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:853)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:317)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)

I understand that MIDI files may not be supported at the moment, but is there any plans to add support? If not, do you have any tips on how to write that functionality myself? It seems to work when I use the native Android MediaPlayer

question

All 2 comments

It isn't supported and there is no plan to support it unfortunately. You can take a look at FlacDecoder or OpusDecoder which are extension audio decoders to write one for MIDI but be warned it isn't a simple thing.

@erdemguven It's not funny! Even MediaPlayer from Android SDK is able to play MIDI. I migrated to Exoplayer and now discovered that this new shiny thing is so dummy.

Was this page helpful?
0 / 5 - 0 ratings