AnalyzingCallback

class AnalyzingCallback(analyzer: AudioAnalyzer, delegate: AudioStreamCallback? = null, scope: CoroutineScope) : AudioStreamCallback

Constructors

Link copied to clipboard
constructor(analyzer: AudioAnalyzer, delegate: AudioStreamCallback? = null, scope: CoroutineScope)

Properties

Link copied to clipboard
val results: SharedFlow<AudioAnalysisResult>

Functions

Link copied to clipboard
fun close()

Stops the analysis worker. Safe to call more than once.

Link copied to clipboard
open override fun onAudioReady(buffer: FloatArray, numFrames: Int): Int

Copies interleaved frames into a reused scratch buffer. The analysis worker snapshots that buffer on Dispatchers.Default so this callback does not allocate except when the scratch must grow.

Link copied to clipboard
open override fun onStreamError(stream: AudioStream, error: KlarinetException)
Link copied to clipboard
open override fun onStreamStateChanged(stream: AudioStream, state: StreamState)
Link copied to clipboard
open override fun onStreamUnderrun(stream: AudioStream, count: Int)