/** * @param track Audio track to play * @param configuration Configuration for audio processing * @param remoteNodeManager Manager of remote nodes * @param volumeLevel Mutable volume level */ public RemoteAudioTrackExecutor(AudioTrack track, AudioConfiguration configuration, RemoteNodeManager remoteNodeManager, AtomicInteger volumeLevel) { this.track = track; this.configuration = configuration.copy(); this.remoteNodeManager = remoteNodeManager; this.volumeLevel = volumeLevel; this.executorId = System.nanoTime(); this.frameBuffer = configuration.getFrameBufferFactory().create(BUFFER_DURATION_MS, configuration.getOutputFormat(), null); }
/** * @param audioTrack The audio track that this executor executes * @param configuration Configuration to use for audio processing * @param playerOptions Mutable player options (for example volume). * @param useSeekGhosting Whether to keep providing old frames continuing from the previous position during a seek * until frames from the new position arrive. * @param bufferDuration The size of the frame buffer in milliseconds */ public LocalAudioTrackExecutor(InternalAudioTrack audioTrack, AudioConfiguration configuration, AudioPlayerOptions playerOptions, boolean useSeekGhosting, int bufferDuration) { this.audioTrack = audioTrack; AudioDataFormat currentFormat = configuration.getOutputFormat(); this.frameBuffer = configuration.getFrameBufferFactory().create(bufferDuration, currentFormat, queuedStop); this.processingContext = new AudioProcessingContext(configuration, frameBuffer, playerOptions, currentFormat); this.useSeekGhosting = useSeekGhosting; }