OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
audio.music_analysis.music_analysis_session.MusicAnalysisSession Class Reference

Own one analyzer, one selected capture, and one calibration profile. More...

Public Member Functions

tuple[str,...] sources (self)
 Return registered source identifiers in presentation order.
 
dict[str, object] select (self, str source)
 Select a source without starting it, stopping the previous one.
 
dict[str, object] start (self, str|None source=None)
 Start the selected source, or select and start a named source.
 
dict[str, object] stop (self, *str|None source=None)
 Stop capture, optionally only when a named source is still selected.
 
dict[str, object] push_pcm16 (self, bytes audio, int sample_rate_hz, *str source="browser")
 Decode a little-endian PCM16 frame from the selected push source.
 
dict[str, object] push (self, Sequence[float] samples, int sample_rate_hz, *str source)
 Accept normalized PCM from an external capture transport.
 
dict[str, object] state (self)
 Return raw analyzer state and source/calibration lifecycle status.
 
dict[str, object] start_zeroize (self)
 Collect ambient-noise frames from the currently running source.
 
dict[str, object] finish_zeroize (self)
 Commit the collected noise profile, or report an empty collection.
 
dict[str, object] clear_zeroize (self)
 Discard calibration and reset the analyzer's adaptive state.
 

Detailed Description

Own one analyzer, one selected capture, and one calibration profile.

Factories are supplied by platform composition. Source changes clear the noise profile and adaptive state. Lifecycle operations are serialized and callbacks from previous capture generations are ignored. Consumers receive raw MusicAnalysisState, never presentation-gained values.


The documentation for this class was generated from the following file: