ExoPlayer
ExoPlayer copied to clipboard
support multi audio track playback
I using MergeDataSource which have a videoUrl 3 three audoUrl to play . and I want to two audioUrl play at the same time . Refer to those link How to Controls multi-track playback Synchronizing Playing Multiple Audio
I find that can't overide DefaultTrackSelector some function, there more function is private. can supply some way?
I want video and two audio can play at the same. one audio track can select track.
public final TrackSelectorResult selectTracks(
for (int groupIndex = 0; groupIndex < trackGroups.length; groupIndex++) {
TrackGroup group = trackGroups.get(groupIndex);
// Associate the group to a preferred renderer.
boolean preferUnassociatedRenderer =
MimeTypes.getTrackType(group.getFormat(0).sampleMimeType) == C.TRACK_TYPE_METADATA;
int rendererIndex =
findRenderer(
rendererCapabilities, group, rendererTrackGroupCounts, preferUnassociatedRenderer);
// Evaluate the support that the renderer provides for each track in the group.
@Capabilities
int[] rendererFormatSupport =
rendererIndex == rendererCapabilities.length
? new int[group.length]
: getFormatSupport(rendererCapabilities[rendererIndex], group);
// Stash the results.
int rendererTrackGroupCount = rendererTrackGroupCounts[rendererIndex];
rendererTrackGroups[rendererIndex][rendererTrackGroupCount] = group;
rendererFormatSupports[rendererIndex][rendererTrackGroupCount] = rendererFormatSupport;
rendererTrackGroupCounts[rendererIndex]++;
}
here only one AudioRender will be enable.
Playing two audio tracks at the same time requires having multiple audio renderers I think. This is far from trivial and is not something we can give you support for I'm afraid.
Best is probably picking up the comment you got in this issue.
I leave this open for a while in case someone from the community has some insights how to achieve this.