@Override public AudioFrame provide() { return provide(0, TimeUnit.MILLISECONDS); }
@Override public void assignExecutor(AudioTrackExecutor executor, boolean applyPrimordialState) { if (executorAssigned.compareAndSet(false, true)) { if (applyPrimordialState) { initialExecutor.applyStateToExecutor(executor); } activeExecutor = executor; } else { throw new IllegalStateException("Cannot play the same instance of a track twice, use track.makeClone()."); } }
/** * @param trackInfo Track info */ public BaseAudioTrack(AudioTrackInfo trackInfo) { this.initialExecutor = new PrimordialAudioTrackExecutor(trackInfo); this.executorAssigned = new AtomicBoolean(); this.activeExecutor = null; this.trackInfo = trackInfo; this.accurateDuration = new AtomicLong(); }