Android - Exoplayer 2 - simultaneously playing multiple sounds / sounds - MergingMediaSource

I use several instances of SimpleExoPlayer in my application to play an audio file (Wav file). I want to play all these files at once. Now there is a small gap between these files. Is it possible to have only one instance of SimpleExoPlayer with a large number of sound files?

I tried using MergingMediaSource , but now it works. It plays only one Wav file (not all).

the code:

  MediaSource ms = new MergingMediaSource(audioSources.toArray(new MediaSource[audioSources.size()])); mMediaPlayerTracker1.addListener(myExoPlayerEventListener); mMediaPlayerTracker1.prepare(ms); //Adding MediaSource to the ArrayList audioSources.add(new ExtractorMediaSource( Uri.fromFile(new File(path)), mediaDataSourceFactory, defaultExtractorsFactory, mainHandler, exoEventListener)); 
+6
source share

Source: https://habr.com/ru/post/1013133/


All Articles