def process_audio(
        self, wav_path: Union[Path, mx.array]
    ) -> Tuple[np.ndarray, mx.array]:
        """load auido and get reference audio from wav path"""
        if isinstance(wav_path, Path) or isinstance(wav_path, str):
            wav = load_audio(
                wav_path,
                sampling_rate=self.config["sample_rate"],
                volume_normalize=self.config["volume_normalize"],
            )
        elif isinstance(wav_path, mx.array):
            wav = wav_path
        else:
            raise ValueError(f"Invalid input type: {type(wav_path)}")

        wav_ref = self.get_ref_clip(wav)

        return wav, wav_ref[None, ...]
load auido and get reference audio from wav path
mlx_audio/tts/models/spark/audio_tokenizer.py