Skip to content

IAudioSource

interface IAudioSource
Known subtypes: AlAudioSource, SnapshotAudioSource
Package: dev.joid.lib.bridge.audio · Module: core · Source: IAudioSource.java

One stream of 16-bit samples that the video player fills ahead of the clock and plays.

The video player calls every method on the render thread.

ReturnsSignatureSummary
voiddelete() abstractStops the source and releases what the audio API allocated for it.
voidplay() abstractStarts the source, or resumes it after pause().
voidstop() abstractStops the source and drops the samples that it has not played.
voidpause() abstractPauses the source and keeps its queued samples for play().
voidgain(float gain) abstractSets the volume, 1F for 100 %; 0F mutes the source while its samples keep flowing.
voidgroup(Object group) abstractReceives the audio group that the application gave the video, or null for none; the source maps it to a volume of the host.
voidwrite(short[] samples) abstractAppends interleaved samples to the queue of the source.
booleanisPlaying() abstractIf true, the source is playing.
intgetBufferedSamples() abstractReturns the number of interleaved samples written and not played yet, counted on the channels that the source queues (stereo after a downmix).

void delete() abstract

Stops the source and releases what the audio API allocated for it.

void play() abstract

Starts the source, or resumes it after pause().

void stop() abstract

Stops the source and drops the samples that it has not played.

void pause() abstract

Pauses the source and keeps its queued samples for play().

void gain(float gain) abstract

Sets the volume, 1F for 100 %; 0F mutes the source while its samples keep flowing.

void group(Object group) abstract

Receives the audio group that the application gave the video, or null for none; the source maps it to a volume of the host.

void write(short[] samples) abstract

Appends interleaved samples to the queue of the source. A playing source whose queue ran dry plays again.

boolean isPlaying() abstract

If true, the source is playing.

int getBufferedSamples() abstract

Returns the number of interleaved samples written and not played yet, counted on the channels that the source queues (stereo after a downmix).


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page