Analyzer¶
CREMA analyzer interface
-
crema.analyze.
analyze
(filename=None, y=None, sr=None)¶ Analyze a recording for all tasks.
Parameters: - filename : str, optional
Path to audio file
- y : np.ndarray, optional
- sr : number > 0, optional
Audio buffer and sampling rate
- .. note:: At least one of `filename` or `y, sr` must be provided.
Returns: - jam : jams.JAMS
a JAMS object containing all estimated annotations
Examples
>>> from crema.analyze import analyze >>> import librosa >>> jam = analyze(filename=librosa.ex('brahms')) >>> jam <JAMS(file_metadata=<FileMetadata(...)>, annotations=[1 annotation], sandbox=<Sandbox(...)>)> >>> # Get the chord estimates >>> chords = jam.annotations['chord', 0] >>> chords.to_dataframe().head(5) time duration value confidence 0 0.000000 3.622313 G:min 0.767835 1 3.622313 1.207438 C:min/5 0.652179 2 4.829751 1.207438 D:maj 0.277913 3 6.037188 4.086712 G:min 0.878656 4 10.123900 1.486077 D#:maj 0.608746