GlyphCoach pronunciation drafts
An admin chooses an Avestan letter or word, speaks its pronunciation in CopperTake, and returns to that item to preview and publish.
The GlyphCoach draft service is live. Install both signed shortcuts from GlyphCoach’s setup page. The native recording buttons require a CopperTake build with the new actions. With the public recorder, choose Export Original, then Attach WAV to draft in the GlyphCoach recording studio.
The partner verified private upload, retry and authenticated preview on its live service. An approved WAV from the iPhone simulator also passed through both projects’ code with isolated storage. It produced a byte-identical private preview and the original receipt on retry. Physical-device recording through to publication still needs testing.
Start on the item
On the authenticated draft page, Record in CopperTake launches an installed shortcut named GlyphCoach Record. Pass this JSON as URL-encoded text using Apple’s shortcuts://run-shortcut scheme. Keep a copy of these IDs on the server so the same user can reopen the draft from another tab.
{
"v": 1,
"item_id": "letter-10b00",
"draft_id": "76dc3b54-60f9-4803-8d74-99dbbe72fb2c",
"session_id": "63a7eb44-d827-4cc7-a5ac-51af21cf6871",
"label": "𐬀 · a",
"recording_settings": {
"format": "wav",
"encoding": "pcm",
"bit_depth": 24,
"channels": 1,
"preferred_sample_rate_hz": 48000,
"max_bytes": 3145728
},
"return_url": "https://glyphcoach.com/admin/recordings/?item=letter-10b00&draft=76dc3b54-60f9-4803-8d74-99dbbe72fb2c"
}
Use a real catalog entry for item_id, matching ^(?:letter|word)-[a-z0-9-]{1,180}$. Generate distinct, lowercase canonical UUIDs for draft_id and session_id. In both shortcuts, parse Shortcut Input with Get Dictionary from Input. Check version 1, validate all three IDs, and stop on a missing or invalid field. The browser supplies recording_settings and the original return_url. GlyphCoach Record constructs the review URL itself from the fixed origin and validated item and draft IDs, so a different input hostname cannot redirect the admin. Pass the session ID, label, preferred rate, and validated return URL to Record in CopperTake. It opens the recorder and returns promptly.
The recording settings request mono 24-bit PCM WAV. preferred_sample_rate_hz may be 44100, 48000, or null. A rate preference applies during this handoff. The actual capture rate depends on the available input. GlyphCoach checks the file size and format on upload.
The admin taps Record, Stop, and listens to the waveform. They can select Record Again to try another pronunciation, or Choose Saved Take for an earlier reading. Use This Take approves the particular WAV for export. After approval, CopperTake shows the destination hostname. Choose Return to open the original draft and run the finish shortcut there. If the caller omits a return URL, reopen the draft manually. Canceling ends that handoff. The current public pronunciation stays available throughout the draft process.
Run the finish shortcut
- From the same authenticated draft, select Send reviewed take to launch GlyphCoach Send Reviewed Take. Pass version 1, the same three IDs, and
exchange_code. Validate the code with^[A-Za-z0-9_-]{22,128}$. This one-use code expires after 60 seconds and is scoped to that admin, item, draft, and session. URL input may carry the short-lived code. Keep long-lived credentials, audio, and the upload token out of URLs. Issue a new code on demand. - After validation, run Get Reviewed Take with the exact session ID and keep its file output in a variable. Check that its size is greater than zero and at most 3,145,728 bytes (3 MiB). If the session is pending, canceled, or expired, stop before making an HTTP request. Each website draft uses its own session.
- Use Get Contents of URL to POST JSON to
https://glyphcoach.com/api/pronunciation-drafts/exchangewithitem_id,draft_id,session_id, andexchange_code. The service must authenticate the one-use code and enforce its scope. The success object hasstatus: "ready", the same three IDs, and a nonemptyupload_tokenvalid for five minutes. Check the status, IDs, and token before continuing. - Use Get Contents of URL to PUT to
https://glyphcoach.com/api/pronunciation-drafts/upload. Choose request body File and supply the approved file variable. SetAuthorization: Bearer <upload_token>,Content-Type: audio/wav, andIdempotency-Key: <session_id>. Only these fixed HTTPS endpoints receive requests. The service must serve them directly, without redirects. - Parse the JSON receipt. Require
status: "received", the exact item/draft/session IDs, a canonical lowercase UUID forreceipt_id, a SHA-256 digest, and abyte_countmatching the file. Use Get Details of Files for the WAV’s size in bytes and Generate Hash with SHA-256 for its digest. Compare both against the receipt. End the shortcut on any mismatch or network error. - Only after validation, use Open URLs for
https://glyphcoach.com/admin/recordings/?item=<item_id>&draft=<draft_id>, using the validated original IDs. The admin signs in if necessary, previews the private draft, then chooses Publish take when ready.
Receipt and replay
The server must authenticate the token, check its scope, validate the WAV, enforce a 3 MiB limit, and compute the digest and byte count from the received bytes. Store the private file and receipt atomically. The first success returns HTTP 201. An identical retry, including concurrent requests or a retry after a lost response, returns HTTP 200 and the original receipt. The same key with different bytes must return HTTP 409. Error bodies must never resemble successful receipts.
{
"status": "received",
"item_id": "letter-10b00",
"draft_id": "76dc3b54-60f9-4803-8d74-99dbbe72fb2c",
"session_id": "63a7eb44-d827-4cc7-a5ac-51af21cf6871",
"receipt_id": "88fc4bc5-21c7-4aa9-81c7-1e1e6c9802ad",
"sha256": "<64 lowercase hexadecimal characters>",
"byte_count": 288044
}
Recover without publishing twice
- Tab changed, browser closed, or signed out
- Open the original draft from the authenticated admin recording list. After sign-in, the service must check access and restore the item and draft from the IDs. Choose Refresh draft and look for a stored receipt before requesting another upload.
- Expired code or slot · HTTP 410
- Request a fresh code from the same draft. Rerun the finish shortcut with its original session ID and idempotency key. If the draft itself expired or was discarded, open a new draft and approve the saved take for its new session. For 401 or 403, reauthenticate and check draft access first.
- Timeout, HTTP 429, or server error
- Check the draft’s receipt. If none is available, retry with the same bytes and key. Honor Retry-After where supplied. The server should return the first receipt if a previous request already completed.
- Different bytes · HTTP 409
- Open the matching draft to inspect the existing receipt. A different pronunciation requires a new draft or revision with a new session ID and key.
- Unsupported, invalid, or large file · HTTP 415, 422, or 413
- Use an approved 24-bit mono PCM WAV within the 3 MiB limit. Keep the saved audio. A new edit or shorter recording requires fresh approval.
- Local approval expired
- Start a fresh draft or revision with a new session ID. Reopen the saved take on the original device, review it, and approve again. Use This Take snapshots are retained for 30 days.
GlyphCoach handles private storage, authenticated listing and review, short-lived grants, replay-safe receipts, and authorization at publication. Its draft workflow is separate from the older upload that publishes immediately. A canceled recording, failed upload, or abandoned draft must leave public pronunciations untouched. Other callers can use the same CopperTake actions with their own routes, credentials, and file handlers. CopperTake action contract · Save to Files example.