Uploading Recordings
This guide covers best practices for uploading audio recordings to the IdentityCall API.
Supported Formats
| Format | Extension | Max Size | Notes |
|---|---|---|---|
| MP3 | .mp3 | 100 MB | Most common, good compression |
| WAV | .wav | 500 MB | Uncompressed, highest quality |
| M4A | .m4a | 100 MB | Apple format, good quality |
| OGG | .ogg | 100 MB | Open source format |
| FLAC | .flac | 500 MB | Lossless compression |
| WebM | .webm | 100 MB | Web-native format |
Audio Quality Recommendations
For best transcription results:
- Sample Rate: 16kHz or higher
- Bit Depth: 16-bit or higher
- Channels: Mono or stereo (stereo may improve speaker diarization)
- Bit Rate: 128kbps or higher for compressed formats
Higher quality audio generally produces better transcription accuracy. If possible, use uncompressed or lossless formats.
Uploading Files
Basic Upload
cURL
curl -X POST "https://api.identitycall.com/api/v1/public/recordings" \
-H "Authorization: Bearer $IDENTITYCALL_API_KEY" \
-F "file=@recording.mp3" \
-F "language=en"Upload with Progress Tracking
For large files, track upload progress:
Python
import requests
from requests_toolbelt import MultipartEncoderMonitor
def upload_with_progress(file_path, api_key):
def callback(monitor):
progress = monitor.bytes_read / monitor.len * 100
print(f"\rUploading: {progress:.1f}%", end="")
with open(file_path, "rb") as f:
encoder = MultipartEncoder(fields={
"file": ("recording.mp3", f, "audio/mpeg"),
"language": "en"
})
monitor = MultipartEncoderMonitor(encoder, callback)
response = requests.post(
"https://api.identitycall.com/api/v1/public/recordings",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": monitor.content_type
},
data=monitor
)
print("\nUpload complete!")
return response.json()Handling Large Files
For files approaching the size limit:
- Compress if possible: Convert WAV to FLAC for lossless compression
- Split long recordings: Break into smaller segments if over the limit
- Use streaming upload: Prevent memory issues with large files
Files exceeding the size limit will be rejected with a 422 error.
Error Handling
Common upload errors and solutions:
| Error | Cause | Solution |
|---|---|---|
| ”file is required” | No file in request | Ensure file is included in multipart form |
| ”Invalid file type” | Unsupported format | Convert to a supported format |
| ”File too large” | Exceeds size limit | Compress or split the file |
| ”Upload timeout” | Slow connection | Retry with smaller file or better connection |