.. _audio: ===== Audio ===== Learn how to turn audio into text or text into audio with Xinference. Introduction ================== The Audio API provides three methods for interacting with audio: * The transcriptions endpoint transcribes audio into the input language. * The translations endpoint translates audio into English. * The speech endpoint generates audio from the input text. .. list-table:: :widths: 25 50 :header-rows: 1 * - API ENDPOINT - OpenAI-compatible ENDPOINT * - Transcription API - /v1/audio/transcriptions * - Translation API - /v1/audio/translations * - Speech API - /v1/audio/speech Supported models ------------------- The audio API is supported with the following models in Xinference: Audio to text ~~~~~~~~~~~~~ * :ref:`whisper-tiny ` * :ref:`whisper-tiny.en ` * :ref:`whisper-base ` * :ref:`whisper-base.en ` * :ref:`whisper-medium ` * :ref:`whisper-medium.en ` * :ref:`whisper-large-v3 ` * :ref:`whisper-large-v3-turbo ` * :ref:`Belle-distilwhisper-large-v2-zh ` * :ref:`Belle-whisper-large-v2-zh ` * :ref:`Belle-whisper-large-v3-zh ` * :ref:`SenseVoiceSmall ` * :ref:`Paraformer-zh ` For Mac M-series chips only: * :ref:`whisper-tiny-mlx ` * :ref:`whisper-tiny.en-mlx ` * :ref:`whisper-base-mlx ` * :ref:`whisper-base.en-mlx ` * :ref:`whisper-medium-mlx ` * :ref:`whisper-medium.en-mlx ` * :ref:`whisper-large-v3-mlx ` * :ref:`whisper-large-v3-turbo-mlx ` Text to audio ~~~~~~~~~~~~~ * :ref:`ChatTTS ` * :ref:`CosyVoice-300M-SFT ` * :ref:`CosyVoice-300M ` * :ref:`CosyVoice-300M-Instruct ` * :ref:`CosyVoice 2.0 ` * :ref:`FishSpeech-1.5 ` * :ref:`F5-TTS ` * :ref:`MegaTTS3 ` * MeloTTS series For Mac M-series chips only: * :ref:`F5-TTS-MLX ` Quickstart =================== Transcription -------------------- The Transcription API mimics OpenAI's `create transcriptions API `_. We can try Transcription API out either via cURL, OpenAI Client, or Xinference's python client: .. tabs:: .. code-tab:: bash cURL curl -X 'POST' \ 'http://:/v1/audio/transcriptions' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "model": "", "file": "