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.
Description
Section titled “Description”The video player calls every method on the render thread.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
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). |
Method details
Section titled “Method details”delete
Section titled “delete”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.
isPlaying
Section titled “isPlaying”boolean isPlaying() abstract
If true, the source is playing.
getBufferedSamples
Section titled “getBufferedSamples”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
