Saltar al contenido principal

Managing Your Audio Assets

Welcome to your audio asset command center! This guide will walk you through the entire lifecycle of your audio files—from uploading them to our secure storage to managing and analyzing them.

The Audio Asset Management API allows you to:

  • Upload audio from your device or a public URL.
  • Retrieve detailed metadata and information.
  • Stream audio directly for playback.
  • Update and delete your assets with ease.
Authentication

All endpoints require a valid Bearer token in the Authorization header.


Step 1: Upload Your Audio

To get started, you need to upload an audio file. This creates an asset_id that you'll use to reference the file in all future operations. You can upload a local file or point to a remote URL.

POST /v1/audio
# Upload an audio file directly from your machine.
curl -X POST https://api.essentia.upf.edu/v1/audio \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/your/audio.mp3"
Supported Formats

We support a wide range of audio formats, including mp3, wav, flac, ogg, and m4a.


Step 2: Manage and Access Your Audio

Once uploaded, you can retrieve metadata, stream the content, or update its information.

Get Audio Info

Fetch all available information for an asset, including its filename, size, and content type.

GET /v1/audio/<asset_id>
curl https://api.essentia.upf.edu/v1/audio/<asset_id> \
-H "Authorization: Bearer <token>"

Stream for Playback

Get a direct stream of the audio file, perfect for use in web players or other applications.

GET /v1/audio/<asset_id>/stream
# This example saves the stream to a local file.
curl https://api.essentia.upf.edu/v1/audio/<asset_id>/stream \
-H "Authorization: Bearer <token>" \
-o audio_playback.mp3

Update Metadata

Attach your own custom metadata to an audio asset.

PUT /v1/audio/<asset_id>
curl -X PUT https://api.essentia.upf.edu/v1/audio/<asset_id> \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"title": "My New Song Title", "artist": "The Vectors"}'

Step 3: Delete an Audio Asset

When you no longer need an asset, you can permanently remove it from storage.

This action is irreversible

Once an asset is deleted, it cannot be recovered.

DELETE /v1/audio/<asset_id>
curl -X DELETE https://api.essentia.upf.edu/v1/audio/<asset_id> \
-H "Authorization: Bearer <token>"

Next Steps

With your audio uploaded, you're ready for the next step: running powerful analyses.