Skip to main content
For cases when your audio file is not publicly accessible, you can upload it to the pyannoteAI servers using the Media APIs. This tutorial shows you how to upload your audio files to a temporary storage location and use it to diarize your audio.
Some notes on using the Media APIs:
  • Temporary: The audio files you upload are only temporarily stored and will be automatically removed within 48 hours.
  • Secure: The media is stored in an isolated location that only you can access with your API token. It is encrypted while in transit with HTTPS. Access to the production system is controlled to prevent unauthorized use.

1. Create a storage location and get a pre-signed PUT URL

First, you need to create a temporary storage location by sending a value for the url parameter. This endpoint returns a pre-signed PUT URL that you can use to upload your audio file. The url should be in the form media://object-key where the object-key can be any alpha-numeric string you choose to identify your file. The object-key is unique to your team, meaning no other team can access files stored under your object keys. For example:
  • media://my-audio-file-123
  • media://meetings/2024-01-15/call.wav
  • media://customer_conversation_20240115
You’ll use this key to refer to your uploaded file in subsequent API requests (e.g. diarization).
uploadAudio.ts

2. Diarize your uploaded audio file

After you have uploaded your audio file, you can use it in e.g. a diarization job by providing the media key you created earlier as URL in the input.
createJob.ts
Great! You have successfully uploaded your audio file and used it to create a diarization job. See the diarization tutorial for more details on how to process the diarization results.

API Reference