MCPcopy Create free account
hub / github.com/allenai/OLMoASR / preprocess_audio

Method preprocess_audio

scripts/eval/eval.py:1438–1460  ·  view source on GitHub ↗

Legacy method for backwards compatibility. Delegates to AudioProcessor for audio preprocessing. Maintained for compatibility with existing code that may call this method directly. Args: audio_file (str): Path to audio file sr (int, optional): Target

(
        self, audio_file, sr=SAMPLE_RATE, start_time=None, end_time=None
    )

Source from the content-addressed store, hash-verified

1436
1437 # Keep original method for backwards compatibility
1438 def preprocess_audio(
1439 self, audio_file, sr=SAMPLE_RATE, start_time=None, end_time=None
1440 ):
1441 """Legacy method for backwards compatibility.
1442
1443 Delegates to AudioProcessor for audio preprocessing. Maintained for
1444 compatibility with existing code that may call this method directly.
1445
1446 Args:
1447 audio_file (str): Path to audio file
1448 sr (int, optional): Target sampling rate. Defaults to SAMPLE_RATE.
1449 start_time (Optional[float], optional): Start time for segmentation.
1450 end_time (Optional[float], optional): End time for segmentation.
1451
1452 Returns:
1453 Tuple[np.ndarray, np.ndarray]: Audio waveform and mel-spectrogram
1454
1455 Deprecated:
1456 Use AudioProcessor.load_and_preprocess_audio() directly instead.
1457 """
1458 return self.audio_processor.load_and_preprocess_audio(
1459 audio_file, sr, start_time, end_time, self.n_mels
1460 )
1461
1462
1463class WandBLogger:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected