- Call the API to get media URI templates
- Generate a federated session token for WAN playback
- Download the DASH MPD and audio segments
- Optionally convert the resulting Opus/WebM audio using ffmpeg
Prerequisites
All API calls in this guide use the following authentication headers:Base URL:
https://api2.rhombussystems.com- An A100 Audio Gateway UUID (Rhombus DeviceFacetUuid / RUUID style string)
- Recorded audio that exists and is available (determined by your device licensing and recording configuration)
- A client capable of:
- Making HTTP requests
- Parsing XML (for the MPD manifest)
- Writing binary segment bytes to disk
Implementation Steps
Get the A100 Audio Gateway Media URIs
Call the Relevant response fields:
getMediaUris endpoint to retrieve the URI templates for your audio gateway.Endpoint: POST /api/audiogateway/getMediaUris| Field | Description |
|---|---|
wanVodMpdUriTemplate | WAN VOD MPD template (use this for recorded audio over WAN) |
wanLiveOpusUri | WAN live Opus stream URI |
wanLiveMpdUri | WAN live MPD URI |
lanVodMpdUrisTemplates | LAN VOD templates |
Generate a Federated Session Token
WAN MPD access requires a short-lived federated session token appended as query parameters.Endpoint: Response: Returns
POST /api/org/generateFederatedSessionTokenfederatedSessionTokenBuild the WAN VOD MPD URL
Take the
wanVodMpdUriTemplate from Step 1 and perform string substitution:- Replace
{START_TIME}with your requested start time (in seconds) - Replace
{DURATION}with your requested duration (in seconds)
Fetch the MPD with the Federated Token
Append the authentication query parameters to your MPD URL:This MPD is a DASH manifest that describes how to fetch the init segment and subsequent audio segments.
Download and Stitch Segments
Download the segments in order:Write the init header bytes followed by each segment’s bytes to produce a valid WebM/Opus audio file (48 kHz, mono).
- Init segment (e.g.,
seg_init_audio.hdr) - Media segments (e.g.,
seg_1.webm,seg_2.webm, …)
Segments are 2 seconds each. Calculate the number of segments:
Complete Python Example
This example implements the full workflow described above:Converting Audio with ffmpeg
The downloaded audio is in Opus/WebM format (48 kHz, mono). You can convert it to other formats using ffmpeg:Troubleshooting
Empty manifests or missing segments
Empty manifests or missing segments
Cause: Template substitution uses wrong time units.Solution: If your timestamps are in milliseconds but the template expects seconds, convert them:
MPD rewrite doesn't match your template
MPD rewrite doesn't match your template
Cause: The code assumes the MPD filename is
file.mpd.Solution: If your template uses a different filename, adjust the string replacement logic:Token expires before download completes
Token expires before download completes
Cause: The federated token duration is too short for large audio pulls.Solution: Increase
durationSec when generating the token. For 24-hour pulls, you may need significantly longer durations to fetch all segments.API Reference
The following endpoints are used in this guide. Visit the API Reference tab for full request and response schemas.POST /api/audiogateway/getMediaUris— Get Media URIs for Audio GatewayPOST /api/org/generateFederatedSessionToken— Generate Federated Session Token