The problem
A plain transcript can merge several people into one voice. An agent reading it may assign a decision or promise to the wrong person. A text model alone cannot recover speaker boundaries from an audio file it has never processed.
How NativePort helps
NativePort connects your recording to speech recognition that can separate speaker turns and return timestamps. Your agent receives a transcript organized by voice, giving it better material for meeting notes. Speaker labels distinguish voices; you add the actual names when you know them.
Technical implementation
Use Python 3 with requests installed (python -m pip install requests). Set NATIVEPORT_API_KEY in your environment to your NativePort key. Run the snippets on your server, where your key stays private.
Set AUDIO_PATH to the meeting’s MP3 recording. Request diarization and combine consecutive word tokens from the same speaker.
import os
import requests
BASE = "https://api.nativeport.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}
with open(os.environ["AUDIO_PATH"], "rb") as audio:
response = requests.post(BASE + "/elevenlabs/v1/speech-to-text",
headers=HEADERS,
data={"model_id": "scribe_v1", "diarize": "true"},
files={"file": ("recording.mp3", audio, "audio/mpeg")},
timeout=180)
response.raise_for_status()
transcript = response.json()
turns = []
for word in transcript.get("words", []):
speaker = word.get("speaker_id") or "unknown"
if not turns or turns[-1]["speaker"] != speaker:
turns.append({"speaker": speaker, "start": word.get("start"), "text": ""})
turns[-1]["text"] += word["text"]
for turn in turns:
print(f"[{turn['start']}] {turn['speaker']}: {turn['text'].strip()}")Retain the timestamps so a reviewer can jump back to the recording. Overlapping speech can still need correction before you ask an agent to attribute commitments. See diarization options.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| ElevenLabs — speech to text with speaker labels | $0.026375 / call |
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.
Let your agent build it
You don’t need to write this code yourself. Copy this page’s link and paste it into your agent. Ask it to follow the guide and implement the feature for you.