diff --git a/CHANGELOG.md b/CHANGELOG.md
index a42c76c..15f1621 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,24 @@
Versions are `v*.*.*` with dots. Dates are US Eastern. Each section is written for the person using FormMorpheus; the reasons behind a change are in the `HASHOUT_LOG.md` beside the code.
+## 0.38.0 · 2026-11-28
+
+The iPad app gets AI Voice, listening for subtitles and My scenes, and its touch targets and Timeline top row are fixed. The iPad additions are new and wait for their check on the device; the list is in `docs/ios/BUILD.md`.
+
+### New
+- iPad: AI Voice is on. The Online tab speaks with your own key, kept in the iPad's Keychain. The Offline tab says the built-in voice needs a computer, and Voice app speaks through a speech server on a computer on the same network, by address or by a `.local` name. Only an address on your own network is accepted, and the iPad asks once for local network access.
+- iPad: Subtitles from this sound uses the iPad's own speech recognition, on the iPad only, with no model to download. A language the iPad cannot recognize on the device is refused. The iPad asks for permission the first time.
+- iPad: My scenes are kept in the Scenes folder of the FormMorpheus folder in Files, with Save as Scene, rename and delete. A deleted scene is listed by name in Recently Deleted and Restore puts it back.
+- iPad: Walk To Here is a touch and hold on the spot on the Stage; the character that was selected when your finger went down walks.
+
+### Improved
+- iPad: the Build panel, the scene strip, the AI Voice and Subtitles cards, Save as Scene and the Character Builder's view switch have 44 px touch targets.
+- iPad: held upright, the Timeline's top row no longer overlaps, and the AI Voice card scrolls inside the window, stands above the on-screen keyboard and does not open it by itself.
+- A track with no name shows the name of its first content in the Camera tab's Depth list.
+
+### Known issues
+- iPad: still not there are the built-in voice, Save to a chosen folder in Export, outside agents and the terminal panel, and Pen Link.
+
## 0.37.0 · 2026-11-27
The Build panel grows to seven tabs, with Props and Effects added, and a character can turn, walk, stand in more scenes, and sit in a scene of your own.
diff --git a/README.md b/README.md
index 396deac..3a819a6 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
-
+
@@ -120,10 +120,10 @@
- **Perform:** drag a block on the Stage while the movie plays and the gesture becomes keys at the movie's frame rate.
- **Characters:** build one in the Character Builder by choosing a kind, body, face, hair and outfit, start from one of 26 original starter characters, or open an SVG with one group per body part. Every character has named parts, pivots and parenting, and a built one has a part for every joint, from hip and forearm to shin, foot, eyes, brows, hair and tail, with a mouth ready for lip-sync. Save it to the Characters library, apply the 12 starter actions or your own, change a built one again with Edit in Character Builder and keep its animation, and send any character to a vector app and back, where it updates by part name and keeps its animation. A built character turns to the front, three-quarter, side or back view and can walk to a spot. Ten starter scenes and 49 props are included, and you can save your own scenes.
- **Agents:** an MCP server at `/mcp` with a small core tool list, and a terminal panel for Claude Code, Codex, Cursor and Antigravity. A change waits for your yes in the window unless you allow agents; see [`.docs/wiki/Agents.md`](.docs/wiki/Agents.md).
-- **AI Voice:** type what to say and the spoken sound lands on the Timeline like any sound, ready for fades, pan, lip-sync and export. A built-in offline voice (Kokoro, 54 voices, set up once from the card), a voice app on this computer for a cloned voice, or an online voice with your own key. Each spoken sound keeps its words and sentence timing, and adds its subtitles by itself. See `docs/MANUAL.md`.
-- **Subtitles:** tick one box and the lines are drawn on the Stage and in every export, in one look for all of them: font, size, position, color and a dark band. AI voices add theirs when they speak; for a recording or a sound file, listening runs on this computer with its own model, a one-time download of about 80 MB, and sends nothing anywhere. Edit the lines in the card, and import or export `.srt` and `.vtt`. See `docs/MANUAL.md`.
+- **AI Voice:** type what to say and the spoken sound lands on the Timeline like any sound, ready for fades, pan, lip-sync and export. A built-in offline voice (Kokoro, 54 voices, set up once from the card), a voice app on this computer for a cloned voice, or an online voice with your own key. On iPad: the online voice, or a speech server on a computer on the same network; the built-in voice needs a computer. Each spoken sound keeps its words and sentence timing, and adds its subtitles by itself. See `docs/MANUAL.md`.
+- **Subtitles:** tick one box and the lines are drawn on the Stage and in every export, in one look for all of them: font, size, position, color and a dark band. AI voices add theirs when they speak; for a recording or a sound file, listening runs on this computer with its own model, a one-time download of about 80 MB, and sends nothing anywhere (on iPad it uses the iPad's own speech recognition instead, with no download). Edit the lines in the card, and import or export `.srt` and `.vtt`. See `docs/MANUAL.md`.
- **In your language:** the interface ships in 30 languages, right to left included, with a manual on F1.
-- **iPad:** the iPad app in `ios/` wraps the same interface in a Swift shell with Apple Pencil, Files and AVFoundation export. It is built and runs on an iPad Pro 13-inch (M5) with Apple Pencil Pro on iPadOS 26.3, where drawing, squeeze, barrel roll and hover were checked. It is a beta that you build yourself on a Mac with Xcode: see [`docs/ios/BUILD.md`](docs/ios/BUILD.md). An App Store version is planned only if the iPad app gets real adoption.
+- **iPad:** the iPad app in `ios/` wraps the same interface in a Swift shell with Apple Pencil, Files and AVFoundation export. It is built and runs on an iPad Pro 13-inch (M5) with Apple Pencil Pro on iPadOS 26.3, where drawing, squeeze, barrel roll and hover were checked. Version 0.38.0 adds AI Voice, listening for subtitles and My scenes to the iPad app; these are new there and wait for their check on the device (the list is in the build guide). The iPad app has no built-in voice, no Save to a chosen folder in Export, no outside agents or terminal panel and no Pen Link. It is a beta that you build yourself on a Mac with Xcode: see [`docs/ios/BUILD.md`](docs/ios/BUILD.md). An App Store version is planned only if the iPad app gets real adoption.
## Download
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index 2d93b0c..978180b 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1 +1 @@
-__version__ = "0.37.0"
+__version__ = "0.38.0"
diff --git a/docs/MANUAL.md b/docs/MANUAL.md
index 23c7d84..e18a05e 100644
--- a/docs/MANUAL.md
+++ b/docs/MANUAL.md
@@ -463,6 +463,8 @@ The walk writes move keys for exactly that stretch, plus the walk action over th
- **Where to right-click.** A block under the pointer takes the right-click as its own, and opens that block's menu. A picture that covers the whole frame, such as the background of a starter scene, is such a block, so inside the frame the Stage's own menu opens only where nothing is drawn. Right-click in the dimmed backstage around the frame, or hide that track while you place the walk, or use the four Walk In and Walk Off commands, which need no spot.
- **Refused.** A walk that would run past the end of the character's block on the Timeline, or of the movie, is refused with a sentence that tells you to lengthen the block or the movie or start earlier. Putting the Playhead off the character's block, or asking it to walk to where it already stands, is refused too.
+**On iPad.** Select the character, then touch and hold the spot on the Stage: the character that was selected when your finger went down is the one that walks. The four Walk In and Walk Off commands work as they do elsewhere.
+
### Your own actions
- **Save Action...** makes an action from the character's own keys across the loop range, or across the whole block when none is set. Type a name. It takes the Move and Bones keys inside the range, adds a key at each end where the picture is, and is marked Loop when every channel ends where it starts. The keys it came from stay plain keys.
@@ -518,6 +520,8 @@ In the Scenes tab, **My scenes** lists them, newest first, above the starter sce
- **Where they are kept.** Each scene is a `.fmo` file in the **Scenes** folder of your data folder (see The data folder), one file for each, and stays there after a restart. The engine serves them under `/api/scenes`. A scene is a copy: later changes in the movie it came from do not change it, and the scene is never changed when you lay it behind a movie.
- **The engine keeps them.** My scenes are read from and written through the engine, so when the engine is not running the tab says so instead of listing them.
+**On iPad.** My scenes are kept in the **Scenes** folder of the FormMorpheus folder in the Files app, beside Characters. A deleted scene waits in Recently Deleted on Home by its name, and Restore puts it back in My scenes.
+
## Props

@@ -660,6 +664,8 @@ On the **Offline** tab, **Voice from** · **Voice app on this computer** speaks
On the **Online** tab, an online voice (ElevenLabs) speaks with your own key. The key is kept in the system keychain, never in the settings file, and can be cleared again. The text can be up to 2000 characters. Your text is sent to that service only when you press **Speak** on this tab; nothing is sent on the Offline tab.
+**On iPad.** AI Voice is there too. The **Online** tab works as above, with your own key kept in the iPad's Keychain. The built-in voice needs a computer, so the Offline tab says so; use **Voice app** with the address of a speech server on a computer on the same network, such as `http://192.168.1.20:8080` or `http://my-computer.local:8080`. Only an address on your own network is accepted, and the iPad asks once to allow access to the local network.
+
### Where the voice files are
The built-in voice lives in the **voice** folder of your data folder: its runtime in `voice/runtime` and its model in `voice/models`. The data folder is the one that holds the settings file: Preferences · General shows the settings and library folders, and `FORMMORPHEUS_DATA_DIR` moves it. A sound you have just spoken waits in `voice/out` until the window has placed it, and is removed within the hour if it never was. The sound you placed is part of the movie and is saved in the `.fmo` like any other sound.
@@ -705,6 +711,8 @@ Listening runs on this computer. It uses the built-in voice's runtime, and its o
The model is kept in the **voice** folder of your data folder, in `voice/listen`, beside the built-in voice's own model. A sound of up to about two hours can be listened to in one go: split a longer block and listen to each part.
+**On iPad.** Listening uses the iPad's own speech recognition, on the iPad only, so there is no model to download and nothing is sent to a network. The iPad asks for permission to use speech recognition the first time; if you refused it, the card says to allow it in the Settings app. A language the iPad cannot recognize on the device is refused. Cancelling from the card does not stop a listen that is already running; it ends by itself.
+
### Editing lines
Each line is a row with its **start** and **end** in seconds (type `12.5` or `1:02.5`) and its words. Change a field and press Enter, or leave it, to keep the change. The start stays before the end. The play button on a row moves the Playhead to the line, and the line under the Playhead is marked while you play.
@@ -881,6 +889,22 @@ The terminal panel runs a shell and the agent programs beside the Stage and the
Closing FormMorpheus ends every tab.
+## New in 0.38.0
+
+**On iPad, AI Voice.** The Online tab works with your own key, kept in the iPad's Keychain. The built-in voice needs a computer; use Voice app with the address of a speech server on a computer on the same network, by number or by a `.local` name. Only an address on your own network is accepted, and the iPad asks once for local network access. See AI Voice.
+
+**On iPad, listening for subtitles.** Subtitles from this sound uses the iPad's own speech recognition, on the iPad only, with no model to download. The iPad asks for permission the first time. See Subtitles.
+
+**On iPad, My scenes.** Save as Scene, rename and delete work, scenes are kept in the Scenes folder of the FormMorpheus folder in Files, and a deleted scene waits in Recently Deleted. See My scenes.
+
+**On iPad, Walk To Here.** Touch and hold the spot on the Stage with a character selected. See Walk.
+
+**On iPad, easier to touch.** The Build panel, the scene strip, the AI Voice and Subtitles cards and Save as Scene have larger touch targets. Held upright, the Timeline's top row no longer overlaps, the AI Voice card scrolls and stands above the on-screen keyboard, and the Character Builder's view switch is larger.
+
+**Not on iPad.** The built-in voice, Save to a chosen folder in Export, outside agents and the terminal panel, and Pen Link.
+
+**In the Camera tab,** a track with no name shows the name of its first content in the Depth list.
+
## New in 0.37.0
**The Build panel has seven tabs.** Characters, Actions, Scenes, Props, Effects, Create and Camera, in two rows. See The Build panel.
diff --git a/docs/api-contract.json b/docs/api-contract.json
index 145f0cd..1ececd8 100644
--- a/docs/api-contract.json
+++ b/docs/api-contract.json
@@ -1,5 +1,5 @@
{
-"info":{"title":"formmorpheus","version":"0.37.0"},
+"info":{"title":"formmorpheus","version":"0.38.0"},
"openapi":"3.1.0",
"paths":{
"/api/agent/claude/open":{"post":{"operationId":"claude_open_api_agent_claude_open_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaudeBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":true,"title":"Response Claude Open Api Agent Claude Open Post","type":"object"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Claude Open","tags":["terminal"]}},
diff --git a/docs/ios/APP_STORE.md b/docs/ios/APP_STORE.md
index fed41e3..a2ab606 100644
--- a/docs/ios/APP_STORE.md
+++ b/docs/ios/APP_STORE.md
@@ -31,16 +31,16 @@ Answer No to every content question (no violence, no mature themes, no gambling,
## Privacy answers (App Privacy section)
-- Data collection: No, we do not collect data from this app. Nothing is sent off the device and there is no analytics or advertising code.
+- Data collection: No, we do not collect data from this app, and there is no analytics or advertising code. Text is sent off the device only when the person chooses to: AI Voice on its Online tab sends the typed text, with the person's own key, to the online voice service they chose, and AI Voice with a voice app sends it to a speech server on their own network. Nothing else is sent. Listening for subtitles uses the iPad's own speech recognition on the device only. Check these answers against the owner's own privacy policy before submitting.
- Tracking: No.
- Privacy manifest: included (`ios/App/PrivacyInfo.xcprivacy`) with no collected data types, no tracking domains, and the required-reason entries for file timestamps, user defaults, disk space and system boot time.
- Encryption: the app uses no non-exempt encryption (`ITSAppUsesNonExemptEncryption` is false).
-- Permissions asked: microphone (only when you record sound into a movie), photo library add-only (only when you save an export there).
+- Permissions asked: microphone (only when you record sound into a movie), photo library add-only (only when you save an export there), speech recognition (only when you press Subtitles from this sound), local network (only when you use a speech server on your network for AI Voice). The app allows plain http to that server, and accepts only an address on the same network.
- Privacy policy URL: required by App Store Connect; use a page that states the app collects no data.
## Review notes
-The app needs no sign-in and has no demo account. To try it: open the app, create a new movie, draw on the Stage, press play, then use File > Export to make a video. Apple Pencil is optional; a finger works for drawing. Files are stored on the device in the Files app under On My iPad > FormMorpheus. On Home, the person can instead keep the movie library in the app's iCloud Drive folder (iCloud Drive > FormMorpheus), which the system syncs; the app itself makes no network requests. A Diagnostics page under Help > About FormMorpheus > Diagnostics writes one local report file the person can share; it is never sent anywhere by the app.
+The app needs no sign-in and has no demo account. To try it: open the app, create a new movie, draw on the Stage, press play, then use File > Export to make a video. Apple Pencil is optional; a finger works for drawing. Files are stored on the device in the Files app under On My iPad > FormMorpheus. On Home, the person can instead keep the movie library in the app's iCloud Drive folder (iCloud Drive > FormMorpheus), which the system syncs. The app makes no network request unless the person uses AI Voice: its Online tab (their own key, kept in the Keychain) or a speech server on their local network. A Diagnostics page under Help > About FormMorpheus > Diagnostics writes one local report file the person can share; it is never sent anywhere by the app.
## Support and marketing
diff --git a/docs/ios/BUILD.md b/docs/ios/BUILD.md
index 5410c2a..2c2cd0e 100644
--- a/docs/ios/BUILD.md
+++ b/docs/ios/BUILD.md
@@ -33,6 +33,39 @@ Debug builds let Safari inspect the web view. On the iPad turn on Settings > App
3. The same file stays in the Files app under On My iPad > FormMorpheus > Diagnostics.
4. Send that file together with any Xcode build errors.
+## Check on the iPad (0.38.0)
+
+Device: iPad Pro 13-inch (M5), Apple Pencil Pro, iPadOS 26.3. Build with `./formmorpheus ios`, then Run. This version adds Swift files to the iPad engine (`ScenesRoutes.swift`, `VoiceRoutes.swift`, `VoiceRemote.swift`, `VoiceKeychain.swift`, `VoiceListen.swift`) and changes `TrashRoutes.swift` and the Info.plist strings. None of it has been compiled, and the interface changes have not been run on an iPad; they were checked only in a desktop browser made to behave like an iPad, with the native side stubbed. So step 1 matters most, and every step below is a first run. For steps 5 and 6 you need a speech server (a voice app that answers the common speech API) running on a computer on the same Wi-Fi network, its address, and, if you want to try a name, the computer's `.local` name. For step 4 you need an online voice key of your own. Write what happened under each step, in your own words.
+
+1. The Xcode build: run `./formmorpheus ios`, then Run. Expected: the build finishes with no error and the app opens. If it stops, send back the file, the line and the message of the first error, and the same for any warning in a new Swift file.
+ Result:
+2. The Scenes folder: open the Files app, On My iPad > FormMorpheus. Expected: a Scenes folder is there beside Characters once the app has run (open Content, Add, or the Scenes tab of the Build panel once if it is not).
+ Result:
+3. Save as Scene: open a movie with a prop or a picture on a track, choose Movie, Save as Scene..., name it, tick the tracks and tap Save Scene with a finger. Expected: every row and button in the card is easy to hit, the scene shows under My scenes in the Scenes tab with its picture, and the Scenes folder in Files holds a file for it. Open another movie and tap the scene: it lies behind everything. Then rename it and delete it from the three dots on its tile. Expected: the new name shows. The deleted scene is gone from the tab and listed by name in Recently Deleted on Home, and Restore puts it back in My scenes.
+ Result:
+4. AI Voice online: open Content, Add, AI Voice..., go to the Online tab, paste your key, type a sentence and tap Speak. Expected: the spoken sound lands on a sound track at the Playhead and plays. Close the app from the app switcher, open it again and open the card: the key is still there (shown as kept, not in plain text). Clear the key and check that it is gone.
+ Result:
+5. AI Voice with a speech server on a computer: on the Offline tab choose Voice app, type the address of the computer such as `http://192.168.1.20:8080`, and tap Check. Expected: the first time, the iPad asks to allow FormMorpheus to find and connect to devices on your local network; allow it. The card lists the server's models and voices, and Speak places a sound. Then do the same with the computer's name, such as `http://my-computer.local:8080`. If you refused the local network question, expected: the check fails with a message, and turning it on under Settings > Privacy & Security > Local Network makes it work.
+ Result:
+6. An address on the open internet: type `http://example.com` or any public address as the voice app's address and tap Check. Expected: it is refused, with a sentence that only an address on the same network is allowed, and nothing is sent.
+ Result:
+7. The built-in voice: on the Offline tab choose the built-in voice. Expected: the card says in one sentence that the built-in voice needs a computer, and there is no setup button.
+ Result:
+8. Subtitles from this sound, in English: put a short recording or a sound file with English speech on a track, select its block, open Content, Add, Subtitles..., set Language to English and tap Subtitles from this sound. Expected: the first time, the iPad asks for permission to use speech recognition; allow it. The lines land in the card, timed to the block, with no model download. Then pick another language (German, for example) with a sound in that language. Expected: its lines land the same way. If the iPad says it cannot recognize that language on the device, expected: the card says so and nothing is sent anywhere. Last, turn Speech Recognition off for the app in Settings > Privacy & Security > Speech Recognition and try again. Expected: the card tells you to allow it in the Settings app. Cancelling a listen from the card does not stop the recognition that is running; it ends by itself, so note anything that looks different.
+ Result:
+9. The Build panel by finger and Pencil: open View > Build Panel. Expected: all seven tabs (Characters, Actions, Scenes, Props, Effects, Create, Camera) can be tapped with a finger and with the Pencil, nothing overlaps, and each tile or button is big enough to hit.
+ Result:
+10. A prop, an effect and a camera move: add a prop from Props, lay Rain from Effects and set its strength, then in Camera choose Push In. Expected: the prop stands on the Stage, the rain is drawn over the movie, and the camera move plays once, each with one tap and one undo step.
+ Result:
+11. The scene strip: with a movie that has two scenes, tap a card of the strip above the Timeline, then double-tap to rename it, then open its menu. Expected: the card selects, the name can be typed, and the menu rows can be tapped.
+ Result:
+12. Character views and walking: add a built starter character (Karl) from the Characters tab. In the builder or on its menu turn it to the side view and back. Then, with Karl selected, touch and hold a spot on the Stage. Expected: after the hold, Karl walks to the spot, even though touching the empty Stage normally deselects. Then choose Content, Walk, Walk In from Left. Expected: Karl walks in from the left edge and the walk plays once.
+ Result:
+13. The Timeline and the AI Voice card, upright: hold the iPad upright and look at the Timeline's top row. Expected: nothing overlaps, the level meter is not shown and the frame readout is small. Then open the AI Voice card on a short screen, tap the text field and watch the keyboard. Expected: the card scrolls inside the window, stands above the on-screen keyboard, and does not bring the keyboard up before you tap the field. Also open the Character Builder and check its view switch is easy to tap.
+ Result:
+14. The Help pictures and other languages: open Help (the manual) and scroll through the Walk, My scenes, AI Voice and Subtitles sections. Expected: the pictures show and the iPad notes read right. Then Preferences > Interface > Language, choose Deutsch, then Arabic, and open the Build panel, the AI Voice card and the Subtitles card. Expected: every label is translated, nothing is cut off, and in Arabic the layout is mirrored with nothing overlapping.
+ Result:
+
## Check on the iPad (0.31.0)
Device: iPad Pro 13-inch (M5), Apple Pencil Pro, iPadOS 26.3. Build with `./formmorpheus ios`, then Run. The Character Builder, the built characters and the new actions are all in the interface, so this build has no Swift change of its own; check them on the device all the same, with a finger and with the Pencil. For step 7 put a short sound with speech in the Files app. Write what happened under each step, in your own words.
@@ -94,4 +127,7 @@ Not yet run on a device; the app itself is built and runs (see the top of this g
- `ios/project.yml`: the project spec. `ios/Config/Base.xcconfig`: shared build settings. `ios/App/FormMorpheus.entitlements`: iCloud Documents.
- `ios/App`, `ios/Web`: the app, the web view host, the `fm://` scheme handler and the bridge.
- `ios/Resources/web`: the built interface (generated, not committed).
-- Files you create appear in the Files app under On My iPad > FormMorpheus, saved characters in its Characters folder. A movie opened from anywhere else in Files is copied into the Library there; the original is never changed.
+- `ios/Engine`: the iPad's own engine in Swift, one file of routes for each part (`ScenesRoutes.swift` for My scenes, `VoiceRoutes.swift`, `VoiceRemote.swift`, `VoiceKeychain.swift` and `VoiceListen.swift` for AI Voice and listening for subtitles, `TrashRoutes.swift` for Recently Deleted, and others).
+- Info.plist usage sentences for speech recognition and the local network are in `ios/App`, as `InfoPlist.strings` in each `*.lproj` folder (English and 29 other languages); plain http to a speech server is allowed there too.
+- What the iPad app leaves out: the built-in AI voice (it needs a computer), Save to a chosen folder in Export (the share sheet decides), outside agents and the terminal panel, and Pen Link.
+- Files you create appear in the Files app under On My iPad > FormMorpheus, saved characters in its Characters folder and your own scenes in its Scenes folder. A movie opened from anywhere else in Files is copied into the Library there; the original is never changed.
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index 09830c2..0a62365 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -2,11 +2,25 @@
Living log of all comment content, explainers, rationale, TODOs, & removed code for the interface. Source files stay comment-free; everything they would have said lives here, indexed. Read this first, then edit code surgically.
-Current build version: v0.37.0
-Last updated: 2026-11-27 · the twelve requests left from discussion 16
+Current build version: v0.38.0
+Last updated: 2026-11-28 · the interface on iPad for 0.32.0 to 0.37.0
---
+## v0.38.0 · the interface on iPad for 0.32.0 to 0.37.0
+
+- refers-to: styles/ipad-window.css; app/app.ts (the `ai-voice` command, `stage.nav.onContext`); ui/ai-voice-panel.ts; ui/subtitles-panel.ts :: allowListening; app/features/depth.ts
+- kind: decision
+- logged: v0.38.0 · 2026-11-28
+
+- Everything here sits behind `platform.kind === 'ipad'` or `html.is-ipad`; the desktop is unchanged. Looked at in Chrome made to behave as the iPad (touch, 1366 by 1024, 1024 by 768, 834 by 1194, the native side and `/api/voice` stubbed), not on an iPad.
+- **Touch targets.** One rule maps `--ctl`, `--ctl-sm` and `--ctl-md` to `--touch-target` inside the surfaces added since 0.32.0 (the Build panel, the scene strip, the AI Voice and Subtitles cards, Save as Scene). The global tokens are left alone: changing them would resize older dense parts such as the Timeline's track heads.
+- **The Timeline's top row upright.** On iPad `.fm-timeline` is a container (`fm-tl`), because a container query cannot style its own container and `.fm-transport` is already `fm-head`. Under 980 px the row uses three columns, hides the master meter and lets the frame readout shrink.
+- **Walk To Here by touch and hold.** A long press sends `contextmenu` after 550 ms, but the touch has already changed the selection when it went down: on the empty Stage it deselects the character, on scenery it selects the scenery. A capture listener on the Stage remembers the selected character when a pointer that is not a mouse goes down, and `onContext` uses it if the menu opens within 2 s. The desktop's right-click path is untouched.
+- **AI Voice on iPad.** The command is on. The Offline tab hides the choice of voice source and says in one sentence that the built-in voice needs a computer; the engine is always `local`, the address placeholder is a network address. The card takes the Subtitles card's max height and scrolls inside it, stands above the on-screen keyboard, and does not focus its text box on open.
+- **Listening on iPad.** No runtime note and no model step. The first listen calls `POST /transcribe/setup` (the permission), polls the job, reads the status again and goes on when it is ready; any end that is not `running` counts as finished, so it works whether the iPad answers at once or after the prompt.
+- A track with no name shows its first content's name in the Camera tab's Depth list.
+
## v0.37.0 · the twelve requests left from discussion 16
- refers-to: app/feature-kit.ts; app/features/*.ts; engine/cast/views.ts; engine/scene-fx.ts; engine/scene-marks.ts; engine/scene-ops.ts; engine/camera-moves.ts; engine/walk-to.ts; engine/actions-builtin.ts :: walkAction; engine/source-merge.ts :: hiddenAfter; engine/starter-scene.ts :: standOnFloor; io/starter-props.ts; io/my-scenes.ts; ui/build-panel.ts :: addSection; ui/content-menu.ts :: addRow; ui/inner-pick.ts :: partAt, shapePaints; ui/scene-strip.ts; ui/scene-fx-panel.ts; ui/track-menu.ts :: DEPTH_STEPS; ui/stage-drag-cache.ts :: paint
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 1e81311..82c895e 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "formmorpheus",
- "version": "0.37.0",
+ "version": "0.38.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "formmorpheus",
- "version": "0.37.0",
+ "version": "0.38.0",
"license": "Apache-2.0",
"dependencies": {
"@fontsource/anton": "5.3.0",
diff --git a/frontend/package.json b/frontend/package.json
index c763b82..1b0b48b 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,7 +1,7 @@
{
"name": "formmorpheus",
"private": true,
- "version": "0.37.0",
+ "version": "0.38.0",
"description": "FormMorpheus · animation studio in the Form family",
"license": "Apache-2.0",
"type": "module",
diff --git a/frontend/src/app/app.ts b/frontend/src/app/app.ts
index 095b30d..d584a28 100644
--- a/frontend/src/app/app.ts
+++ b/frontend/src/app/app.ts
@@ -226,13 +226,21 @@ export function startApp(): void {
engine.select([id]);
commands.run('character.walk-here');
});
+ // iPad: a touch and hold opens the menu, but its touch already changed the selection when it went down
+ let touchedFrom: { id: string | null; at: number } | null = null;
+ if (platform.kind === 'ipad') stage.root.addEventListener('pointerdown', (e) => {
+ if (e.pointerType !== 'mouse') touchedFrom = { id: selectedCharacter(engine)?.id ?? null, at: performance.now() };
+ }, true);
stage.nav.onContext = (x, y) => {
lastContext = { x, y };
// over content, the right-click is about that content: select it and open its menu; over empty Stage, the Stage's own
const hit = stage?.contentAt(x, y) ?? null;
- const was = selectedCharacter(engine);
- walker = hit && was && was.id !== hit ? was.id : null;
+ const held = touchedFrom && performance.now() - touchedFrom.at < 2000 ? touchedFrom.id : undefined;
+ touchedFrom = null;
+ const was = held === undefined ? selectedCharacter(engine)?.id ?? null : held;
+ walker = hit && was && was !== hit ? was : null;
if (hit) { if (!engine.selection.content.includes(hit)) engine.select([hit]); contentMenu.open(x, y); return; }
+ if (held && !selectedCharacter(engine) && engine.movie && findContent(engine.movie, held)) engine.select([held]);
stageMenu.setItems(['character.walk-here', '-', 'stage-options', 'stage-background', '-', 'stage-fit', 'stage-zoom-100', '-', 'stage-timecode', 'stage-fullscreen']); stageMenu.openAt(x, y); };
const newMovie = new NewMovieDialog(engine);
// like New: the movie opens unnamed and the library adopts it under a free "Untitled Movie" name
@@ -720,7 +728,7 @@ export function startApp(): void {
{ id: 'import-video', label: 'Video...', icon: 'video', enabled: has, run: () => pickFor('video/*') },
{ id: 'import-audio', label: 'Audio...', icon: 'audio', enabled: has, run: () => pickFor('audio/*,.flac,.ogg,.opus,.m4a,.aif,.aiff,.caf,.ac3,.mp2') },
{ id: 'record-audio', label: 'Record sound...', icon: 'audio', enabled: has, run: () => { aiVoice.close(); subtitlesPanel.close(); voicePanel.show(); } },
- { id: 'ai-voice', label: 'AI Voice...', icon: 'audio', enabled: () => has() && platform.kind !== 'ipad', run: () => { voicePanel.close(); subtitlesPanel.close(); aiVoice.show(); } },
+ { id: 'ai-voice', label: 'AI Voice...', icon: 'audio', enabled: () => has(), run: () => { voicePanel.close(); subtitlesPanel.close(); aiVoice.show(); } },
{ id: 'subtitles', label: 'Subtitles...', icon: 'text', enabled: has, run: () => { voicePanel.close(); aiVoice.close(); subtitlesPanel.show(); } },
{ id: 'sound-card', label: 'Sound options...', enabled: () => engine.selected.some((c) => c.kind === 'audio'), run: () => soundCard.show() },
{ id: 'import-file', label: 'File...', icon: 'upload', enabled: has, run: () => pickFor(MEDIA_ACCEPT) },
diff --git a/frontend/src/app/features/depth.ts b/frontend/src/app/features/depth.ts
index 96c4249..340a5b9 100644
--- a/frontend/src/app/features/depth.ts
+++ b/frontend/src/app/features/depth.ts
@@ -90,7 +90,7 @@ export function installDepth(kit: FeatureKit): void {
const pick = q(row, '.fm-depth-pick');
const step = depthStepOf(tr.depth);
const d = tr.depth ?? 1;
- setText(q(row, '.fm-depth-name'), tr.name);
+ setText(q(row, '.fm-depth-name'), tr.name || tr.content[0]?.name || '');
const custom = pick.options[DEPTH_STEPS.length];
if (step < 0) setText(custom, `${Math.round(d * 100) / 100}x`);
const want = step >= 0 ? String(step) : 'custom';
diff --git a/frontend/src/styles/ipad-window.css b/frontend/src/styles/ipad-window.css
index babc785..c4e44a2 100644
--- a/frontend/src/styles/ipad-window.css
+++ b/frontend/src/styles/ipad-window.css
@@ -15,6 +15,36 @@ html.is-ipad body {
html.fm-kb-open .cv-scrim { padding-bottom: var(--fm-kb-inset, 0px); box-sizing: border-box; }
html.fm-kb-open .cv-dialog { max-height: calc(100vh - 64px - var(--fm-kb-inset, 0px)); }
+/* The Build panel, the scene strip and the cards of 0.32.0 to 0.37.0 size their controls from the --ctl tokens: on
+ iPad those read as a finger's target inside them, as gestures.css does for the older controls. */
+html.is-ipad :is(.fm-build, .fm-scenes, .fm-aiv, .fm-sub, .fm-ms-trks, .fm-ms-bg) {
+ --ctl-sm: var(--touch-target);
+ --ctl-md: var(--touch-target);
+ --ctl: var(--touch-target);
+}
+html.is-ipad .fm-props-chip { min-inline-size: var(--touch-target); }
+/* the Character Builder's view switch and Flip above its preview */
+html.is-ipad .fm-cb-viewbar { block-size: auto; min-block-size: var(--touch-target); }
+html.is-ipad :is(.fm-cb-views button, .fm-cb-flip) { justify-content: center; min-inline-size: var(--touch-target); min-block-size: var(--touch-target); }
+html.is-ipad :is(.fm-aiv-x, .fm-sub-x) { display: inline-flex; align-items: center; justify-content: center; min-inline-size: var(--touch-target); min-block-size: var(--touch-target); }
+html.is-ipad .fm-aiv-link { min-block-size: var(--touch-target); }
+/* with 44 px rows the AI Voice card outgrows a landscape iPad's room above its bottom edge: it scrolls inside that room,
+ as the Subtitles card does */
+html.is-ipad .fm-aiv { max-block-size: calc(100vh - var(--space-4) * 2 - var(--cv-row-h) * 5.5); }
+/* the AI Voice and Subtitles cards stand above the on-screen keyboard while it is up */
+html.fm-kb-open.is-ipad :is(.fm-aiv, .fm-sub) { inset-block-end: calc(var(--fm-kb-inset, 0px) + var(--space-2)); max-block-size: calc(100vh - var(--fm-kb-inset, 0px) - var(--space-6)); }
+
+/* The Timeline's head row with 44 px buttons runs out of room before the window is compact (an upright iPad): the
+ side columns take what they need and the level meter goes, as under 720 px. The Timeline is measured, not the
+ window, so an open Build panel counts. */
+html.is-ipad .fm-timeline { container: fm-tl / inline-size; }
+@container fm-tl (max-width: 979px) {
+ html.is-ipad .fm-transport { grid-template-columns: auto minmax(0, 1fr) auto; }
+ html.is-ipad .fm-transport-mid { justify-content: center; }
+ html.is-ipad .fm-master-meter { display: none; }
+ html.is-ipad .fm-frame-readout { min-inline-size: 0; }
+}
+
/* The compact windows: under 720 px the layout in shell.css already turns the panels into sheets; this keeps the
Timeline's bars and the status bar from running into each other. */
@media (max-width: 719px) {
diff --git a/frontend/src/ui/ai-voice-panel.ts b/frontend/src/ui/ai-voice-panel.ts
index 4146853..e7c4b76 100644
--- a/frontend/src/ui/ai-voice-panel.ts
+++ b/frontend/src/ui/ai-voice-panel.ts
@@ -9,8 +9,15 @@ import { confirmAction } from './dialogs';
import { el, patchList, q, setClass, setDisabled, setHidden, setStyleVar, setText, setValue } from './dom';
import { enhanceSelect } from './dropdown';
import { t } from './i18n';
+import { platform } from '../platform';
import '../styles/ai-voice.css';
+// the built-in voice is a Python runtime the iPad cannot run: there the offline voice is a speech server on the network
+const IPAD = platform.kind === 'ipad';
+const KEY_NOTE = IPAD
+ ? 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.'
+ : 'Your own ElevenLabs key. It is kept in this computer\'s keychain and sent only to that service.';
+
type Tab = 'offline' | 'online';
type Source = 'builtin' | 'local';
@@ -26,8 +33,8 @@ const X = '');
- this.base = named(' ', 'Address');
+ this.base = named(` `, 'Address');
this.modelList = el(' ');
this.voiceList = el(' ');
this.model = named(' ', 'Model');
@@ -215,9 +222,16 @@ export class AiVoicePanel {
this.localBox.append(
row('Address', baseRow), this.checkLine, row('Model', this.model), row('Voice', this.localVoice), row('Key', this.localKey),
this.modelList, this.voiceList,
- para('fm-aiv-note', 'Any voice app on this computer that answers the common speech API works here, a cloned voice included. Start the app first.'),
+ IPAD
+ ? para('fm-aiv-note', 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.')
+ : para('fm-aiv-note', 'Any voice app on this computer that answers the common speech API works here, a cloned voice included. Start the app first.'),
);
- this.panels.offline.append(row('Voice from', this.source), this.builtinBox, this.localBox);
+ const sourceRow = row('Voice from', this.source);
+ if (IPAD) {
+ setHidden(sourceRow, true);
+ this.panels.offline.append(para('fm-aiv-note', 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.'));
+ }
+ this.panels.offline.append(sourceRow, this.builtinBox, this.localBox);
// ---- online ----
this.keyBox = el('
');
@@ -225,7 +239,7 @@ export class AiVoicePanel {
this.saveKeyBtn = button('cv-btn', 'Save key');
const keyRow = el('
');
keyRow.append(this.onlineKey, this.saveKeyBtn);
- this.keyNote = para('fm-aiv-note', 'Your own ElevenLabs key. It is kept in this computer\'s keychain and sent only to that service.');
+ this.keyNote = para('fm-aiv-note', KEY_NOTE);
this.keyBox.append(row('Key', keyRow), this.keyNote);
this.onlineBox = el('
');
this.onlineVoice = named(' ', 'Voice');
@@ -293,7 +307,8 @@ export class AiVoicePanel {
setHidden(this.root, false);
this.syncControls();
this.patch();
- if (!was) this.text.focus();
+ // on iPad a focused field brings up the on-screen keyboard over half the window before anything is chosen
+ if (!was && !IPAD) this.text.focus();
void this.refresh();
}
@@ -630,7 +645,7 @@ export class AiVoicePanel {
setHidden(this.keyBox, !st || hasKey);
setHidden(this.onlineBox, !hasKey);
setText(this.keyNote, canStore
- ? t('Your own ElevenLabs key. It is kept in this computer\'s keychain and sent only to that service.')
+ ? t(KEY_NOTE)
: t('This computer has no keychain FormMorpheus can use, so a key cannot be kept here.'));
setClass(this.keyNote, 'is-warn', !canStore);
setDisabled(this.onlineKey, !canStore);
diff --git a/frontend/src/ui/i18n/ar.ts b/frontend/src/ui/i18n/ar.ts
index 278d77d..6016c0e 100644
--- a/frontend/src/ui/i18n/ar.ts
+++ b/frontend/src/ui/i18n/ar.ts
@@ -1080,4 +1080,9 @@ export const ar: Record = {
'This character draws nothing to walk.': 'لا تحتوي هذه الشخصية على رسم يمكنه المشي.', 'This character cannot walk from here.': 'لا تستطيع هذه الشخصية المشي من هنا.', 'The character already stands there.': 'الشخصية تقف هناك بالفعل.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'يمتد المشي إلى ما بعد نهاية الشخصية على الخط الزمني: مدّد كتلتها أو الفيلم، أو ابدأ أبكر.',
'Rear': 'خلفي', 'Lighting': 'الإضاءة', 'Historical': 'تاريخية',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'يحتاج الصوت المضمّن إلى كمبيوتر. على iPad، استخدم خادم كلام على الشبكة نفسها، أو صوتًا عبر الإنترنت.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'أدخل عنوان خادم كلام على كمبيوتر في الشبكة نفسها. يعمل هناك أي تطبيق يستجيب لواجهة الكلام الشائعة، بما في ذلك الصوت المستنسخ. شغّله أولًا.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'مفتاح ElevenLabs الخاص بك. يُحفظ في سلسلة مفاتيح هذا الـ iPad ويُرسل إلى تلك الخدمة فقط.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'يستخدم الاستماع ميزة التعرف على الكلام الخاصة بهذا الـ iPad، على الجهاز نفسه. يطلب الإذن في المرة الأولى.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'يحتاج الاستماع إلى إذن لاستخدام التعرف على الكلام. اسمح به لـ FormMorpheus في تطبيق الإعدادات.',
};
diff --git a/frontend/src/ui/i18n/cs.ts b/frontend/src/ui/i18n/cs.ts
index dac7c07..24194e9 100644
--- a/frontend/src/ui/i18n/cs.ts
+++ b/frontend/src/ui/i18n/cs.ts
@@ -895,4 +895,9 @@ export const cs: Record = {
'This character draws nothing to walk.': 'Tato postava nemá co nechat chodit.', 'This character cannot walk from here.': 'Tato postava odsud nemůže jít.', 'The character already stands there.': 'Postava už tam stojí.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Chůze přesahuje konec postavy na časové ose: prodlužte její blok nebo film, nebo začněte dřív.',
'Rear': 'Zezadu', 'Lighting': 'Osvětlení', 'Historical': 'Historické',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Vestavěný hlas potřebuje počítač. Na iPadu použijte řečový server ve stejné síti nebo online hlas.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Zadejte adresu řečového serveru na počítači ve stejné síti. Funguje tam jakákoli aplikace, která odpovídá na běžné rozhraní pro řeč, včetně naklonovaného hlasu. Nejprve ji spusťte.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Váš vlastní klíč ElevenLabs. Je uložen v klíčence tohoto iPadu a odesílá se jen této službě.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Poslech používá vlastní rozpoznávání řeči tohoto iPadu, přímo v zařízení. Poprvé požádá o oprávnění.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Poslech potřebuje oprávnění k rozpoznávání řeči. Povolte je pro FormMorpheus v aplikaci Nastavení.',
};
diff --git a/frontend/src/ui/i18n/da.ts b/frontend/src/ui/i18n/da.ts
index 41da85a..88c7456 100644
--- a/frontend/src/ui/i18n/da.ts
+++ b/frontend/src/ui/i18n/da.ts
@@ -1058,4 +1058,9 @@ export const da: Record = {
'This character draws nothing to walk.': 'Denne karakter har intet at lade gå.', 'This character cannot walk from here.': 'Denne karakter kan ikke gå herfra.', 'The character already stands there.': 'Karakteren står allerede der.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Gangen løber forbi karakterens slutning på tidslinjen: gør dens blok eller filmen længere, eller start tidligere.',
'Rear': 'Bagfra', 'Lighting': 'Belysning', 'Historical': 'Historisk',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Den indbyggede stemme kræver en computer. På iPad kan du bruge en taleserver på samme netværk eller en onlinestemme.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Angiv adressen på en taleserver på en computer på samme netværk. Alle apps dér, der svarer på den almindelige tale-API, virker, også en klonet stemme. Start den først.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Din egen ElevenLabs-nøgle. Den gemmes i denne iPads nøglering og sendes kun til den tjeneste.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Lytning bruger denne iPads egen talegenkendelse, direkte på enheden. Den beder om tilladelse første gang.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Lytning kræver tilladelse til at bruge talegenkendelse. Tillad det for FormMorpheus i appen Indstillinger.',
};
diff --git a/frontend/src/ui/i18n/de.ts b/frontend/src/ui/i18n/de.ts
index dbb69b4..d098517 100644
--- a/frontend/src/ui/i18n/de.ts
+++ b/frontend/src/ui/i18n/de.ts
@@ -1058,4 +1058,9 @@ export const de: Record = {
'This character draws nothing to walk.': 'Diese Figur hat nichts, was gehen könnte.', 'This character cannot walk from here.': 'Diese Figur kann von hier aus nicht gehen.', 'The character already stands there.': 'Die Figur steht schon dort.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Der Gang reicht über das Ende der Figur auf der Zeitleiste hinaus: Verlängere ihren Block oder den Film, oder beginne früher.',
'Rear': 'Hinten', 'Lighting': 'Beleuchtung', 'Historical': 'Historisch',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Die integrierte Stimme braucht einen Computer. Nutze auf dem iPad einen Sprachserver im selben Netzwerk oder eine Online-Stimme.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Gib die Adresse eines Sprachservers auf einem Computer im selben Netzwerk an. Jede App dort, die die gängige Sprach-API beantwortet, funktioniert, auch eine geklonte Stimme. Starte ihn zuerst.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Dein eigener ElevenLabs-Schlüssel. Er wird im Schlüsselbund dieses iPad aufbewahrt und nur an diesen Dienst gesendet.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Zuhören nutzt die eigene Spracherkennung dieses iPad, direkt auf dem Gerät. Beim ersten Mal wird um Erlaubnis gefragt.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Zuhören braucht die Erlaubnis, die Spracherkennung zu nutzen. Erlaube sie für FormMorpheus in der App Einstellungen.',
};
diff --git a/frontend/src/ui/i18n/el.ts b/frontend/src/ui/i18n/el.ts
index 605fd62..c9033b6 100644
--- a/frontend/src/ui/i18n/el.ts
+++ b/frontend/src/ui/i18n/el.ts
@@ -971,4 +971,9 @@ export const el: Record = {
'This character cannot walk from here.': "Αυτός ο χαρακτήρας δεν μπορεί να περπατήσει από εδώ.", 'The character already stands there.': "Ο χαρακτήρας στέκεται ήδη εκεί.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "Το περπάτημα ξεπερνά το τέλος του χαρακτήρα στο Χρονολόγιο: μεγαλώστε το μπλοκ του ή την ταινία, ή ξεκινήστε νωρίτερα.",
'Rear': "Πίσω", 'Lighting': "Φωτισμός", 'Historical': "Ιστορικά",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "Η ενσωματωμένη φωνή χρειάζεται υπολογιστή. Στο iPad χρησιμοποιήστε έναν διακομιστή ομιλίας στο ίδιο δίκτυο ή μια διαδικτυακή φωνή.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "Δώστε τη διεύθυνση ενός διακομιστή ομιλίας σε υπολογιστή στο ίδιο δίκτυο. Λειτουργεί οποιαδήποτε εφαρμογή εκεί που απαντά στο κοινό API ομιλίας, ακόμη και με κλωνοποιημένη φωνή. Ξεκινήστε τον πρώτα.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "Το δικό σας κλειδί ElevenLabs. Φυλάσσεται στην κλειδοθήκη αυτού του iPad και αποστέλλεται μόνο σε αυτή την υπηρεσία.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "Η ακρόαση χρησιμοποιεί τη δική του αναγνώριση ομιλίας του iPad, πάνω στη συσκευή. Ζητά άδεια την πρώτη φορά.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "Η ακρόαση χρειάζεται άδεια για χρήση της αναγνώρισης ομιλίας. Επιτρέψτε την για το FormMorpheus στην εφαρμογή Ρυθμίσεις.",
};
diff --git a/frontend/src/ui/i18n/es.ts b/frontend/src/ui/i18n/es.ts
index 93070f2..dda33a7 100644
--- a/frontend/src/ui/i18n/es.ts
+++ b/frontend/src/ui/i18n/es.ts
@@ -1114,4 +1114,9 @@ export const es: Record = {
'This character cannot walk from here.': 'Este personaje no puede caminar desde aquí.', 'The character already stands there.': 'El personaje ya está ahí.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'La caminata pasa del final del personaje en la línea de tiempo: alarga su bloque o la película, o empieza antes.',
'Rear': 'Atrás', 'Lighting': 'Iluminación', 'Historical': 'Históricos',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'La voz integrada necesita un ordenador. En el iPad, usa un servidor de voz en la misma red o una voz en línea.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Indica la dirección de un servidor de voz en un ordenador de la misma red. Allí funciona cualquier aplicación que responda a la API de voz habitual, incluida una voz clonada. Inícialo primero.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Tu propia clave de ElevenLabs. Se guarda en el llavero de este iPad y solo se envía a ese servicio.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'La escucha usa el reconocimiento de voz propio de este iPad, en el dispositivo. Pide permiso la primera vez.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'La escucha necesita permiso para usar el reconocimiento de voz. Permítelo para FormMorpheus en la app Ajustes.',
};
diff --git a/frontend/src/ui/i18n/fi.ts b/frontend/src/ui/i18n/fi.ts
index 937f98e..b3de527 100644
--- a/frontend/src/ui/i18n/fi.ts
+++ b/frontend/src/ui/i18n/fi.ts
@@ -1029,4 +1029,9 @@ export const fi: Record = {
'This character cannot walk from here.': 'Tämä hahmo ei voi kävellä täältä.', 'The character already stands there.': 'Hahmo seisoo jo siinä.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Kävely jatkuu hahmon loppua pidemmälle aikajanalla: pidennä sen lohkoa tai elokuvaa tai aloita aiemmin.',
'Rear': 'Takaa', 'Lighting': 'Valaistus', 'Historical': 'Historialliset',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Sisäänrakennettu ääni tarvitsee tietokoneen. iPadilla käytä puhepalvelinta samassa verkossa tai verkkoääntä.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Anna samassa verkossa olevan tietokoneen puhepalvelimen osoite. Siellä toimii mikä tahansa sovellus, joka vastaa yleiseen puhe-rajapintaan, myös kloonattu ääni. Käynnistä se ensin.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Oma ElevenLabs-avaimesi. Se säilytetään tämän iPadin avainnipussa ja lähetetään vain kyseiselle palvelulle.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Kuuntelu käyttää tämän iPadin omaa puheentunnistusta laitteella. Se pyytää luvan ensimmäisellä kerralla.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Kuuntelu tarvitsee luvan puheentunnistuksen käyttöön. Salli se FormMorpheusille Asetukset-sovelluksessa.',
};
diff --git a/frontend/src/ui/i18n/fr.ts b/frontend/src/ui/i18n/fr.ts
index 7c123c1..9db94b7 100644
--- a/frontend/src/ui/i18n/fr.ts
+++ b/frontend/src/ui/i18n/fr.ts
@@ -1134,4 +1134,9 @@ export const fr: Record = {
'This character cannot walk from here.': "Ce personnage ne peut pas marcher à partir d'ici.", 'The character already stands there.': "Le personnage se trouve déjà là.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "La marche dépasse la fin du personnage sur la chronologie : allongez son bloc ou le film, ou commencez plus tôt.",
'Rear': "Dos", 'Lighting': "Éclairage", 'Historical': "Historique",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "La voix intégrée nécessite un ordinateur. Sur iPad, utilisez un serveur vocal du même réseau, ou une voix en ligne.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "Indiquez l'adresse d'un serveur vocal sur un ordinateur du même réseau. Toute application qui y répond à l'API vocale courante fonctionne, y compris une voix clonée. Lancez-le d'abord.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "Votre propre clé ElevenLabs. Elle est conservée dans le trousseau de cet iPad et envoyée uniquement à ce service.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "L'écoute utilise la reconnaissance vocale propre à cet iPad, sur l'appareil. Elle demande l'autorisation la première fois.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "L'écoute a besoin de l'autorisation d'utiliser la reconnaissance vocale. Autorisez-la pour FormMorpheus dans l'app Réglages.",
};
diff --git a/frontend/src/ui/i18n/hi.ts b/frontend/src/ui/i18n/hi.ts
index 9148813..b869009 100644
--- a/frontend/src/ui/i18n/hi.ts
+++ b/frontend/src/ui/i18n/hi.ts
@@ -1077,4 +1077,9 @@ export const hi: Record = {
'This character draws nothing to walk.': "इस कैरेक्टर में चलाने के लिए कुछ बना नहीं है।", 'This character cannot walk from here.': "यह कैरेक्टर यहाँ से चल नहीं सकता।", 'The character already stands there.': "कैरेक्टर पहले से वहीं खड़ा है।",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "चाल टाइमलाइन पर कैरेक्टर के अंत से आगे निकल जाती है: उसका ब्लॉक या मूवी लंबी करें, या पहले शुरू करें।",
'Rear': "पीछे", 'Lighting': "प्रकाश व्यवस्था", 'Historical': "ऐतिहासिक",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "अंतर्निहित आवाज़ के लिए कंप्यूटर चाहिए। iPad पर उसी नेटवर्क के किसी स्पीच सर्वर या ऑनलाइन आवाज़ का उपयोग करें।",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "उसी नेटवर्क के किसी कंप्यूटर पर चल रहे स्पीच सर्वर का पता दें। वहाँ कोई भी ऐप जो आम स्पीच API का जवाब देता है, चलता है, क्लोन की हुई आवाज़ भी। उसे पहले शुरू करें।",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "आपकी अपनी ElevenLabs कुंजी। यह इस iPad के कीचेन में रखी जाती है और केवल उसी सेवा को भेजी जाती है।",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "सुनना इस iPad की अपनी स्पीच रिकग्निशन का उपयोग करता है, डिवाइस पर ही। यह पहली बार अनुमति माँगता है।",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "सुनने के लिए स्पीच रिकग्निशन का उपयोग करने की अनुमति चाहिए। सेटिंग ऐप में FormMorpheus के लिए इसे अनुमति दें।",
};
diff --git a/frontend/src/ui/i18n/hu.ts b/frontend/src/ui/i18n/hu.ts
index 2f73bdc..b03eece 100644
--- a/frontend/src/ui/i18n/hu.ts
+++ b/frontend/src/ui/i18n/hu.ts
@@ -895,4 +895,9 @@ export const hu: Record = {
'This character draws nothing to walk.': "Ennek a karakternek nincs mit sétáltatni.", 'This character cannot walk from here.': "Ez a karakter innen nem tud sétálni.", 'The character already stands there.': "A karakter már ott áll.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "A séta túlnyúlik a karakter végén az Idővonalon: nyújtsa meg a blokkját vagy a filmet, vagy kezdje korábban.",
'Rear': "Hátulnézet", 'Lighting': "Világítás", 'Historical': "Történelmi",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "A beépített hanghoz számítógép kell. iPaden használj beszédszervert ugyanazon a hálózaton, vagy online hangot.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "Add meg egy ugyanazon a hálózaton lévő számítógép beszédszerverének címét. Ott bármely alkalmazás működik, amely válaszol az általános beszéd-API-ra, klónozott hanggal együtt. Először indítsd el.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "Saját ElevenLabs-kulcsod. Az iPad kulcstartójában tárolódik, és csak arra a szolgáltatásra kerül elküldésre.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "A hallgatás az iPad saját beszédfelismerését használja, magán az eszközön. Első alkalommal engedélyt kér.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "A hallgatáshoz engedély kell a beszédfelismerés használatához. Engedélyezd a FormMorpheus számára a Beállítások alkalmazásban.",
};
diff --git a/frontend/src/ui/i18n/id.ts b/frontend/src/ui/i18n/id.ts
index 6ed92a5..5e11081 100644
--- a/frontend/src/ui/i18n/id.ts
+++ b/frontend/src/ui/i18n/id.ts
@@ -1078,4 +1078,9 @@ export const id: Record = {
'This character draws nothing to walk.': "Karakter ini tidak punya gambar untuk dijalankan.", 'This character cannot walk from here.': "Karakter ini tidak dapat berjalan dari sini.", 'The character already stands there.': "Karakter sudah berdiri di sana.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "Langkah berjalan melewati akhir karakter di Timeline: perpanjang bloknya atau filmnya, atau mulai lebih awal.",
'Rear': "Belakang", 'Lighting': "Pencahayaan", 'Historical': "Bersejarah",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "Suara bawaan memerlukan komputer. Di iPad, gunakan server ucapan di jaringan yang sama, atau suara online.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "Masukkan alamat server ucapan di komputer pada jaringan yang sama. Aplikasi apa pun di sana yang menjawab API ucapan umum dapat dipakai, termasuk suara hasil kloning. Jalankan terlebih dahulu.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "Kunci ElevenLabs milik Anda sendiri. Kunci ini disimpan di keychain iPad ini dan hanya dikirim ke layanan tersebut.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "Mendengarkan memakai pengenalan ucapan bawaan iPad ini, langsung di perangkat. Izin akan diminta saat pertama kali.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "Mendengarkan memerlukan izin untuk memakai pengenalan ucapan. Izinkan untuk FormMorpheus di app Pengaturan.",
};
diff --git a/frontend/src/ui/i18n/it.ts b/frontend/src/ui/i18n/it.ts
index a987368..04515a2 100644
--- a/frontend/src/ui/i18n/it.ts
+++ b/frontend/src/ui/i18n/it.ts
@@ -1152,4 +1152,9 @@ export const it: Record = {
'This character draws nothing to walk.': "Questo personaggio non ha nulla di disegnato da far camminare.", 'This character cannot walk from here.': "Questo personaggio non può camminare da qui.", 'The character already stands there.': "Il personaggio si trova già lì.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "La camminata supera la fine del personaggio sulla timeline: allunga il suo blocco o il film, oppure inizia prima.",
'Rear': "Retro", 'Lighting': "Illuminazione", 'Historical': "Storici",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "La voce integrata richiede un computer. Su iPad usa un server vocale sulla stessa rete, oppure una voce online.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "Indica l'indirizzo di un server vocale su un computer della stessa rete. Qualsiasi app lì che risponde alla comune API vocale funziona, compresa una voce clonata. Avvialo prima.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "La tua chiave ElevenLabs. Viene conservata nel portachiavi di questo iPad e inviata solo a quel servizio.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "L'ascolto usa il riconoscimento vocale di questo iPad, direttamente sul dispositivo. Chiede il permesso la prima volta.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "L'ascolto ha bisogno del permesso di usare il riconoscimento vocale. Consentilo per FormMorpheus nell'app Impostazioni.",
};
diff --git a/frontend/src/ui/i18n/ja.ts b/frontend/src/ui/i18n/ja.ts
index 3655616..cd023ba 100644
--- a/frontend/src/ui/i18n/ja.ts
+++ b/frontend/src/ui/i18n/ja.ts
@@ -1075,4 +1075,9 @@ export const ja: Record = {
'This character draws nothing to walk.': "このキャラクターには歩かせる描画がありません。", 'This character cannot walk from here.': "このキャラクターはここからは歩けません。", 'The character already stands there.': "キャラクターはすでにそこに立っています。",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "歩きがタイムライン上のキャラクターの終わりを超えてしまいます。ブロックかムービーを長くするか、もっと早く始めてください。",
'Rear': "背面", 'Lighting': "ライティング", 'Historical': "歴史",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "内蔵ボイスにはコンピューターが必要です。iPad では、同じネットワーク上の音声サーバーかオンラインボイスを使ってください。",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "同じネットワーク上のコンピューターにある音声サーバーのアドレスを入力してください。一般的な音声 API に応答するアプリなら、クローンした声も含めて使えます。先に起動しておいてください。",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "ご自身の ElevenLabs キーです。この iPad のキーチェーンに保管され、そのサービスにのみ送信されます。",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "聞き取りは、この iPad 自身の音声認識をデバイス上で使います。初回に許可を求められます。",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "聞き取りには音声認識を使う許可が必要です。設定アプリで FormMorpheus に許可してください。",
};
diff --git a/frontend/src/ui/i18n/ko.ts b/frontend/src/ui/i18n/ko.ts
index ac27b1c..2d645cb 100644
--- a/frontend/src/ui/i18n/ko.ts
+++ b/frontend/src/ui/i18n/ko.ts
@@ -1075,4 +1075,9 @@ export const ko: Record = {
'This character draws nothing to walk.': "이 캐릭터에는 걷게 할 그림이 없습니다.", 'This character cannot walk from here.': "이 캐릭터는 여기서 걸을 수 없습니다.", 'The character already stands there.': "캐릭터가 이미 그곳에 서 있습니다.",
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': "걷기가 타임라인에서 캐릭터가 끝나는 지점을 넘어갑니다. 블록이나 무비를 늘리거나 더 일찍 시작하세요.",
'Rear': "후면", 'Lighting': "조명", 'Historical': "역사",
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': "내장 음성은 컴퓨터가 필요합니다. iPad에서는 같은 네트워크의 음성 서버나 온라인 음성을 사용하세요.",
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': "같은 네트워크에 있는 컴퓨터의 음성 서버 주소를 입력하세요. 일반적인 음성 API에 응답하는 앱이면 복제한 목소리를 포함해 사용할 수 있습니다. 먼저 실행하세요.",
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': "직접 만든 ElevenLabs 키입니다. 이 iPad의 키체인에 보관되며 해당 서비스에만 전송됩니다.",
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': "듣기는 이 iPad의 자체 음성 인식을 기기에서 사용합니다. 처음 사용할 때 권한을 요청합니다.",
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': "듣기에는 음성 인식을 사용할 권한이 필요합니다. 설정 앱에서 FormMorpheus에 허용하세요.",
};
diff --git a/frontend/src/ui/i18n/nb.ts b/frontend/src/ui/i18n/nb.ts
index 6595d94..ada1b3e 100644
--- a/frontend/src/ui/i18n/nb.ts
+++ b/frontend/src/ui/i18n/nb.ts
@@ -1056,4 +1056,9 @@ export const nb: Record = {
'This character draws nothing to walk.': 'Denne figuren har ingenting å gå med.', 'This character cannot walk from here.': 'Denne figuren kan ikke gå herfra.', 'The character already stands there.': 'Figuren står allerede der.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Gåturen går forbi slutten av figuren på tidslinjen: gjør blokken eller filmen lengre, eller start tidligere.',
'Rear': 'Bakfra', 'Lighting': 'Belysning', 'Historical': 'Historisk',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Den innebygde stemmen trenger en datamaskin. På iPad kan du bruke en taleserver på samme nettverk eller en nettstemme.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Oppgi adressen til en taleserver på en datamaskin på samme nettverk. Alle apper der som svarer på det vanlige tale-API-et, fungerer, også en klonet stemme. Start den først.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Din egen ElevenLabs-nøkkel. Den lagres i nøkkelringen på denne iPaden og sendes bare til den tjenesten.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Lytting bruker denne iPadens egen talegjenkjenning, direkte på enheten. Den ber om tillatelse første gang.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Lytting trenger tillatelse til å bruke talegjenkjenning. Tillat det for FormMorpheus i Innstillinger-appen.',
};
diff --git a/frontend/src/ui/i18n/nl.ts b/frontend/src/ui/i18n/nl.ts
index 697a7c6..9c67acc 100644
--- a/frontend/src/ui/i18n/nl.ts
+++ b/frontend/src/ui/i18n/nl.ts
@@ -1056,4 +1056,9 @@ export const nl: Record = {
'This character draws nothing to walk.': 'Dit personage heeft niets getekend om mee te lopen.', 'This character cannot walk from here.': 'Dit personage kan vanaf hier niet lopen.', 'The character already stands there.': 'Het personage staat daar al.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'De wandeling loopt voorbij het einde van het personage op de Tijdlijn: maak het blok of de film langer, of begin eerder.',
'Rear': 'Achterkant', 'Lighting': 'Verlichting', 'Historical': 'Historisch',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'De ingebouwde stem heeft een computer nodig. Gebruik op de iPad een spraakserver op hetzelfde netwerk, of een online stem.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Geef het adres van een spraakserver op een computer op hetzelfde netwerk. Elke app daar die de gangbare spraak-API beantwoordt, werkt, ook met een gekloonde stem. Start hem eerst.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Je eigen ElevenLabs-sleutel. Hij wordt bewaard in de sleutelhanger van deze iPad en alleen naar die dienst gestuurd.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Luisteren gebruikt de eigen spraakherkenning van deze iPad, op het apparaat zelf. De eerste keer vraagt het om toestemming.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Luisteren heeft toestemming nodig om spraakherkenning te gebruiken. Sta het toe voor FormMorpheus in de app Instellingen.',
};
diff --git a/frontend/src/ui/i18n/pl.ts b/frontend/src/ui/i18n/pl.ts
index 464738d..7261258 100644
--- a/frontend/src/ui/i18n/pl.ts
+++ b/frontend/src/ui/i18n/pl.ts
@@ -898,4 +898,9 @@ export const pl: Record = {
'This character draws nothing to walk.': 'Ta postać nie ma nic do chodzenia.', 'This character cannot walk from here.': 'Ta postać nie może stąd iść.', 'The character already stands there.': 'Postać już tam stoi.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Chód wykracza poza koniec postaci na osi czasu: wydłuż jej blok lub film albo zacznij wcześniej.',
'Rear': 'Tył', 'Lighting': 'Oświetlenie', 'Historical': 'Historyczne',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Wbudowany głos wymaga komputera. Na iPadzie użyj serwera mowy w tej samej sieci albo głosu online.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Podaj adres serwera mowy na komputerze w tej samej sieci. Działa tam każda aplikacja, która odpowiada na popularne API mowy, także ze sklonowanym głosem. Najpierw go uruchom.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Twój własny klucz ElevenLabs. Jest przechowywany w pęku kluczy tego iPada i wysyłany tylko do tej usługi.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Słuchanie korzysta z własnego rozpoznawania mowy tego iPada, na urządzeniu. Za pierwszym razem prosi o zgodę.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Słuchanie wymaga zgody na używanie rozpoznawania mowy. Zezwól na to dla FormMorpheus w aplikacji Ustawienia.',
};
diff --git a/frontend/src/ui/i18n/pt-BR.ts b/frontend/src/ui/i18n/pt-BR.ts
index 01c98e4..fe1df7f 100644
--- a/frontend/src/ui/i18n/pt-BR.ts
+++ b/frontend/src/ui/i18n/pt-BR.ts
@@ -1148,4 +1148,9 @@ export const ptBR: Record = {
'This character draws nothing to walk.': 'Este personagem não desenha nada para andar.', 'This character cannot walk from here.': 'Este personagem não pode andar a partir daqui.', 'The character already stands there.': 'O personagem já está ali.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'A caminhada passa do fim do personagem na Linha do tempo: aumente o bloco dele ou o filme, ou comece antes.',
'Rear': 'Costas', 'Lighting': 'Iluminação', 'Historical': 'Históricos',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'A voz integrada precisa de um computador. No iPad, use um servidor de fala na mesma rede ou uma voz online.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Informe o endereço de um servidor de fala em um computador na mesma rede. Qualquer app lá que responda à API de fala comum funciona, inclusive com uma voz clonada. Inicie-o primeiro.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Sua própria chave do ElevenLabs. Ela fica guardada no chaveiro deste iPad e é enviada somente a esse serviço.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'A escuta usa o reconhecimento de fala do próprio iPad, no dispositivo. Ela pede permissão na primeira vez.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'A escuta precisa de permissão para usar o reconhecimento de fala. Permita para o FormMorpheus no app Ajustes.',
};
diff --git a/frontend/src/ui/i18n/ru.ts b/frontend/src/ui/i18n/ru.ts
index e5c88e1..95007ea 100644
--- a/frontend/src/ui/i18n/ru.ts
+++ b/frontend/src/ui/i18n/ru.ts
@@ -899,4 +899,9 @@ export const ru: Record = {
'This character draws nothing to walk.': 'У этого персонажа нечего двигать при ходьбе.', 'This character cannot walk from here.': 'Этот персонаж не может идти отсюда.', 'The character already stands there.': 'Персонаж уже стоит там.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Ходьба выходит за конец персонажа на Шкале времени: удлините его блок или фильм либо начните раньше.',
'Rear': 'Сзади', 'Lighting': 'Освещение', 'Historical': 'Исторические',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Встроенному голосу нужен компьютер. На iPad используйте речевой сервер в той же сети или онлайн-голос.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Укажите адрес речевого сервера на компьютере в той же сети. Там работает любое приложение, которое отвечает на распространённый речевой API, в том числе с клонированным голосом. Сначала запустите его.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Ваш личный ключ ElevenLabs. Он хранится в связке ключей этого iPad и отправляется только этому сервису.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Прослушивание использует собственное распознавание речи этого iPad прямо на устройстве. При первом запуске запрашивается разрешение.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Для прослушивания нужно разрешение на распознавание речи. Разрешите его для FormMorpheus в приложении Настройки.',
};
diff --git a/frontend/src/ui/i18n/sr-Latn.ts b/frontend/src/ui/i18n/sr-Latn.ts
index 0a04fd7..faf051b 100644
--- a/frontend/src/ui/i18n/sr-Latn.ts
+++ b/frontend/src/ui/i18n/sr-Latn.ts
@@ -898,4 +898,9 @@ export const srLatn: Record = {
'This character draws nothing to walk.': 'Ovaj lik nema ništa za hodanje.', 'This character cannot walk from here.': 'Ovaj lik ne može da hoda odavde.', 'The character already stands there.': 'Lik već stoji tamo.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Hodanje prelazi kraj lika na Vremenskoj liniji: produžite njegov blok ili film, ili počnite ranije.',
'Rear': 'Otpozadi', 'Lighting': 'Osvetljenje', 'Historical': 'Istorijski',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Ugrađeni glas zahteva računar. Na iPad-u koristite server za govor na istoj mreži ili onlajn glas.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Unesite adresu servera za govor na računaru na istoj mreži. Tamo radi svaka aplikacija koja odgovara na uobičajeni API za govor, uključujući i kloniran glas. Prvo ga pokrenite.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Vaš sopstveni ElevenLabs ključ. Čuva se u privesku za ključeve ovog iPad-a i šalje samo toj usluzi.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Slušanje koristi sopstveno prepoznavanje govora ovog iPad-a, na samom uređaju. Prvi put traži dozvolu.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Slušanje zahteva dozvolu za korišćenje prepoznavanja govora. Dozvolite ga za FormMorpheus u aplikaciji Podešavanja.',
};
diff --git a/frontend/src/ui/i18n/sv.ts b/frontend/src/ui/i18n/sv.ts
index a648d51..89add54 100644
--- a/frontend/src/ui/i18n/sv.ts
+++ b/frontend/src/ui/i18n/sv.ts
@@ -987,4 +987,9 @@ export const sv: Record = {
'This character draws nothing to walk.': 'Den här karaktären ritar inget att gå med.', 'This character cannot walk from here.': 'Den här karaktären kan inte gå härifrån.', 'The character already stands there.': 'Karaktären står redan där.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Gången fortsätter förbi slutet på karaktären på tidslinjen: förläng dess block eller filmen, eller börja tidigare.',
'Rear': 'Bakifrån', 'Lighting': 'Belysning', 'Historical': 'Historiska',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Den inbyggda rösten kräver en dator. På iPad kan du använda en talserver på samma nätverk eller en onlineröst.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Ange adressen till en talserver på en dator på samma nätverk. Alla appar där som svarar på det vanliga tal-API:et fungerar, även med en klonad röst. Starta den först.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Din egen ElevenLabs-nyckel. Den sparas i den här iPadens nyckelring och skickas bara till den tjänsten.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Lyssning använder den här iPadens egen taligenkänning, direkt på enheten. Den frågar om tillstånd första gången.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Lyssning behöver tillstånd att använda taligenkänning. Tillåt det för FormMorpheus i appen Inställningar.',
};
diff --git a/frontend/src/ui/i18n/th.ts b/frontend/src/ui/i18n/th.ts
index 384e5ab..44ac546 100644
--- a/frontend/src/ui/i18n/th.ts
+++ b/frontend/src/ui/i18n/th.ts
@@ -1096,4 +1096,9 @@ export const th: Record = {
'This character draws nothing to walk.': 'ตัวละครนี้ไม่มีส่วนที่วาดไว้ให้เดิน', 'This character cannot walk from here.': 'ตัวละครนี้เดินจากตรงนี้ไม่ได้', 'The character already stands there.': 'ตัวละครยืนอยู่ตรงนั้นแล้ว',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'การเดินยาวเกินจุดสิ้นสุดของตัวละครบนไทม์ไลน์: ขยายบล็อกของตัวละครหรือภาพยนตร์ หรือเริ่มให้เร็วขึ้น',
'Rear': 'ด้านหลัง', 'Lighting': 'การจัดแสง', 'Historical': 'ประวัติศาสตร์',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'เสียงในตัวต้องใช้คอมพิวเตอร์ บน iPad ให้ใช้เซิร์ฟเวอร์เสียงพูดในเครือข่ายเดียวกัน หรือเสียงออนไลน์',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'ใส่ที่อยู่ของเซิร์ฟเวอร์เสียงพูดบนคอมพิวเตอร์ในเครือข่ายเดียวกัน แอปใดก็ได้ที่นั่นที่ตอบ API เสียงพูดทั่วไปใช้งานได้ รวมถึงเสียงโคลน เริ่มเซิร์ฟเวอร์ก่อน',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'คีย์ ElevenLabs ของคุณเอง เก็บไว้ในพวงกุญแจของ iPad เครื่องนี้และส่งไปยังบริการนั้นเท่านั้น',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'การฟังใช้การรู้จำเสียงพูดของ iPad เครื่องนี้เอง บนอุปกรณ์ โดยจะขออนุญาตในครั้งแรก',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'การฟังต้องได้รับอนุญาตให้ใช้การรู้จำเสียงพูด อนุญาตให้ FormMorpheus ในแอปการตั้งค่า',
};
diff --git a/frontend/src/ui/i18n/tr.ts b/frontend/src/ui/i18n/tr.ts
index 122d4f2..e892e0f 100644
--- a/frontend/src/ui/i18n/tr.ts
+++ b/frontend/src/ui/i18n/tr.ts
@@ -1020,4 +1020,9 @@ export const tr: Record = {
'This character draws nothing to walk.': 'Bu karakterin yürütülecek bir çizimi yok.', 'This character cannot walk from here.': 'Bu karakter buradan yürüyemez.', 'The character already stands there.': 'Karakter zaten orada duruyor.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Yürüyüş, karakterin Zaman Çizelgesi\'ndeki sonunu aşıyor: bloğunu veya filmi uzatın ya da daha erken başlayın.',
'Rear': 'Arka', 'Lighting': 'Aydınlatma', 'Historical': 'Tarihi',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Yerleşik ses bir bilgisayar gerektirir. iPad\'de aynı ağdaki bir konuşma sunucusunu ya da çevrimiçi bir sesi kullanın.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Aynı ağdaki bir bilgisayarda çalışan konuşma sunucusunun adresini girin. Orada yaygın konuşma API\'sine yanıt veren her uygulama çalışır, klonlanmış bir ses de dahil. Önce onu başlatın.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Kendi ElevenLabs anahtarınız. Bu iPad\'in anahtar zincirinde saklanır ve yalnızca o hizmete gönderilir.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Dinleme, bu iPad\'in kendi konuşma tanımasını cihaz üzerinde kullanır. İlk seferde izin ister.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Dinleme, konuşma tanımayı kullanmak için izin gerektirir. Ayarlar uygulamasında FormMorpheus için izin verin.',
};
diff --git a/frontend/src/ui/i18n/uk.ts b/frontend/src/ui/i18n/uk.ts
index ee27dcc..84847c5 100644
--- a/frontend/src/ui/i18n/uk.ts
+++ b/frontend/src/ui/i18n/uk.ts
@@ -915,4 +915,9 @@ export const uk: Record = {
'This character draws nothing to walk.': 'Цей персонаж не має що малювати для ходьби.', 'This character cannot walk from here.': 'Цей персонаж не може йти звідси.', 'The character already stands there.': 'Персонаж уже стоїть там.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Ходьба виходить за кінець персонажа на часовій шкалі: подовжте його блок або фільм, або почніть раніше.',
'Rear': 'Ззаду', 'Lighting': 'Освітлення', 'Historical': 'Історичні',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Вбудованому голосу потрібен комп\'ютер. На iPad використовуйте сервер мовлення в тій самій мережі або онлайн-голос.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Вкажіть адресу сервера мовлення на комп\'ютері в тій самій мережі. Там працює будь-який застосунок, що відповідає на поширений API мовлення, зокрема з клонованим голосом. Спершу запустіть його.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Ваш власний ключ ElevenLabs. Він зберігається в в\'язці ключів цього iPad і надсилається лише цій службі.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Слухання використовує власне розпізнавання мовлення цього iPad просто на пристрої. Уперше воно запитує дозвіл.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Для слухання потрібен дозвіл на розпізнавання мовлення. Дозвольте його для FormMorpheus у застосунку Налаштування.',
};
diff --git a/frontend/src/ui/i18n/vi.ts b/frontend/src/ui/i18n/vi.ts
index 5bddd5b..d3ac705 100644
--- a/frontend/src/ui/i18n/vi.ts
+++ b/frontend/src/ui/i18n/vi.ts
@@ -1115,4 +1115,9 @@ export const vi: Record = {
'The character already stands there.': 'Nhân vật đã đứng ở đó rồi.',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': 'Lượt đi bộ vượt quá phần cuối của nhân vật trên Dòng thời gian: hãy kéo dài khối của nó hoặc phim, hoặc bắt đầu sớm hơn.',
'Rear': 'Phía sau', 'Lighting': 'Chiếu sáng', 'Historical': 'Lịch sử',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': 'Giọng tích hợp cần có máy tính. Trên iPad, hãy dùng máy chủ giọng nói trong cùng mạng, hoặc giọng trực tuyến.',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': 'Nhập địa chỉ máy chủ giọng nói trên máy tính cùng mạng. Mọi ứng dụng ở đó có phản hồi API giọng nói phổ biến đều dùng được, kể cả giọng nhân bản. Hãy khởi động máy chủ trước.',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': 'Khóa ElevenLabs của riêng bạn. Khóa được giữ trong chuỗi khóa của iPad này và chỉ gửi tới dịch vụ đó.',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': 'Nghe dùng tính năng nhận dạng giọng nói riêng của iPad này, ngay trên thiết bị. Lần đầu sẽ xin quyền.',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': 'Nghe cần quyền dùng nhận dạng giọng nói. Hãy cho phép FormMorpheus trong ứng dụng Cài đặt.',
};
diff --git a/frontend/src/ui/i18n/zh-CN.ts b/frontend/src/ui/i18n/zh-CN.ts
index 5e3b6f0..3738158 100644
--- a/frontend/src/ui/i18n/zh-CN.ts
+++ b/frontend/src/ui/i18n/zh-CN.ts
@@ -1115,4 +1115,9 @@ export const zhCN: Record = {
'The character already stands there.': '角色已经站在那里了。',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': '行走超出了角色在时间轴上的结尾:请加长它的整块或影片,或提前开始。',
'Rear': '背面', 'Lighting': '灯光', 'Historical': '历史',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': '内置语音需要电脑。在 iPad 上,请使用同一网络中的语音服务器,或在线语音。',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': '请填写同一网络中某台电脑上语音服务器的地址。那里任何能响应通用语音 API 的应用都可使用,包括克隆的声音。请先启动它。',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': '你自己的 ElevenLabs 密钥。它保存在这台 iPad 的钥匙串中,只会发送给该服务。',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': '聆听使用这台 iPad 自带的语音识别,在设备上完成。第一次会请求权限。',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': '聆听需要使用语音识别的权限。请在“设置”应用中为 FormMorpheus 允许。',
};
diff --git a/frontend/src/ui/i18n/zh-TW.ts b/frontend/src/ui/i18n/zh-TW.ts
index 9a84680..afb5b2f 100644
--- a/frontend/src/ui/i18n/zh-TW.ts
+++ b/frontend/src/ui/i18n/zh-TW.ts
@@ -1115,4 +1115,9 @@ export const zhTW: Record = {
'The character already stands there.': '角色已經站在那裡了。',
'The walk runs past the end of the character on the Timeline: lengthen its block or the movie, or start earlier.': '行走超出了角色在時間軸上的結尾:請加長它的整塊或影片,或提前開始。',
'Rear': '背面', 'Lighting': '燈光', 'Historical': '歷史',
+ 'The built-in voice needs a computer. On iPad, use a speech server on the same network, or an online voice.': '內建語音需要電腦。在 iPad 上,請使用同一網路中的語音伺服器,或線上語音。',
+ 'Give the address of a speech server on a computer on the same network. Any app there that answers the common speech API works, a cloned voice included. Start it first.': '請填寫同一網路中某台電腦上語音伺服器的位址。那裡任何能回應通用語音 API 的應用程式都能使用,包括複製的聲音。請先啟動它。',
+ 'Your own ElevenLabs key. It is kept in this iPad\'s keychain and sent only to that service.': '你自己的 ElevenLabs 金鑰。它保存在這台 iPad 的鑰匙圈中,只會傳送給該服務。',
+ 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.': '聆聽使用這台 iPad 內建的語音辨識,在裝置上完成。第一次會要求權限。',
+ 'Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.': '聆聽需要使用語音辨識的權限。請在「設定」App 中為 FormMorpheus 允許。',
};
diff --git a/frontend/src/ui/subtitles-panel.ts b/frontend/src/ui/subtitles-panel.ts
index 402170f..dcc8119 100644
--- a/frontend/src/ui/subtitles-panel.ts
+++ b/frontend/src/ui/subtitles-panel.ts
@@ -12,8 +12,12 @@ import { chooseOrCancel } from './dialogs';
import { el, patchList, q, setChecked, setClass, setDisabled, setHidden, setStyleVar, setText, setValue } from './dom';
import { enhanceSelect } from './dropdown';
import { t } from './i18n';
+import { platform } from '../platform';
import '../styles/subtitles.css';
+// the iPad listens with its own on-device speech recognition: no runtime, no model to download, a permission asked once
+const IPAD = platform.kind === 'ipad';
+
type Position = SubtitleStyle['position'];
const STORE = 'formmorpheus.subtitles';
@@ -189,7 +193,9 @@ export class SubtitlesPanel {
setHidden(this.listenCancel, true);
const listenActs = el('
');
listenActs.append(this.listenBtn, this.listenCancel);
- this.runtimeNote = para('fm-sub-note', 'Listening uses the built-in voice\'s runtime. Set up the built-in voice first, in the AI Voice card.');
+ this.runtimeNote = IPAD
+ ? para('fm-sub-note', 'Listening uses this iPad\'s own speech recognition, on the device. It asks for permission the first time.')
+ : para('fm-sub-note', 'Listening uses the built-in voice\'s runtime. Set up the built-in voice first, in the AI Voice card.');
setHidden(this.runtimeNote, true);
this.setupBox = el('
');
this.setupBtn = button('cv-btn', 'Download the listening model');
@@ -506,7 +512,7 @@ export class SubtitlesPanel {
private async listen(): Promise {
const block = this.soundSelected();
- if (!block || this.ctrl || !this.st?.ready) return;
+ if (!block || this.ctrl || !this.st || !(this.st.ready || IPAD)) return;
const id = block.id;
const name = block.name || this.engine.movie?.assets[block.asset as string]?.name || t('this sound');
const language = this.language.value || 'auto';
@@ -516,6 +522,7 @@ export class SubtitlesPanel {
this.ctrl = ctrl;
this.patchListen();
try {
+ if (!this.st.ready && !(await this.allowListening(ctrl.signal))) return;
const sound = await soundForSpeech(this.engine, id);
if (ctrl.signal.aborted) throw new DOMException('Cancelled', 'AbortError');
if (!sound) { this.showErr(t('This sound could not be read.')); return; }
@@ -536,6 +543,20 @@ export class SubtitlesPanel {
}
}
+ /** iPad: the first listening asks for the speech recognition permission through the setup route; says whether it was given. */
+ private async allowListening(signal: AbortSignal): Promise {
+ let job: VoiceJob | null = await voiceApi.setupListen();
+ while (job?.state === 'running') {
+ await new Promise((r) => window.setTimeout(r, POLL_MS));
+ if (signal.aborted) throw new DOMException('Cancelled', 'AbortError');
+ job = await voiceApi.listenJob();
+ }
+ this.st = await voiceApi.listenStatus();
+ if (this.st.ready) return true;
+ this.showErr(job?.error || t('Listening needs permission to use speech recognition. Allow it for FormMorpheus in the Settings app.'));
+ return false;
+ }
+
// ---- files ----
private async importFile(): Promise {
@@ -646,9 +667,9 @@ export class SubtitlesPanel {
const listening = !!this.ctrl;
const job = this.job?.state === 'running' ? this.job : null;
const ready = !!st?.ready && !job;
- setHidden(this.runtimeNote, !st || ready || !!job || st.runtime);
- setHidden(this.setupBox, !st || ready || (!st.runtime && !job));
- setHidden(this.readyBox, !ready);
+ setHidden(this.runtimeNote, !st || ready || (IPAD ? false : !!job || st.runtime));
+ setHidden(this.setupBox, IPAD || !st || ready || (!st.runtime && !job));
+ setHidden(this.readyBox, IPAD ? !st : !ready);
setHidden(this.setupBtn, !!job);
setHidden(this.setupCancel, !job);
setClass(this.prog, 'is-idle', !job);
@@ -669,7 +690,7 @@ export class SubtitlesPanel {
setText(this.listenBtn, listening ? t('Listening...') : t('Subtitles from this sound'));
setClass(this.listenBtn, 'is-busy', listening);
- setDisabled(this.listenBtn, listening || !ready || !this.soundSelected());
+ setDisabled(this.listenBtn, listening || !(IPAD ? !!st : ready) || !this.soundSelected());
setHidden(this.listenCancel, !listening);
setDisabled(this.language, off || listening);
}
diff --git a/frontend/src/ui/whats-new-data.ts b/frontend/src/ui/whats-new-data.ts
index 69b5943..4479efc 100644
--- a/frontend/src/ui/whats-new-data.ts
+++ b/frontend/src/ui/whats-new-data.ts
@@ -4,6 +4,15 @@ export interface Addition { title: string; text: string; command: string }
export interface Release { version: string; name: string; additions: Addition[] }
export const RELEASES: readonly Release[] = [
+ {
+ version: '0.38.0', name: 'More on the iPad',
+ additions: [
+ { title: 'AI Voice on iPad', text: 'Speak with your own online key, or through a speech server on a computer on the same network. The built-in voice needs a computer.', command: 'ai-voice' },
+ { title: 'Subtitles from a sound on iPad', text: 'Select a recording or a sound file and listen for its lines with the iPad\'s own speech recognition. Nothing is downloaded or sent anywhere.', command: 'subtitles' },
+ { title: 'My scenes on iPad', text: 'Save as Scene keeps scenery of your own in the Scenes folder in Files, to lay behind any movie. A deleted one waits in Recently Deleted.', command: 'scene.save-as' },
+ { title: 'Easier to touch', text: 'The Build panel, the scene strip and the AI Voice and Subtitles cards have larger touch targets, and Walk To Here is a touch and hold on the Stage.', command: 'character.walk-here' },
+ ],
+ },
{
version: '0.37.0', name: 'Props, effects and scenes',
additions: [
diff --git a/frontend/src/version.ts b/frontend/src/version.ts
index b209abe..655668e 100644
--- a/frontend/src/version.ts
+++ b/frontend/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.37.0';
+export const VERSION = '0.38.0';
diff --git a/ios/App/Info.plist b/ios/App/Info.plist
index 22b7df2..f7a8497 100644
--- a/ios/App/Info.plist
+++ b/ios/App/Info.plist
@@ -155,6 +155,15 @@
FormMorpheus uses the microphone only when you record narration or sound into a movie.
NSPhotoLibraryAddUsageDescription
FormMorpheus saves the movies and images you export to your photo library when you choose to.
+ NSSpeechRecognitionUsageDescription
+ FormMorpheus uses speech recognition on this iPad only when you ask it to write subtitles from a sound. The sound stays on this iPad.
+ NSLocalNetworkUsageDescription
+ FormMorpheus uses your local network only to reach the speech server you name for AI Voice.
+ NSAppTransportSecurity
+
+ NSAllowsLocalNetworking
+
+
UIApplicationSceneManifest
UIApplicationSupportsMultipleScenes
diff --git a/ios/App/ar.lproj/InfoPlist.strings b/ios/App/ar.lproj/InfoPlist.strings
index a407748..5430718 100644
--- a/ios/App/ar.lproj/InfoPlist.strings
+++ b/ios/App/ar.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "يستخدم FormMorpheus الميكروفون فقط عندما تسجّل تعليقًا صوتيًا أو صوتًا داخل فيلم.";
"NSPhotoLibraryAddUsageDescription" = "يحفظ FormMorpheus الأفلام والصور التي تصدّرها في مكتبة الصور لديك عندما تختار ذلك.";
+"NSSpeechRecognitionUsageDescription" = "يستخدم FormMorpheus التعرّف على الكلام على هذا الـ iPad فقط عندما تطلب منه كتابة ترجمة من صوت. يبقى الصوت على هذا الـ iPad.";
+"NSLocalNetworkUsageDescription" = "يستخدم FormMorpheus شبكتك المحلية فقط للوصول إلى خادم الكلام الذي تحدده للصوت بالذكاء الاصطناعي.";
diff --git a/ios/App/cs.lproj/InfoPlist.strings b/ios/App/cs.lproj/InfoPlist.strings
index e9cb57e..647d18f 100644
--- a/ios/App/cs.lproj/InfoPlist.strings
+++ b/ios/App/cs.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus používá mikrofon pouze tehdy, když nahráváte vyprávění nebo zvuk do filmu.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus ukládá filmy a obrázky, které exportujete, do vaší knihovny fotek, když to zvolíte.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus používá rozpoznávání řeči na tomto iPadu pouze tehdy, když jej požádáte o vytvoření titulků ze zvuku. Zvuk zůstává na tomto iPadu.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus používá vaši místní síť pouze k připojení k řečovému serveru, který zadáte pro Hlas AI.";
diff --git a/ios/App/da.lproj/InfoPlist.strings b/ios/App/da.lproj/InfoPlist.strings
index 31e2333..de906e2 100644
--- a/ios/App/da.lproj/InfoPlist.strings
+++ b/ios/App/da.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus bruger kun mikrofonen, når du optager fortælling eller lyd til en film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus gemmer de film og billeder, du eksporterer, i dit fotobibliotek, når du vælger det.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus bruger kun talegenkendelse på denne iPad, når du beder den skrive undertekster ud fra en lyd. Lyden bliver på denne iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus bruger kun dit lokale netværk til at nå den taleserver, du angiver til AI-stemme.";
diff --git a/ios/App/de.lproj/InfoPlist.strings b/ios/App/de.lproj/InfoPlist.strings
index dc386eb..8ff6cbd 100644
--- a/ios/App/de.lproj/InfoPlist.strings
+++ b/ios/App/de.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus verwendet das Mikrofon nur, wenn du eine Sprecherspur oder einen Ton in einen Film aufnimmst.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus sichert die Filme und Bilder, die du exportierst, in deiner Fotomediathek, wenn du das auswählst.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus verwendet die Spracherkennung auf diesem iPad nur, wenn du Untertitel aus einem Ton schreiben lässt. Der Ton bleibt auf diesem iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus verwendet dein lokales Netzwerk nur, um den Sprachserver zu erreichen, den du für KI-Stimme angibst.";
diff --git a/ios/App/el.lproj/InfoPlist.strings b/ios/App/el.lproj/InfoPlist.strings
index 551da10..d99448f 100644
--- a/ios/App/el.lproj/InfoPlist.strings
+++ b/ios/App/el.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "Το FormMorpheus χρησιμοποιεί το μικρόφωνο μόνο όταν ηχογραφείτε αφήγηση ή ήχο σε μια ταινία.";
"NSPhotoLibraryAddUsageDescription" = "Το FormMorpheus αποθηκεύει στη βιβλιοθήκη φωτογραφιών σας τις ταινίες και τις εικόνες που εξάγετε, όταν το επιλέξετε.";
+"NSSpeechRecognitionUsageDescription" = "Το FormMorpheus χρησιμοποιεί την αναγνώριση ομιλίας σε αυτό το iPad μόνο όταν του ζητάτε να γράψει υπότιτλους από έναν ήχο. Ο ήχος παραμένει σε αυτό το iPad.";
+"NSLocalNetworkUsageDescription" = "Το FormMorpheus χρησιμοποιεί το τοπικό σας δίκτυο μόνο για να φτάσει στον διακομιστή ομιλίας που ορίζετε για τη Φωνή AI.";
diff --git a/ios/App/en.lproj/InfoPlist.strings b/ios/App/en.lproj/InfoPlist.strings
index f6db630..3ebc2e9 100644
--- a/ios/App/en.lproj/InfoPlist.strings
+++ b/ios/App/en.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus uses the microphone only when you record narration or sound into a movie.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus saves the movies and images you export to your photo library when you choose to.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus uses speech recognition on this iPad only when you ask it to write subtitles from a sound. The sound stays on this iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus uses your local network only to reach the speech server you name for AI Voice.";
diff --git a/ios/App/es-MX.lproj/InfoPlist.strings b/ios/App/es-MX.lproj/InfoPlist.strings
index 3971d93..f23a64d 100644
--- a/ios/App/es-MX.lproj/InfoPlist.strings
+++ b/ios/App/es-MX.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus usa el micrófono solo cuando grabas narración o sonido en una película.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus guarda en tu biblioteca de fotos las películas e imágenes que exportas cuando tú lo decides.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus usa el reconocimiento de voz en este iPad solo cuando le pides que escriba subtítulos a partir de un sonido. El sonido se queda en este iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus usa tu red local solo para conectarse con el servidor de voz que indicas para Voz de IA.";
diff --git a/ios/App/es.lproj/InfoPlist.strings b/ios/App/es.lproj/InfoPlist.strings
index 354c764..af0ae32 100644
--- a/ios/App/es.lproj/InfoPlist.strings
+++ b/ios/App/es.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus usa el micrófono solo cuando grabas narración o sonido en una película.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus guarda en tu fototeca las películas e imágenes que exportas cuando así lo eliges.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus usa el reconocimiento de voz en este iPad solo cuando le pides que escriba subtítulos a partir de un sonido. El sonido no sale de este iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus usa tu red local solo para llegar al servidor de voz que indiques para Voz de IA.";
diff --git a/ios/App/fi.lproj/InfoPlist.strings b/ios/App/fi.lproj/InfoPlist.strings
index d7c8ca0..02f577e 100644
--- a/ios/App/fi.lproj/InfoPlist.strings
+++ b/ios/App/fi.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus käyttää mikrofonia vain, kun äänität selostusta tai ääntä elokuvaan.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus tallentaa viemäsi elokuvat ja kuvat kuvakirjastoosi, kun valitset sen.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus käyttää tämän iPadin puheentunnistusta vain, kun pyydät sitä kirjoittamaan tekstitykset äänestä. Ääni pysyy tässä iPadissa.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus käyttää lähiverkkoasi vain tavoittaakseen puhepalvelimen, jonka annat Tekoälyäänelle.";
diff --git a/ios/App/fr-CA.lproj/InfoPlist.strings b/ios/App/fr-CA.lproj/InfoPlist.strings
index 5eb950f..ceef1b4 100644
--- a/ios/App/fr-CA.lproj/InfoPlist.strings
+++ b/ios/App/fr-CA.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus utilise le microphone uniquement lorsque vous enregistrez une narration ou du son dans un film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus enregistre dans votre photothèque les films et les images que vous exportez, lorsque vous le choisissez.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus utilise la reconnaissance vocale sur cet iPad uniquement lorsque vous lui demandez d'écrire des sous-titres à partir d'un son. Le son reste sur cet iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus utilise votre réseau local uniquement pour joindre le serveur vocal que vous indiquez pour Voix IA.";
diff --git a/ios/App/fr.lproj/InfoPlist.strings b/ios/App/fr.lproj/InfoPlist.strings
index 80d3e24..95b6973 100644
--- a/ios/App/fr.lproj/InfoPlist.strings
+++ b/ios/App/fr.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus utilise le micro uniquement lorsque vous enregistrez une narration ou un son dans un film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus enregistre dans votre photothèque les films et les images que vous exportez, lorsque vous le choisissez.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus utilise la reconnaissance vocale sur cet iPad uniquement lorsque vous lui demandez d'écrire des sous-titres à partir d'un son. Le son reste sur cet iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus utilise votre réseau local uniquement pour joindre le serveur vocal que vous indiquez pour Voix IA.";
diff --git a/ios/App/hi.lproj/InfoPlist.strings b/ios/App/hi.lproj/InfoPlist.strings
index 1fa84b4..6f55345 100644
--- a/ios/App/hi.lproj/InfoPlist.strings
+++ b/ios/App/hi.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus माइक्रोफ़ोन का उपयोग केवल तब करता है जब आप किसी फ़िल्म में नैरेशन या ध्वनि रिकॉर्ड करते हैं।";
"NSPhotoLibraryAddUsageDescription" = "जब आप चुनते हैं, तब FormMorpheus आपकी एक्सपोर्ट की हुई फ़िल्में और छवियाँ आपकी फ़ोटो लाइब्रेरी में सहेजता है।";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus इस iPad पर वाक् पहचान का उपयोग केवल तब करता है जब आप उससे किसी ध्वनि से सबटाइटल लिखने को कहते हैं। ध्वनि इसी iPad पर रहती है।";
+"NSLocalNetworkUsageDescription" = "FormMorpheus आपके लोकल नेटवर्क का उपयोग केवल उस स्पीच सर्वर तक पहुँचने के लिए करता है जिसे आप AI आवाज़ के लिए बताते हैं।";
diff --git a/ios/App/hu.lproj/InfoPlist.strings b/ios/App/hu.lproj/InfoPlist.strings
index 7153fcc..ad3d5df 100644
--- a/ios/App/hu.lproj/InfoPlist.strings
+++ b/ios/App/hu.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "A FormMorpheus csak akkor használja a mikrofont, amikor narrációt vagy hangot rögzít egy filmbe.";
"NSPhotoLibraryAddUsageDescription" = "A FormMorpheus az exportált filmeket és képeket a fotókönyvtárba menti, ha Ön ezt választja.";
+"NSSpeechRecognitionUsageDescription" = "A FormMorpheus csak akkor használja ezen az iPaden a beszédfelismerést, amikor arra kéri, hogy feliratot írjon egy hangból. A hang ezen az iPaden marad.";
+"NSLocalNetworkUsageDescription" = "A FormMorpheus csak arra használja a helyi hálózatot, hogy elérje a MI-hanghoz megadott beszédszervert.";
diff --git a/ios/App/id.lproj/InfoPlist.strings b/ios/App/id.lproj/InfoPlist.strings
index 3546326..69fbb25 100644
--- a/ios/App/id.lproj/InfoPlist.strings
+++ b/ios/App/id.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus hanya menggunakan mikrofon saat Anda merekam narasi atau suara ke dalam film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus menyimpan film dan gambar yang Anda ekspor ke pustaka foto Anda saat Anda memilihnya.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus hanya menggunakan pengenalan ucapan di iPad ini saat Anda memintanya menulis subjudul dari suara. Suara tetap berada di iPad ini.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus hanya menggunakan jaringan lokal Anda untuk menjangkau server ucapan yang Anda tentukan untuk Suara AI.";
diff --git a/ios/App/it.lproj/InfoPlist.strings b/ios/App/it.lproj/InfoPlist.strings
index 5afc42f..53b81aa 100644
--- a/ios/App/it.lproj/InfoPlist.strings
+++ b/ios/App/it.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus usa il microfono solo quando registri una narrazione o un suono in un film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus salva nella tua libreria foto i film e le immagini che esporti, quando lo scegli.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus usa il riconoscimento vocale su questo iPad solo quando gli chiedi di scrivere i sottotitoli da un suono. Il suono resta su questo iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus usa la tua rete locale solo per raggiungere il server vocale che indichi per Voce IA.";
diff --git a/ios/App/ja.lproj/InfoPlist.strings b/ios/App/ja.lproj/InfoPlist.strings
index 0d1b7b5..edf686f 100644
--- a/ios/App/ja.lproj/InfoPlist.strings
+++ b/ios/App/ja.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus は、ムービーにナレーションや音声を録音するときにのみマイクを使用します。";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus は、あなたが選択したときに、書き出したムービーと画像を写真ライブラリに保存します。";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus は、音声から字幕を書くよう指示したときにのみ、この iPad の音声認識を使用します。音声はこの iPad の外に出ません。";
+"NSLocalNetworkUsageDescription" = "FormMorpheus は、AI ボイス用に指定した音声サーバーに接続するためにのみ、ローカルネットワークを使用します。";
diff --git a/ios/App/ko.lproj/InfoPlist.strings b/ios/App/ko.lproj/InfoPlist.strings
index cdc9365..f251ad5 100644
--- a/ios/App/ko.lproj/InfoPlist.strings
+++ b/ios/App/ko.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus는 영화에 내레이션이나 소리를 녹음할 때만 마이크를 사용합니다.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus는 사용자가 선택할 때 내보낸 영화와 이미지를 사진 보관함에 저장합니다.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus는 소리에서 자막을 만들도록 요청할 때만 이 iPad의 음성 인식을 사용합니다. 소리는 이 iPad에 그대로 남습니다.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus는 AI 음성에 지정한 음성 서버에 연결할 때만 로컬 네트워크를 사용합니다.";
diff --git a/ios/App/nb.lproj/InfoPlist.strings b/ios/App/nb.lproj/InfoPlist.strings
index 7a609d2..109e133 100644
--- a/ios/App/nb.lproj/InfoPlist.strings
+++ b/ios/App/nb.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus bruker bare mikrofonen når du tar opp fortellerstemme eller lyd i en film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus lagrer filmene og bildene du eksporterer i bildebiblioteket ditt når du velger det.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus bruker bare talegjenkjenning på denne iPaden når du ber den skrive undertekster fra en lyd. Lyden blir på denne iPaden.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus bruker bare det lokale nettverket ditt for å nå taleserveren du oppgir for KI-stemme.";
diff --git a/ios/App/nl.lproj/InfoPlist.strings b/ios/App/nl.lproj/InfoPlist.strings
index 44d9682..ca0ca93 100644
--- a/ios/App/nl.lproj/InfoPlist.strings
+++ b/ios/App/nl.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus gebruikt de microfoon alleen wanneer je een voice-over of geluid in een film opneemt.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus bewaart de films en afbeeldingen die je exporteert in je fotobibliotheek wanneer je daarvoor kiest.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus gebruikt spraakherkenning op deze iPad alleen wanneer je vraagt om ondertitels uit een geluid te schrijven. Het geluid blijft op deze iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus gebruikt je lokale netwerk alleen om de spraakserver te bereiken die je voor AI-stem opgeeft.";
diff --git a/ios/App/pl.lproj/InfoPlist.strings b/ios/App/pl.lproj/InfoPlist.strings
index b3669f1..4d17408 100644
--- a/ios/App/pl.lproj/InfoPlist.strings
+++ b/ios/App/pl.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus używa mikrofonu tylko wtedy, gdy nagrywasz narrację lub dźwięk do filmu.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus zapisuje w Twojej fototece filmy i obrazy, które eksportujesz, gdy tak zdecydujesz.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus używa rozpoznawania mowy na tym iPadzie tylko wtedy, gdy poprosisz o napisanie napisów z dźwięku. Dźwięk pozostaje na tym iPadzie.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus używa Twojej sieci lokalnej tylko do połączenia z serwerem mowy, który podasz dla funkcji Głos AI.";
diff --git a/ios/App/pt-BR.lproj/InfoPlist.strings b/ios/App/pt-BR.lproj/InfoPlist.strings
index 2196b91..a2a3a13 100644
--- a/ios/App/pt-BR.lproj/InfoPlist.strings
+++ b/ios/App/pt-BR.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "O FormMorpheus usa o microfone somente quando você grava narração ou som em um filme.";
"NSPhotoLibraryAddUsageDescription" = "O FormMorpheus salva na sua biblioteca de fotos os filmes e as imagens que você exporta, quando você escolhe.";
+"NSSpeechRecognitionUsageDescription" = "O FormMorpheus usa o reconhecimento de fala neste iPad somente quando você pede que ele escreva legendas a partir de um som. O som fica neste iPad.";
+"NSLocalNetworkUsageDescription" = "O FormMorpheus usa sua rede local somente para acessar o servidor de fala que você indicar para Voz de IA.";
diff --git a/ios/App/ru.lproj/InfoPlist.strings b/ios/App/ru.lproj/InfoPlist.strings
index 3d50c32..8e01af4 100644
--- a/ios/App/ru.lproj/InfoPlist.strings
+++ b/ios/App/ru.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus использует микрофон только тогда, когда вы записываете закадровый голос или звук в фильм.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus сохраняет в вашей медиатеке экспортируемые фильмы и изображения, когда вы этого хотите.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus использует распознавание речи на этом iPad только тогда, когда вы просите создать субтитры по звуку. Звук остаётся на этом iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus использует локальную сеть только для связи с речевым сервером, который вы указали для ИИ-голоса.";
diff --git a/ios/App/sr-Latn.lproj/InfoPlist.strings b/ios/App/sr-Latn.lproj/InfoPlist.strings
index acefac7..901ff99 100644
--- a/ios/App/sr-Latn.lproj/InfoPlist.strings
+++ b/ios/App/sr-Latn.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus koristi mikrofon samo kada snimate naraciju ili zvuk u film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus čuva filmove i slike koje izvezete u vašu biblioteku fotografija kada to izaberete.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus koristi prepoznavanje govora na ovom iPadu samo kada zatražite da napiše titlove iz zvuka. Zvuk ostaje na ovom iPadu.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus koristi vašu lokalnu mrežu samo da bi došao do servera za govor koji navedete za AI glas.";
diff --git a/ios/App/sv.lproj/InfoPlist.strings b/ios/App/sv.lproj/InfoPlist.strings
index 1848dfe..9d48e0d 100644
--- a/ios/App/sv.lproj/InfoPlist.strings
+++ b/ios/App/sv.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus använder bara mikrofonen när du spelar in berättarröst eller ljud i en film.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus sparar de filmer och bilder du exporterar i ditt fotobibliotek när du väljer det.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus använder bara taligenkänning på den här iPaden när du ber den skriva undertexter från ett ljud. Ljudet stannar på den här iPaden.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus använder bara ditt lokala nätverk för att nå den talserver du anger för AI-röst.";
diff --git a/ios/App/th.lproj/InfoPlist.strings b/ios/App/th.lproj/InfoPlist.strings
index 8cc823a..9eb1981 100644
--- a/ios/App/th.lproj/InfoPlist.strings
+++ b/ios/App/th.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus ใช้ไมโครโฟนเฉพาะเมื่อคุณบันทึกเสียงบรรยายหรือเสียงลงในภาพยนตร์เท่านั้น";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus จะบันทึกภาพยนตร์และรูปภาพที่คุณส่งออกลงในคลังรูปภาพของคุณเมื่อคุณเลือกเท่านั้น";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus ใช้การรู้จำเสียงพูดบน iPad เครื่องนี้เฉพาะเมื่อคุณสั่งให้เขียนคำบรรยายจากเสียงเท่านั้น เสียงจะอยู่บน iPad เครื่องนี้";
+"NSLocalNetworkUsageDescription" = "FormMorpheus ใช้เครือข่ายท้องถิ่นของคุณเพื่อเชื่อมต่อกับเซิร์ฟเวอร์เสียงพูดที่คุณระบุสำหรับเสียง AI เท่านั้น";
diff --git a/ios/App/tr.lproj/InfoPlist.strings b/ios/App/tr.lproj/InfoPlist.strings
index e59d8de..3a4e221 100644
--- a/ios/App/tr.lproj/InfoPlist.strings
+++ b/ios/App/tr.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus mikrofonu yalnızca bir filme anlatım veya ses kaydettiğinizde kullanır.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus, siz seçtiğinizde dışa aktardığınız filmleri ve görüntüleri fotoğraf kitaplığınıza kaydeder.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus, bu iPad'deki konuşma tanımayı yalnızca bir sesten altyazı yazmasını istediğinizde kullanır. Ses bu iPad'de kalır.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus, yerel ağınızı yalnızca Yapay zekâ sesi için belirttiğiniz konuşma sunucusuna ulaşmak için kullanır.";
diff --git a/ios/App/uk.lproj/InfoPlist.strings b/ios/App/uk.lproj/InfoPlist.strings
index 44b0d15..8eeadd9 100644
--- a/ios/App/uk.lproj/InfoPlist.strings
+++ b/ios/App/uk.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus використовує мікрофон лише тоді, коли ви записуєте закадровий голос або звук у фільм.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus зберігає у вашу фотобібліотеку фільми й зображення, які ви експортуєте, коли ви цього захочете.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus використовує розпізнавання мовлення на цьому iPad лише тоді, коли ви просите створити субтитри зі звуку. Звук залишається на цьому iPad.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus використовує вашу локальну мережу лише для зв’язку з мовним сервером, який ви вказали для Голосу ШІ.";
diff --git a/ios/App/vi.lproj/InfoPlist.strings b/ios/App/vi.lproj/InfoPlist.strings
index 4ad1038..7fe0e17 100644
--- a/ios/App/vi.lproj/InfoPlist.strings
+++ b/ios/App/vi.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "FormMorpheus chỉ dùng micrô khi bạn ghi âm lời dẫn hoặc âm thanh vào phim.";
"NSPhotoLibraryAddUsageDescription" = "FormMorpheus lưu các phim và hình ảnh bạn xuất vào thư viện ảnh của bạn khi bạn chọn làm vậy.";
+"NSSpeechRecognitionUsageDescription" = "FormMorpheus chỉ dùng tính năng nhận dạng giọng nói trên iPad này khi bạn yêu cầu viết phụ đề từ âm thanh. Âm thanh được giữ trên iPad này.";
+"NSLocalNetworkUsageDescription" = "FormMorpheus chỉ dùng mạng cục bộ của bạn để kết nối với máy chủ giọng nói mà bạn chỉ định cho Giọng AI.";
diff --git a/ios/App/zh-Hans.lproj/InfoPlist.strings b/ios/App/zh-Hans.lproj/InfoPlist.strings
index dd3d163..eaa600f 100644
--- a/ios/App/zh-Hans.lproj/InfoPlist.strings
+++ b/ios/App/zh-Hans.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "仅当你在影片中录制旁白或声音时,FormMorpheus 才会使用麦克风。";
"NSPhotoLibraryAddUsageDescription" = "当你选择时,FormMorpheus 会将你导出的影片和图像存储到你的照片图库。";
+"NSSpeechRecognitionUsageDescription" = "仅当你要求根据声音生成字幕时,FormMorpheus 才会在此 iPad 上使用语音识别。声音会保留在此 iPad 上。";
+"NSLocalNetworkUsageDescription" = "FormMorpheus 仅使用本地网络连接你为 AI 语音指定的语音服务器。";
diff --git a/ios/App/zh-Hant.lproj/InfoPlist.strings b/ios/App/zh-Hant.lproj/InfoPlist.strings
index ea967c9..523e679 100644
--- a/ios/App/zh-Hant.lproj/InfoPlist.strings
+++ b/ios/App/zh-Hant.lproj/InfoPlist.strings
@@ -1,2 +1,4 @@
"NSMicrophoneUsageDescription" = "只有在你於影片中錄製旁白或聲音時,FormMorpheus 才會使用麥克風。";
"NSPhotoLibraryAddUsageDescription" = "當你選擇時,FormMorpheus 會將你匯出的影片和影像儲存到你的照片圖庫。";
+"NSSpeechRecognitionUsageDescription" = "只有在你要求根據聲音產生字幕時,FormMorpheus 才會在此 iPad 上使用語音辨識。聲音會保留在此 iPad 上。";
+"NSLocalNetworkUsageDescription" = "FormMorpheus 只會使用區域網路連線到你為 AI 語音指定的語音伺服器。";
diff --git a/ios/Engine/EngineRouter.swift b/ios/Engine/EngineRouter.swift
index b892b90..7439005 100644
--- a/ios/Engine/EngineRouter.swift
+++ b/ios/Engine/EngineRouter.swift
@@ -10,6 +10,7 @@
// SystemRoutes "" /health /capabilities /system/library
// LibraryRoutes /library list, open, save, rename, duplicate, copy-to, delete, poster, preview, tags, stacks
// CharactersRoutes /characters saved characters: list, open, save, rename, delete, poster
+// ScenesRoutes /scenes saved scenes: list, open, save, rename, delete, poster
// BrushesRoutes /brushes libraries as folders, .order.json, import and export files, the migration
// FontsRoutes /fonts imported fonts with the signature check
// TrashRoutes /trash Recently Deleted (30 days)
@@ -21,12 +22,13 @@
// ExportsRoutes /exports (ios/Export) the Exports folder
// AudioEncodeRoutes /audio-encode (ios/Export) sound encoders
// TranscodeRoutes /transcode video the window cannot decode, converted with AVFoundation
+// VoiceRoutes /voice AI Voice: status, the voice app on the network, the online key, speak and sounds, listening (on-device speech recognition)
// Not ported, on purpose: /proxy (a desktop-only ffmpeg and network helper), /penlink
// (Pen Link is hidden on iPad), /files/stat and /files/source (the source link's automatic update; the
// window offers Update from Source... instead). Those requests answer 404, as the desktop does for an unknown route.
//
// Storage root: EngineConfig.dataDir, the Documents folder, so the Files app shows
-// Library, Characters, Brushes, Fonts, Ideas, Recently Deleted, Recovery and Exports like the desktop data folder.
+// Library, Characters, Scenes, Brushes, Fonts, Ideas, Recently Deleted, Recovery and Exports like the desktop data folder.
// Nothing is seeded: the backend seeds no stock brushes or example movies (starter brushes are built into the interface).
import Foundation
@@ -47,6 +49,7 @@ final class EngineRouter {
SystemRoutes(),
LibraryRoutes(),
CharactersRoutes(),
+ ScenesRoutes(),
BrushesRoutes(),
FontsRoutes(),
TrashRoutes(),
@@ -58,6 +61,7 @@ final class EngineRouter {
ExportsRoutes(),
AudioEncodeRoutes(),
TranscodeRoutes(),
+ VoiceRoutes(),
]
EngineMaintenance.start()
}
diff --git a/ios/Engine/ScenesRoutes.swift b/ios/Engine/ScenesRoutes.swift
new file mode 100644
index 0000000..3b1131b
--- /dev/null
+++ b/ios/Engine/ScenesRoutes.swift
@@ -0,0 +1,162 @@
+// ScenesRoutes.swift
+// /api/scenes: the person's own scenery, one .fmo each in Documents/Scenes, beside Characters.
+// A port of backend/app/routers/scenes.py and services/scenes.py, which mirror the Characters library: the same entry
+// shape, the zip check, the part file and atomic replace, rename with {to}, and delete to Recently Deleted (restored to Scenes).
+
+import Foundation
+
+final class ScenesStore {
+ static let shared = ScenesStore()
+
+ let lock = NSRecursiveLock()
+
+ static let ext = EngineConfig.projectExt
+ static let kind = "scene"
+
+ private init() {}
+
+ var root: URL { return EngineConfig.folder("Scenes") }
+
+ func cleanName(_ name: String) throws -> String {
+ var stem = name
+ if name.lowercased().hasSuffix(ScenesStore.ext) { stem = String(name.dropLast(ScenesStore.ext.count)) }
+ stem = EngineText.stripDots(EngineText.strip(EngineText.replaceBad(stem, with: "-")))
+ if stem.isEmpty || EngineText.length(stem) > 180 {
+ throw EngineError(400, "That scene name cannot be used.")
+ }
+ return stem
+ }
+
+ func stem(_ url: URL) -> String {
+ return String(url.lastPathComponent.dropLast(ScenesStore.ext.count))
+ }
+
+ func files() -> [URL] {
+ let folder = root
+ return EngineFS.names(folder)
+ .filter { $0.hasSuffix(ScenesStore.ext) && !$0.hasPrefix(".") }
+ .sorted()
+ .map { folder.appendingPathComponent($0) }
+ .filter { EngineFS.isFile($0) }
+ }
+
+ func find(_ stem: String) -> URL? {
+ let p = root.appendingPathComponent(stem + ScenesStore.ext)
+ return EngineFS.isFile(p) ? p : nil
+ }
+
+ func path(_ name: String) throws -> URL {
+ let s = try cleanName(name)
+ return root.appendingPathComponent(s + ScenesStore.ext)
+ }
+
+ func entry(_ url: URL) -> [String: Any] {
+ let st = EngineFS.stat(url)
+ return [
+ "name": stem(url),
+ "file": url.lastPathComponent,
+ "path": url.path,
+ "size": st?.size ?? 0,
+ "modified": st?.modified ?? 0,
+ "created": st?.created ?? 0,
+ ]
+ }
+}
+
+final class ScenesRoutes: APIRoutes {
+ let prefix = "/scenes"
+ private let table = RouteTable()
+ private let store = ScenesStore.shared
+
+ init() {
+ table.add("GET", "/scenes") { [unowned self] c in try self.list(c) }
+ table.add("GET", "/scenes/{name}") { [unowned self] c in try self.read(c) }
+ table.add("GET", "/scenes/{name}/poster") { [unowned self] c in try self.poster(c) }
+ table.add("PUT", "/scenes/{name}") { [unowned self] c in try self.write(c) }
+ table.add("POST", "/scenes/{name}/rename") { [unowned self] c in try self.rename(c) }
+ table.add("DELETE", "/scenes/{name}") { [unowned self] c in try self.delete(c) }
+ }
+
+ func handle(_ request: APIRequest) async -> APIResponse? {
+ if !table.handles(request) { return nil }
+ return await EngineWork.run { return self.table.dispatch(request) }
+ }
+
+ private func list(_ c: RouteContext) throws -> APIResponse {
+ var items = store.files().map { store.entry($0) }
+ items.sort { (($0["modified"] as? Double) ?? 0) > (($1["modified"] as? Double) ?? 0) }
+ return APIResponse.json(["folder": store.root.path, "items": items])
+ }
+
+ private func existing(_ c: RouteContext) throws -> URL {
+ let path = try store.path(c.param("name"))
+ if !EngineFS.isFile(path) { throw EngineError(404, "No scene by that name.") }
+ return path
+ }
+
+ private func read(_ c: RouteContext) throws -> APIResponse {
+ let path = try existing(c)
+ guard let data = try? Data(contentsOf: path, options: .mappedIfSafe) else {
+ throw EngineError(404, "No scene by that name.")
+ }
+ return APIResponse.data(data, contentType: "application/octet-stream")
+ }
+
+ /// poster.png from inside the file; none is an empty 204, as the library answers.
+ private func poster(_ c: RouteContext) throws -> APIResponse {
+ let path = try existing(c)
+ guard let zip = try? ZipReader(url: path), let e = zip.entry(named: "poster.png"),
+ let data = try? zip.read(e, limit: 64 * 1024 * 1024) else {
+ return EngineHTTP.noContent(contentType: "image/png")
+ }
+ var r = APIResponse.data(data, contentType: "image/png")
+ let v = c.query("v")
+ r.headers["Cache-Control"] = (v != nil && !(v ?? "").isEmpty) ? "private, max-age=300" : "no-store"
+ return r
+ }
+
+ private func write(_ c: RouteContext) throws -> APIResponse {
+ let path = try store.path(c.param("name"))
+ let body = try c.limited(EngineConfig.maxCharacterBytes, "The scene is too large to save.")
+ if body.count < 4 || Array(body.prefix(4)) != [0x50, 0x4B, 0x03, 0x04] {
+ throw EngineError(400, "That is not a FormMorpheus scene.")
+ }
+ let tmp = EngineFS.tempBeside(path)
+ defer { EngineFS.remove(tmp) }
+ try EngineFS.writeFile(body, to: tmp)
+ store.lock.lock()
+ defer { store.lock.unlock() }
+ try EngineFS.replace(tmp, path)
+ return APIResponse.json(store.entry(path))
+ }
+
+ private func rename(_ c: RouteContext) throws -> APIResponse {
+ let src = try existing(c)
+ let to = try c.json().string("to")
+ let stem = try store.cleanName(to)
+ let dst = store.root.appendingPathComponent(stem + ScenesStore.ext)
+ store.lock.lock()
+ defer { store.lock.unlock() }
+ if let other = store.find(stem), !(EngineFS.exists(other) && EngineFS.exists(src) && EngineFS.sameFile(other, src)) {
+ throw EngineError(409, "A scene with that name already exists.")
+ }
+ try EngineFS.replace(src, dst)
+ return APIResponse.json(store.entry(dst))
+ }
+
+ private func delete(_ c: RouteContext) throws -> APIResponse {
+ let src = try existing(c)
+ let stamp = EngineText.stamp()
+ store.lock.lock()
+ defer { store.lock.unlock() }
+ var dst = EngineConfig.trashDir.appendingPathComponent("\(store.stem(src)) \(stamp)\(ScenesStore.ext)")
+ var n = 2
+ while EngineFS.exists(dst) {
+ dst = EngineConfig.trashDir.appendingPathComponent("\(store.stem(src)) \(stamp) \(n)\(ScenesStore.ext)")
+ n += 1
+ }
+ try EngineFS.safeMove(src, dst)
+ TrashStore.shared.record(dst, original: src.lastPathComponent, kind: ScenesStore.kind)
+ return APIResponse.json(["deleted": store.stem(src), "kept": dst.path])
+ }
+}
diff --git a/ios/Engine/TrashRoutes.swift b/ios/Engine/TrashRoutes.swift
index 4685e2d..8f50bf0 100644
--- a/ios/Engine/TrashRoutes.swift
+++ b/ios/Engine/TrashRoutes.swift
@@ -77,7 +77,7 @@ final class TrashStore {
deleted = EngineJSON.number(rec["deleted"], fallback: deleted)
}
var name = original
- if (kind == "movie" || kind == CharacterStore.kind) && original.lowercased().hasSuffix(EngineConfig.projectExt) {
+ if (kind == "movie" || kind == CharacterStore.kind || kind == ScenesStore.kind) && original.lowercased().hasSuffix(EngineConfig.projectExt) {
name = String(original.dropLast(EngineConfig.projectExt.count))
}
let age = Date().timeIntervalSince1970 - deleted
@@ -167,6 +167,9 @@ final class TrashRoutes: APIRoutes {
} else if meta.kind == CharacterStore.kind {
let stem = parts.ext.lowercased() == EngineConfig.projectExt ? parts.stem : meta.original
dst = EngineFS.freePath(EngineConfig.charactersDir, stem: stem, ext: EngineConfig.projectExt)
+ } else if meta.kind == ScenesStore.kind {
+ let stem = parts.ext.lowercased() == EngineConfig.projectExt ? parts.stem : meta.original
+ dst = EngineFS.freePath(ScenesStore.shared.root, stem: stem, ext: EngineConfig.projectExt)
} else {
dst = EngineFS.freePath(EngineConfig.exportsDir, stem: parts.stem, ext: parts.ext)
}
diff --git a/ios/Engine/VoiceKeychain.swift b/ios/Engine/VoiceKeychain.swift
new file mode 100644
index 0000000..610b5b2
--- /dev/null
+++ b/ios/Engine/VoiceKeychain.swift
@@ -0,0 +1,49 @@
+// VoiceKeychain.swift
+// The AI Voice keys on iPad: one generic password per account in the Keychain, under the service name the desktop's
+// keyring uses (FormMorpheus). Kept on this device only, readable after the first unlock, never in UserDefaults.
+
+import Foundation
+import Security
+
+enum VoiceKeychain {
+ static let service = "FormMorpheus"
+
+ private static func query(_ account: String) -> [String: Any] {
+ return [
+ kSecClass as String: kSecClassGenericPassword,
+ kSecAttrService as String: service,
+ kSecAttrAccount as String: account,
+ ]
+ }
+
+ static func get(_ account: String) -> String? {
+ var q = query(account)
+ q[kSecReturnData as String] = true
+ q[kSecMatchLimit as String] = kSecMatchLimitOne
+ var item: CFTypeRef? = nil
+ let status = SecItemCopyMatching(q as CFDictionary, &item)
+ guard status == errSecSuccess, let data = item as? Data,
+ let text = String(data: data, encoding: .utf8), !text.isEmpty else { return nil }
+ return text
+ }
+
+ /// False when the Keychain refused the key.
+ static func set(_ account: String, _ value: String) -> Bool {
+ let data = Data(value.utf8)
+ let changes: [String: Any] = [
+ kSecValueData as String: data,
+ kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly,
+ ]
+ let updated = SecItemUpdate(query(account) as CFDictionary, changes as CFDictionary)
+ if updated == errSecSuccess { return true }
+ if updated != errSecItemNotFound { _ = SecItemDelete(query(account) as CFDictionary) }
+ var add = query(account)
+ add[kSecValueData as String] = data
+ add[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
+ return SecItemAdd(add as CFDictionary, nil) == errSecSuccess
+ }
+
+ static func delete(_ account: String) {
+ _ = SecItemDelete(query(account) as CFDictionary)
+ }
+}
diff --git a/ios/Engine/VoiceListen.swift b/ios/Engine/VoiceListen.swift
new file mode 100644
index 0000000..00ac853
--- /dev/null
+++ b/ios/Engine/VoiceListen.swift
@@ -0,0 +1,503 @@
+// VoiceListen.swift
+// Listening on iPad: the words of a sound with their times, heard by the iPad's own speech recognition (Speech
+// framework, on the device only, never the network). Answers in the shape of backend/app/services/voice_transcribe.py:
+// {language, seconds, cues}, the word times grouped into short phrases by the same rules as the desktop's worker.
+
+import Foundation
+import Speech
+
+struct VoiceWord {
+ var text: String
+ var start: Double
+ var end: Double
+}
+
+struct VoiceListenLook {
+ let authorization: String
+ let authorized: Bool
+ let locale: String
+ let onDevice: Bool
+ let available: Bool
+ let reason: String
+}
+
+enum VoiceListenOutcome {
+ case heard([VoiceWord])
+ case nothing
+ case failed(String)
+ case timedOut
+}
+
+/// One recognition of one file. The delegate hears each final utterance; the task's end resumes the caller once.
+final class VoiceListenTask: NSObject, SFSpeechRecognitionTaskDelegate, @unchecked Sendable {
+ private let lock = NSLock()
+ private var words: [VoiceWord] = []
+ private var lastEnd = -1.0
+ private var cont: CheckedContinuation? = nil
+ private var done = false
+ private var recognizer: SFSpeechRecognizer? = nil
+ private var task: SFSpeechRecognitionTask? = nil
+
+ func run(file: URL, locale: String, timeout: Double) async -> VoiceListenOutcome {
+ return await withCheckedContinuation { (c: CheckedContinuation) in
+ lock.withLock { cont = c }
+ DispatchQueue.main.async {
+ guard let r = SFSpeechRecognizer(locale: Locale(identifier: locale)) else {
+ self.finish(.failed(VoiceListen.noLanguage))
+ return
+ }
+ let request = SFSpeechURLRecognitionRequest(url: file)
+ request.requiresOnDeviceRecognition = true
+ request.shouldReportPartialResults = false
+ request.addsPunctuation = true
+ self.recognizer = r
+ self.task = r.recognitionTask(with: request, delegate: self)
+ }
+ DispatchQueue.global(qos: .utility).asyncAfter(deadline: .now() + timeout) {
+ if self.finish(.timedOut) {
+ DispatchQueue.main.async { self.task?.cancel() }
+ }
+ }
+ }
+ }
+
+ @discardableResult
+ private func finish(_ outcome: VoiceListenOutcome) -> Bool {
+ let c: CheckedContinuation? = lock.withLock {
+ if done { return nil }
+ done = true
+ let pending = cont
+ cont = nil
+ return pending
+ }
+ guard let resume = c else { return false }
+ resume.resume(returning: outcome)
+ return true
+ }
+
+ func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) {
+ let segments = recognitionResult.bestTranscription.segments
+ lock.withLock {
+ for s in segments {
+ let text = EngineText.strip(s.substring)
+ let start = Double(s.timestamp)
+ if text.isEmpty || start < lastEnd - 0.001 { continue }
+ let end = start + max(0, Double(s.duration))
+ words.append(VoiceWord(text: text, start: start, end: end))
+ lastEnd = max(lastEnd, end)
+ }
+ }
+ }
+
+ func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) {
+ let heard = lock.withLock { words }
+ if successfully {
+ finish(heard.isEmpty ? .nothing : .heard(heard))
+ return
+ }
+ if !heard.isEmpty {
+ finish(.heard(heard))
+ return
+ }
+ let error = task.error.map { $0 as NSError }
+ if let e = error, e.code == 1110 {
+ finish(.nothing)
+ return
+ }
+ let said = error?.localizedDescription ?? ""
+ finish(.failed(EngineText.strip("Listening to this sound failed. \(said)")))
+ }
+
+ func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) {
+ finish(.failed("Listening to this sound was stopped."))
+ }
+}
+
+enum VoiceListen {
+ static let rate = 16000
+ static let maxBytes = 256 * 1024 * 1024
+ static let name = "iPad speech recognition"
+ static let noLanguage = "This iPad cannot listen in that language on the device. Choose another language."
+
+ private static let lock = NSLock()
+ private static var busy = false
+ private static var job: [String: Any]? = nil
+
+ // MARK: permission and languages
+
+ static func authorizationName(_ s: SFSpeechRecognizerAuthorizationStatus) -> String {
+ switch s {
+ case .authorized: return "authorized"
+ case .denied: return "denied"
+ case .restricted: return "restricted"
+ case .notDetermined: return "notDetermined"
+ @unknown default: return "denied"
+ }
+ }
+
+ static let askSentence = "Listening uses this iPad's own speech recognition. Allow it when the iPad asks."
+ static let deniedSentence = "Speech recognition is turned off for FormMorpheus. Turn it on in Settings, under Privacy & Security, Speech Recognition."
+ static let restrictedSentence = "Speech recognition is not allowed on this iPad."
+
+ private static func dashed(_ id: String) -> String {
+ let plain = id.split(separator: "@", maxSplits: 1, omittingEmptySubsequences: false).first.map { String($0) } ?? id
+ return plain.replacingOccurrences(of: "_", with: "-")
+ }
+
+ private static func languagePart(_ id: String) -> String {
+ return dashed(id).lowercased().split(separator: "-", maxSplits: 1, omittingEmptySubsequences: false).first.map { String($0) } ?? ""
+ }
+
+ /// The identifier of the recognizer's locale for a code: an exact match ("en-gb"), else the code's language in a
+ /// region the person prefers, else the first supported region of that language. "" or "auto" is the iPad's own language.
+ static func localeFor(_ asked: String) -> String? {
+ let ids = SFSpeechRecognizer.supportedLocales().map { dashed($0.identifier) }.sorted()
+ let lowered = ids.map { $0.lowercased() }
+ let want = dashed(EngineText.strip(asked)).lowercased()
+ if want.isEmpty || want == "auto" {
+ for pref in Locale.preferredLanguages {
+ let code = languagePart(pref)
+ if code.isEmpty || code == "auto" { continue }
+ if let found = localeFor(code) { return found }
+ }
+ return nil
+ }
+ if let i = lowered.firstIndex(of: want) { return ids[i] }
+ let code = languagePart(want)
+ if code.isEmpty { return nil }
+ var tries: [String] = Locale.preferredLanguages.map { dashed($0).lowercased() }
+ tries.append(dashed(Locale.current.identifier).lowercased())
+ if let region = Locale.current.region?.identifier { tries.append(code + "-" + region.lowercased()) }
+ for t in tries where languagePart(t) == code {
+ if let i = lowered.firstIndex(of: t) { return ids[i] }
+ let parts = t.split(separator: "-").map { String($0) }
+ if let last = parts.last, parts.count > 1, let i = lowered.firstIndex(of: code + "-" + last) { return ids[i] }
+ }
+ if let i = lowered.firstIndex(where: { $0 == code || $0.hasPrefix(code + "-") }) { return ids[i] }
+ return nil
+ }
+
+ static func look(_ asked: String) -> VoiceListenLook {
+ let auth = SFSpeechRecognizer.authorizationStatus()
+ let authName = authorizationName(auth)
+ let authorized = auth == .authorized
+ guard let id = localeFor(asked), let r = SFSpeechRecognizer(locale: Locale(identifier: id)) else {
+ let reason = authorized ? noLanguage : sentence(authName)
+ return VoiceListenLook(authorization: authName, authorized: authorized, locale: "", onDevice: false, available: false, reason: reason)
+ }
+ let onDevice = r.supportsOnDeviceRecognition
+ var reason = ""
+ if !authorized { reason = sentence(authName) } else if !onDevice { reason = noLanguage }
+ return VoiceListenLook(authorization: authName, authorized: authorized, locale: id, onDevice: onDevice, available: r.isAvailable, reason: reason)
+ }
+
+ private static func sentence(_ auth: String) -> String {
+ switch auth {
+ case "denied": return deniedSentence
+ case "restricted": return restrictedSentence
+ case "authorized": return ""
+ default: return askSentence
+ }
+ }
+
+ static func status(_ asked: String) -> [String: Any] {
+ let l = look(asked)
+ let r: [String: Any] = [
+ "ready": l.authorized && l.onDevice,
+ "runtime": l.authorized,
+ "model": l.onDevice,
+ "name": name,
+ "bytes": 0,
+ "job": currentJob(),
+ "platform": "ipad",
+ "authorization": l.authorization,
+ "language": l.locale,
+ "available": l.available,
+ "reason": l.reason,
+ ]
+ return r
+ }
+
+ static func currentJob() -> Any {
+ let j: [String: Any]? = lock.withLock { job }
+ if let found = j { return found }
+ return NSNull()
+ }
+
+ private static func setJob(_ state: String, _ error: String) -> [String: Any] {
+ let j: [String: Any] = ["state": state, "step": "model", "done": 0, "total": 0, "error": error]
+ lock.withLock { job = j }
+ return j
+ }
+
+ /// Asks the iPad for the permission; the page polls the job, as it does the desktop's model download.
+ static func startSetup() throws -> [String: Any] {
+ switch SFSpeechRecognizer.authorizationStatus() {
+ case .authorized:
+ return setJob("done", "")
+ case .denied:
+ throw EngineError(409, deniedSentence)
+ case .restricted:
+ throw EngineError(409, restrictedSentence)
+ default:
+ break
+ }
+ let previous: [String: Any]? = lock.withLock { job }
+ if let running = previous, (running["state"] as? String) == "running" {
+ throw EngineError(409, "FormMorpheus is already asking for permission to use speech recognition.")
+ }
+ let j = setJob("running", "")
+ DispatchQueue.main.async {
+ SFSpeechRecognizer.requestAuthorization { answer in
+ switch answer {
+ case .authorized: _ = VoiceListen.setJob("done", "")
+ case .restricted: _ = VoiceListen.setJob("failed", VoiceListen.restrictedSentence)
+ default: _ = VoiceListen.setJob("failed", VoiceListen.deniedSentence)
+ }
+ }
+ }
+ return j
+ }
+
+ // MARK: the sound
+
+ private static func ascii(_ d: Data, _ o: Int, _ n: Int) -> String {
+ if o + n > d.count { return "" }
+ let s = d.startIndex + o
+ return String(decoding: d[s..<(s + n)], as: UTF8.self)
+ }
+
+ private static func u16(_ d: Data, _ o: Int) -> Int {
+ let i = d.startIndex + o
+ return Int(d[i]) | (Int(d[i + 1]) << 8)
+ }
+
+ private static func u32(_ d: Data, _ o: Int) -> Int {
+ return u16(d, o) | (u16(d, o + 2) << 16)
+ }
+
+ /// Frames and where they start, for a 16 kHz mono 16-bit PCM WAV; nil for anything else.
+ static func wav(_ d: Data) -> (frames: Int, offset: Int)? {
+ guard ascii(d, 0, 4) == "RIFF", ascii(d, 8, 4) == "WAVE" else { return nil }
+ var at = 12
+ var format = false
+ while at + 8 <= d.count {
+ let id = ascii(d, at, 4)
+ let size = u32(d, at + 4)
+ let body = at + 8
+ if id == "fmt " {
+ guard size >= 16, body + 16 <= d.count else { return nil }
+ format = u16(d, body) == 1 && u16(d, body + 2) == 1 && u32(d, body + 4) == rate && u16(d, body + 14) == 16
+ if !format { return nil }
+ } else if id == "data" {
+ guard format else { return nil }
+ return (max(0, min(size, d.count - body)) / 2, body)
+ }
+ at = body + size + (size & 1)
+ }
+ return nil
+ }
+
+ static func level(_ d: Data, _ offset: Int, _ frames: Int) -> Double {
+ if frames <= 0 { return 0 }
+ var sum = 0.0
+ d.withUnsafeBytes { (p: UnsafeRawBufferPointer) in
+ var i = offset
+ let end = offset + frames * 2
+ while i + 1 < end {
+ let v = Int16(bitPattern: UInt16(p[i]) | (UInt16(p[i + 1]) << 8))
+ let x = Double(v) / 32768.0
+ sum += x * x
+ i += 2
+ }
+ }
+ return (sum / Double(frames)).squareRoot()
+ }
+
+ // MARK: phrases (the desktop worker's rules)
+
+ static let maxWords = 7
+ static let maxChars = 42
+ static let maxPhrase = 3.5
+ static let maxGap = 0.7
+ private static let ends: Set = [".", "!", "?", "\u{3002}", "\u{FF01}", "\u{FF1F}"]
+ private static let unspaced: Set = ["zh", "ja", "yue", "th"]
+
+ private static func splitLong(_ words: [VoiceWord]) -> [VoiceWord] {
+ var out: [VoiceWord] = []
+ for w in words {
+ let chars = Array(w.text)
+ if chars.count <= maxChars {
+ out.append(w)
+ continue
+ }
+ let n = (chars.count + maxChars - 1) / maxChars
+ let span = (w.end - w.start) / Double(n)
+ for k in 0.. Bool {
+ guard let first = g.first, let last = g.last else { return true }
+ let text = g.map { $0.text }.joined(separator: sep)
+ return g.count <= maxWords && text.count <= maxChars && (g.count == 1 || last.end - first.start <= maxPhrase)
+ }
+
+ private static func balance(_ run: [VoiceWord], _ sep: String) -> [[VoiceWord]] {
+ let lengths = run.map { Double($0.text.count + 1) }
+ let total = lengths.reduce(0, +)
+ if run.isEmpty || total <= 0 { return run.map { [$0] } }
+ for n in 1...run.count {
+ var groups = [[VoiceWord]](repeating: [], count: n)
+ var at = 0.0
+ for (word, length) in zip(run, lengths) {
+ let index = min(n - 1, Int((at + length / 2) / total * Double(n)))
+ groups[index].append(word)
+ at += length
+ }
+ let kept = groups.filter { !$0.isEmpty }
+ if kept.allSatisfy({ fits($0, sep) }) { return kept }
+ }
+ return run.map { [$0] }
+ }
+
+ private static func round3(_ x: Double) -> Double {
+ return (x * 1000).rounded() / 1000
+ }
+
+ static func phrases(_ heard: [VoiceWord], language: String) -> [[String: Any]] {
+ let sep = unspaced.contains(language) ? "" : " "
+ var runs: [[VoiceWord]] = []
+ var run: [VoiceWord] = []
+ for raw in splitLong(heard) {
+ let word = VoiceWord(text: raw.text, start: raw.start, end: max(raw.end, raw.start + 0.05))
+ let ended = run.last?.text.last.map({ ends.contains($0) }) ?? false
+ if let prev = run.last, word.start - prev.end > maxGap || ended {
+ runs.append(run)
+ run = []
+ }
+ run.append(word)
+ }
+ if !run.isEmpty { runs.append(run) }
+ var out: [[String: Any]] = []
+ for r in runs {
+ for g in balance(r, sep) {
+ guard let first = g.first else { continue }
+ let end = g.map { $0.end }.max() ?? first.end
+ out.append(["start": round3(first.start), "end": round3(end), "text": g.map { $0.text }.joined(separator: sep)])
+ }
+ }
+ return out
+ }
+
+ /// The service's _clean: in order, inside the sound, never overlapping.
+ static func clean(_ cues: [[String: Any]], _ seconds: Double) -> [[String: Any]] {
+ var kept: [(start: Double, end: Double, text: String)] = []
+ for cue in cues {
+ guard let s = cue["start"] as? Double, let e = cue["end"] as? Double, let t = cue["text"] as? String else { continue }
+ let start = max(0, min(s, seconds))
+ let end = max(0, min(e, seconds))
+ let text = t.split(whereSeparator: { $0.isWhitespace }).joined(separator: " ")
+ if !text.isEmpty && end > start { kept.append((start: start, end: end, text: text)) }
+ }
+ kept.sort { $0.start != $1.start ? $0.start < $1.start : $0.end < $1.end }
+ var out: [[String: Any]] = []
+ var lastEnd: Double? = nil
+ for index in 0.. [VoiceWord] {
+ let weights = heard.map { Double($0.text.count + 1) }
+ let total = weights.reduce(0, +)
+ if total <= 0 || seconds <= 0 { return heard }
+ var at = 0.0
+ var out: [VoiceWord] = []
+ for (w, weight) in zip(heard, weights) {
+ let span = seconds * weight / total
+ out.append(VoiceWord(text: w.text, start: at, end: at + span))
+ at += span
+ }
+ return out
+ }
+
+ // MARK: listening
+
+ static func transcribe(_ body: Data, language: String) async throws -> [String: Any] {
+ if body.count > maxBytes {
+ throw EngineError(413, "That sound is too long to listen to in one go. Split the block and try each part.")
+ }
+ if body.count < 44 { throw EngineError(422, "There is no sound to listen to.") }
+ switch SFSpeechRecognizer.authorizationStatus() {
+ case .authorized: break
+ case .denied: throw EngineError(409, deniedSentence)
+ case .restricted: throw EngineError(409, restrictedSentence)
+ default: throw EngineError(409, "Allow FormMorpheus to use speech recognition first.")
+ }
+ let asked = EngineText.strip(language).lowercased()
+ let askedCode = (asked.isEmpty || asked == "auto") ? "" : languagePart(asked)
+ guard let locale = localeFor(asked) else {
+ if askedCode.isEmpty { throw EngineError(409, noLanguage) }
+ let shown = EngineText.prefix(EngineText.replaceBad(asked, with: ""), 12)
+ throw EngineError(422, "This iPad cannot listen in the language \(shown). Choose another language.")
+ }
+ if let r = SFSpeechRecognizer(locale: Locale(identifier: locale)), !r.supportsOnDeviceRecognition {
+ throw EngineError(409, noLanguage)
+ }
+ guard let sound = wav(body) else { throw EngineError(422, "The sound must be a 16 kHz mono 16-bit WAV.") }
+ let seconds = Double(sound.frames) / Double(rate)
+ if seconds < 0.1 || level(body, sound.offset, sound.frames) < 1e-3 {
+ let r: [String: Any] = ["language": askedCode, "seconds": round3(seconds), "cues": [[String: Any]]()]
+ return r
+ }
+ let taken: Bool = lock.withLock {
+ if busy { return false }
+ busy = true
+ return true
+ }
+ if !taken { throw EngineError(409, "Another sound is being listened to. Wait for it to finish, then try again.") }
+ defer { lock.withLock { busy = false } }
+
+ let folder = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
+ .appendingPathComponent("Voice", isDirectory: true)
+ try? FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true)
+ let file = folder.appendingPathComponent(".listen-\(EngineText.hex(12)).wav")
+ do {
+ try EngineFS.writeFile(body, to: file)
+ } catch {
+ EngineFS.remove(file)
+ throw EngineError(500, "The sound could not be stored for listening.")
+ }
+ defer { EngineFS.remove(file) }
+
+ let token = await TranscodeBackground.begin()
+ let outcome = await VoiceListenTask().run(file: file, locale: locale, timeout: min(7200, max(300, 10 * seconds)))
+ await TranscodeBackground.end(token)
+
+ let code = languagePart(locale)
+ var heard: [VoiceWord] = []
+ switch outcome {
+ case .heard(let words): heard = words
+ case .nothing: heard = []
+ case .timedOut: throw EngineError(502, "Listening to this sound took too long. Try a shorter part.")
+ case .failed(let said): throw EngineError(502, said)
+ }
+ let latest = heard.map({ $0.end }).max() ?? 0
+ if !heard.isEmpty && latest <= 0 { heard = spread(heard, seconds) }
+ let cues = clean(phrases(heard, language: code), seconds)
+ let r: [String: Any] = ["language": cues.isEmpty ? askedCode : code, "seconds": round3(seconds), "cues": cues]
+ return r
+ }
+}
diff --git a/ios/Engine/VoiceRemote.swift b/ios/Engine/VoiceRemote.swift
new file mode 100644
index 0000000..fd8765c
--- /dev/null
+++ b/ios/Engine/VoiceRemote.swift
@@ -0,0 +1,403 @@
+// VoiceRemote.swift
+// The voices that are not built in, on iPad: a voice app (a speech server on a computer on the same network that
+// answers the common speech API) and an online voice with the person's own key. A port of
+// backend/app/services/voice_remote.py: the same requests, headers, limits and sentences. Keys live in the Keychain
+// (VoiceKeychain.swift), the voice app's address, model and voice in UserDefaults.
+
+import Foundation
+
+struct VoiceReply {
+ let status: Int
+ let data: Data
+ let contentType: String
+}
+
+/// The voice app may not send the request anywhere else: a redirect is answered as it stands, never followed.
+final class VoiceNoRedirect: NSObject, URLSessionTaskDelegate {
+ func urlSession(_ session: URLSession, task: URLSessionTask, willPerformHTTPRedirection response: HTTPURLResponse,
+ newRequest request: URLRequest, completionHandler: @escaping (URLRequest?) -> Void) {
+ completionHandler(nil)
+ }
+}
+
+enum VoiceHTTP {
+ static let local: URLSession = {
+ let config = URLSessionConfiguration.ephemeral
+ config.connectionProxyDictionary = [:]
+ config.urlCache = nil
+ config.requestCachePolicy = .reloadIgnoringLocalCacheData
+ return URLSession(configuration: config, delegate: VoiceNoRedirect(), delegateQueue: nil)
+ }()
+
+ static let online: URLSession = {
+ let config = URLSessionConfiguration.ephemeral
+ config.urlCache = nil
+ config.requestCachePolicy = .reloadIgnoringLocalCacheData
+ return URLSession(configuration: config)
+ }()
+
+ static func fetch(_ session: URLSession, _ request: URLRequest) async throws -> VoiceReply {
+ return try await withCheckedThrowingContinuation { (cont: CheckedContinuation) in
+ let task = session.dataTask(with: request) { data, response, error in
+ if let error = error {
+ cont.resume(throwing: error)
+ return
+ }
+ guard let http = response as? HTTPURLResponse else {
+ cont.resume(throwing: URLError(.badServerResponse))
+ return
+ }
+ let ctype = http.value(forHTTPHeaderField: "Content-Type") ?? ""
+ cont.resume(returning: VoiceReply(status: http.statusCode, data: data ?? Data(), contentType: ctype))
+ }
+ task.resume()
+ }
+ }
+}
+
+/// Which addresses the voice app may have on iPad: the desktop's loopback names, private and link-local IPv4 and
+/// IPv6 addresses, and .local names. Never a name or address on the open internet.
+enum VoiceAddress {
+ static func allowed(_ host: String) -> Bool {
+ if host == "localhost" || host == "127.0.0.1" || host == "::1" { return true }
+ if let quad = ipv4(host) {
+ let a = quad[0], b = quad[1]
+ if a == 10 { return true }
+ if a == 172 && b >= 16 && b <= 31 { return true }
+ if a == 192 && b == 168 { return true }
+ if a == 169 && b == 254 { return true }
+ return false
+ }
+ if host.contains(":") {
+ if !EngineText.matches("^[0-9a-f:.]+$", host) { return false }
+ let first = host.split(separator: ":", maxSplits: 1, omittingEmptySubsequences: false).first.map { String($0) } ?? ""
+ guard !first.isEmpty, first.count <= 4, let v = Int(first, radix: 16) else { return false }
+ return (v & 0xffc0) == 0xfe80 || (v & 0xfe00) == 0xfc00
+ }
+ return EngineText.matches("^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+local$", host)
+ }
+
+ private static func ipv4(_ host: String) -> [Int]? {
+ let parts = host.split(separator: ".", omittingEmptySubsequences: false).map { String($0) }
+ if parts.count != 4 { return nil }
+ var out: [Int] = []
+ for p in parts {
+ guard !p.isEmpty, p.count <= 3, EngineText.matches("^[0-9]+$", p), let n = Int(p), n <= 255 else { return nil }
+ out.append(n)
+ }
+ return out
+ }
+}
+
+enum VoiceRemote {
+ static let localAccount = "voice-local-key"
+ static let onlineAccount = "voice-online-key"
+ static let settingsKey = "formmorpheus.voice.local"
+ static let onlineBase = "https://api.elevenlabs.io"
+ static let defaultOnlineVoice = "21m00Tcm4TlvDq8ikWAM"
+ static let defaultOnlineModel = "eleven_multilingual_v2"
+ static let maxOnlineText = 2000
+ static let maxBytes = 200 * 1024 * 1024
+ static let speechTimeout: TimeInterval = 300
+ static let probeTimeout: TimeInterval = 5
+ static let onlineTimeout: TimeInterval = 120
+
+ static let addressSorry = "Only an address on the same network is allowed, such as http://192.168.1.20:8080 or http://my-computer.local:8080."
+ static let noKeyStore = "This iPad could not keep the key in its Keychain, so it was not saved."
+
+ private static let mimes: [String: String] = [
+ "audio/wav": "audio/wav", "audio/x-wav": "audio/wav", "audio/wave": "audio/wav", "audio/vnd.wave": "audio/wav",
+ "audio/mpeg": "audio/mpeg", "audio/mp3": "audio/mpeg", "audio/ogg": "audio/ogg", "application/ogg": "audio/ogg",
+ "audio/flac": "audio/flac", "audio/x-flac": "audio/flac",
+ ]
+ private static let generic: Set = ["", "application/octet-stream", "binary/octet-stream", "text/plain", "audio/basic"]
+
+ struct Spoken {
+ let audio: Data
+ let mime: String
+ let voice: String
+ }
+
+ // MARK: settings
+
+ static func storedLocal() -> (base: String, model: String, voice: String) {
+ let raw = UserDefaults.standard.dictionary(forKey: settingsKey) ?? [:]
+ return ((raw["base"] as? String) ?? "", (raw["model"] as? String) ?? "", (raw["voice"] as? String) ?? "")
+ }
+
+ static func localSettings() -> [String: Any] {
+ let s = storedLocal()
+ return ["base": s.base, "model": s.model, "voice": s.voice, "hasKey": VoiceKeychain.get(localAccount) != nil]
+ }
+
+ static func normalizeBase(_ base: String) throws -> String {
+ let sorry = EngineError(422, addressSorry)
+ let text = EngineText.strip(base)
+ if text.isEmpty { throw sorry }
+ guard let parts = URLComponents(string: text) else { throw sorry }
+ let scheme = (parts.scheme ?? "").lowercased()
+ var host = (parts.host ?? "").lowercased()
+ if host.hasPrefix("[") && host.hasSuffix("]") { host = String(host.dropFirst().dropLast()) }
+ if scheme != "http" && scheme != "https" { throw sorry }
+ if parts.user != nil || parts.password != nil || parts.query != nil || parts.fragment != nil { throw sorry }
+ var path = parts.path
+ while path.hasSuffix("/") { path.removeLast() }
+ if path != "" && path != "/v1" { throw sorry }
+ if host.isEmpty || !VoiceAddress.allowed(host) { throw sorry }
+ var out = scheme + "://" + (host.contains(":") ? "[\(host)]" : host)
+ if let port = parts.port {
+ if port < 0 || port > 65535 { throw sorry }
+ out += ":\(port)"
+ }
+ return out
+ }
+
+ static func saveLocal(base: String, model: String, voice: String, key: String?) throws -> [String: Any] {
+ var clean = ""
+ if !EngineText.strip(base).isEmpty { clean = try normalizeBase(base) }
+ if let k = key {
+ let trimmed = EngineText.strip(k)
+ if trimmed.isEmpty {
+ VoiceKeychain.delete(localAccount)
+ } else if !VoiceKeychain.set(localAccount, trimmed) {
+ throw EngineError(503, noKeyStore)
+ }
+ }
+ let stored: [String: String] = ["base": clean, "model": EngineText.strip(model), "voice": EngineText.strip(voice)]
+ UserDefaults.standard.set(stored, forKey: settingsKey)
+ return localSettings()
+ }
+
+ // MARK: replies
+
+ private static func replyText(_ data: Data) -> String {
+ let said = EngineText.strip(String(decoding: data.prefix(150), as: UTF8.self))
+ return EngineText.prefix(said, 150)
+ }
+
+ private static func sniff(_ d: Data) -> String? {
+ let b = [UInt8](d.prefix(12))
+ func at(_ i: Int, _ s: String) -> Bool {
+ let want = [UInt8](s.utf8)
+ return b.count >= i + want.count && Array(b[i..<(i + want.count)]) == want
+ }
+ if at(0, "RIFF") && at(8, "WAVE") { return "audio/wav" }
+ if at(0, "ID3") || (b.count > 1 && b[0] == 0xFF && (b[1] & 0xE0) == 0xE0) { return "audio/mpeg" }
+ if at(0, "OggS") { return "audio/ogg" }
+ if at(0, "fLaC") { return "audio/flac" }
+ return nil
+ }
+
+ private static func mimeOf(_ contentType: String, _ data: Data) throws -> String {
+ let declared = EngineText.strip(contentType.split(separator: ";", maxSplits: 1, omittingEmptySubsequences: false).first.map { String($0) } ?? "").lowercased()
+ if let m = mimes[declared] { return m }
+ if generic.contains(declared), let found = sniff(data) { return found }
+ throw EngineError(502, "The voice app answered with something that is not a sound.")
+ }
+
+ private static func isOK(_ status: Int) -> Bool {
+ return status >= 200 && status < 300
+ }
+
+ // MARK: the voice app
+
+ private static func localGet(_ base: String, _ path: String, _ key: String?) async -> Any? {
+ guard let url = URL(string: base + path) else { return nil }
+ var req = URLRequest(url: url)
+ req.timeoutInterval = probeTimeout
+ req.setValue("application/json", forHTTPHeaderField: "Accept")
+ if let k = key { req.setValue("Bearer " + k, forHTTPHeaderField: "Authorization") }
+ guard let reply = try? await VoiceHTTP.fetch(VoiceHTTP.local, req), isOK(reply.status), reply.data.count <= maxBytes else {
+ return nil
+ }
+ guard let value = EngineJSON.any(reply.data), !(value is NSNull) else { return nil }
+ return value
+ }
+
+ private static func truthy(_ v: Any?) -> Bool {
+ guard let v = v, !(v is NSNull) else { return false }
+ if let s = v as? String { return !s.isEmpty }
+ if let n = v as? NSNumber { return n.doubleValue != 0 }
+ if let a = v as? [Any] { return !a.isEmpty }
+ if let o = v as? [String: Any] { return !o.isEmpty }
+ return true
+ }
+
+ private static func text(_ v: Any) -> String {
+ if let s = v as? String { return s }
+ return "\(v)"
+ }
+
+ static func probeLocal(_ base: String) async throws -> [String: Any] {
+ let clean = try normalizeBase(base)
+ let key = VoiceKeychain.get(localAccount)
+ let listed = await localGet(clean, "/v1/models", key)
+ let voiced = await localGet(clean, "/v1/audio/voices", key)
+ if listed == nil && voiced == nil {
+ guard let url = URL(string: clean + "/") else { throw EngineError(422, addressSorry) }
+ var req = URLRequest(url: url)
+ req.timeoutInterval = probeTimeout
+ do {
+ _ = try await VoiceHTTP.fetch(VoiceHTTP.local, req)
+ } catch {
+ let r: [String: Any] = ["ok": false, "models": [String](), "voices": [[String: Any]](),
+ "error": "No voice app answered at that address. Check that it is running and that the address is right."]
+ return r
+ }
+ }
+ var models: [String] = []
+ let items: Any? = (listed as? [String: Any])?["data"] ?? listed
+ for item in (items as? [Any]) ?? [] {
+ let name: Any? = (item as? [String: Any])?["id"] ?? item
+ if let n = name as? String, !n.isEmpty { models.append(n) }
+ }
+ var voices: [[String: Any]] = []
+ let raw: Any? = (voiced as? [String: Any])?["voices"] ?? voiced
+ for item in (raw as? [Any]) ?? [] {
+ var vid: Any? = nil
+ var name: Any? = nil
+ if let s = item as? String {
+ vid = s
+ name = s
+ } else if let o = item as? [String: Any] {
+ for k in ["id", "voice_id", "name"] where vid == nil && truthy(o[k]) { vid = o[k] }
+ name = truthy(o["name"]) ? o["name"] : vid
+ } else {
+ continue
+ }
+ if let v = vid as? String, !v.isEmpty {
+ voices.append(["id": v, "name": text(name ?? v)])
+ }
+ }
+ let r: [String: Any] = ["ok": true, "models": models, "voices": voices, "error": ""]
+ return r
+ }
+
+ static func speakLocal(text: String, voice: String, model: String, speed: Double) async throws -> Spoken {
+ let stored = storedLocal()
+ if EngineText.strip(stored.base).isEmpty {
+ throw EngineError(422, "There is no voice app address yet. Add the address of the speech server in the AI Voice card.")
+ }
+ let base = try normalizeBase(stored.base)
+ let useModel = EngineText.strip(model).isEmpty ? stored.model : EngineText.strip(model)
+ let useVoice = EngineText.strip(voice).isEmpty ? stored.voice : EngineText.strip(voice)
+ var body: [String: Any] = ["input": text, "speed": speed, "response_format": "wav"]
+ if !useModel.isEmpty { body["model"] = useModel }
+ if !useVoice.isEmpty { body["voice"] = useVoice }
+ guard let url = URL(string: base + "/v1/audio/speech") else { throw EngineError(422, addressSorry) }
+ var req = URLRequest(url: url)
+ req.httpMethod = "POST"
+ req.timeoutInterval = speechTimeout
+ req.setValue("application/json", forHTTPHeaderField: "Content-Type")
+ if let k = VoiceKeychain.get(localAccount) { req.setValue("Bearer " + k, forHTTPHeaderField: "Authorization") }
+ req.httpBody = EngineJSON.encode(body)
+ let reply: VoiceReply
+ do {
+ reply = try await VoiceHTTP.fetch(VoiceHTTP.local, req)
+ } catch {
+ throw EngineError(502, "The voice app did not answer. Check that it is running and that its address is right.")
+ }
+ if !isOK(reply.status) {
+ let said = replyText(reply.data)
+ throw EngineError(502, "The voice app refused the request (error \(reply.status))" + (said.isEmpty ? "." : ": \(said)"))
+ }
+ if reply.data.count > maxBytes {
+ throw EngineError(502, "The voice sent back a sound larger than 200 MB, so it was dropped.")
+ }
+ if reply.data.isEmpty { throw EngineError(502, "The voice app answered with an empty sound.") }
+ return Spoken(audio: reply.data, mime: try mimeOf(reply.contentType, reply.data), voice: useVoice)
+ }
+
+ // MARK: online
+
+ static func onlineStatus() -> [String: Any] {
+ return ["hasKey": VoiceKeychain.get(onlineAccount) != nil, "canStore": true]
+ }
+
+ static func setOnlineKey(_ key: String) throws {
+ let clean = EngineText.strip(key)
+ if clean.isEmpty { throw EngineError(422, "There is no key to save.") }
+ if !VoiceKeychain.set(onlineAccount, clean) { throw EngineError(503, noKeyStore) }
+ }
+
+ static func clearOnlineKey() {
+ VoiceKeychain.delete(onlineAccount)
+ }
+
+ private static func needKey() throws -> String {
+ guard let key = VoiceKeychain.get(onlineAccount) else {
+ throw EngineError(503, "There is no online voice key yet. Add your key in the AI Voice card's Online tab.")
+ }
+ return key
+ }
+
+ private static func onlineCall(_ req: URLRequest) async throws -> VoiceReply {
+ let reply: VoiceReply
+ do {
+ reply = try await VoiceHTTP.fetch(VoiceHTTP.online, req)
+ } catch {
+ throw EngineError(502, "The online voice service could not be reached. Check the internet connection.")
+ }
+ if reply.status == 401 {
+ throw EngineError(502, "The online voice service did not accept the key (error 401). Check the key in the Online tab.")
+ }
+ if !isOK(reply.status) {
+ let said = replyText(reply.data)
+ throw EngineError(502, "The online voice service refused the request (error \(reply.status))" + (said.isEmpty ? "." : ": \(said)"))
+ }
+ if reply.data.count > maxBytes {
+ throw EngineError(502, "The voice sent back a sound larger than 200 MB, so it was dropped.")
+ }
+ return reply
+ }
+
+ static func onlineVoices() async throws -> [[String: Any]] {
+ let key = try needKey()
+ guard let url = URL(string: onlineBase + "/v1/voices") else { throw EngineError(502, "The online voice service could not be reached. Check the internet connection.") }
+ var req = URLRequest(url: url)
+ req.timeoutInterval = onlineTimeout
+ req.setValue(key, forHTTPHeaderField: "xi-api-key")
+ req.setValue("application/json", forHTTPHeaderField: "Accept")
+ let reply = try await onlineCall(req)
+ guard let top = EngineJSON.any(reply.data) as? [String: Any] else {
+ throw EngineError(502, "The online voice service answered with something unreadable.")
+ }
+ var out: [[String: Any]] = []
+ for item in (top["voices"] as? [Any]) ?? [] {
+ guard let o = item as? [String: Any], truthy(o["voice_id"]), let vidRaw = o["voice_id"] else { continue }
+ let vid = text(vidRaw)
+ let labels = (o["labels"] as? [String: Any]) ?? [:]
+ var group = ""
+ if truthy(labels["accent"]), let a = labels["accent"] { group = text(a) }
+ else if truthy(o["category"]), let c = o["category"] { group = text(c) }
+ let name = truthy(o["name"]) ? text(o["name"] ?? vid) : vid
+ out.append(["id": vid, "name": name, "group": group])
+ }
+ return out
+ }
+
+ static func speakOnline(text spoken: String, voice: String, model: String) async throws -> Spoken {
+ let key = try needKey()
+ if EngineText.length(spoken) > maxOnlineText {
+ throw EngineError(422, "The online voice takes at most \(maxOnlineText) characters at a time. Shorten the text.")
+ }
+ let useVoice = EngineText.strip(voice).isEmpty ? defaultOnlineVoice : EngineText.strip(voice)
+ if !EngineText.matches("^[A-Za-z0-9]+$", useVoice) {
+ throw EngineError(422, "That voice id is not valid. It may hold only letters and digits.")
+ }
+ let useModel = EngineText.strip(model).isEmpty ? defaultOnlineModel : EngineText.strip(model)
+ let body: [String: Any] = ["text": spoken, "model_id": useModel]
+ guard let url = URL(string: "\(onlineBase)/v1/text-to-speech/\(useVoice)") else {
+ throw EngineError(422, "That voice id is not valid. It may hold only letters and digits.")
+ }
+ var req = URLRequest(url: url)
+ req.httpMethod = "POST"
+ req.timeoutInterval = onlineTimeout
+ req.setValue(key, forHTTPHeaderField: "xi-api-key")
+ req.setValue("application/json", forHTTPHeaderField: "Content-Type")
+ req.httpBody = EngineJSON.encode(body)
+ let reply = try await onlineCall(req)
+ if reply.data.isEmpty { throw EngineError(502, "The online voice service answered with an empty sound.") }
+ return Spoken(audio: reply.data, mime: "audio/mpeg", voice: useVoice)
+ }
+}
diff --git a/ios/Engine/VoiceRoutes.swift b/ios/Engine/VoiceRoutes.swift
new file mode 100644
index 0000000..b8732d0
--- /dev/null
+++ b/ios/Engine/VoiceRoutes.swift
@@ -0,0 +1,225 @@
+// VoiceRoutes.swift
+// /api/voice on iPad: the paths, JSON shapes and status codes of backend/app/routers/voice.py, so the interface's
+// io/voice-api.ts works unchanged. The built-in voice (a Python runtime) cannot exist here and says so; the voice
+// app is a speech server on the same network and the online voice uses the Keychain (VoiceRemote.swift); listening
+// is the iPad's own on-device speech recognition (VoiceListen.swift). A spoken sound waits in Caches/Voice/out until
+// the page fetches it, swept after an hour, as the desktop keeps it in its data folder.
+
+import Foundation
+
+final class VoiceRoutes: APIRoutes, @unchecked Sendable {
+ let prefix = "/voice"
+ private let table = RouteTable()
+
+ typealias AsyncHandler = (RouteContext) async throws -> APIResponse
+
+ private struct AsyncRoute {
+ let method: String
+ let parts: [String]
+ let handler: AsyncHandler
+ }
+
+ private var asyncRoutes: [AsyncRoute] = []
+
+ static let engines: Set = ["builtin", "local", "online"]
+ static let maxText = 10000
+ static let keepSeconds: TimeInterval = 3600
+ static let ext: [String: String] = ["audio/wav": ".wav", "audio/mpeg": ".mp3", "audio/ogg": ".ogg", "audio/flac": ".flac", "audio/aac": ".aac"]
+ static let noBuiltin = "The built-in voice is not available on iPad."
+ static let noSound = "There is no spoken sound with that id."
+
+ init() {
+ table.add("GET", "/voice/status") { [unowned self] c in try self.status(c) }
+ table.add("POST", "/voice/builtin/setup") { _ in throw EngineError(409, VoiceRoutes.noBuiltin) }
+ table.add("GET", "/voice/builtin/job") { _ in APIResponse.json(["job": NSNull()]) }
+ table.add("DELETE", "/voice/builtin/job") { _ in APIResponse.json(["cancelled": false]) }
+ table.add("DELETE", "/voice/builtin") { _ in APIResponse.json(["removed": false]) }
+ table.add("GET", "/voice/builtin/voices") { _ in throw EngineError(409, VoiceRoutes.noBuiltin) }
+ table.add("PUT", "/voice/local") { [unowned self] c in try self.localSave(c) }
+ table.add("PUT", "/voice/online/key") { [unowned self] c in try self.onlineKey(c) }
+ table.add("DELETE", "/voice/online/key") { _ in
+ VoiceRemote.clearOnlineKey()
+ return APIResponse.json(VoiceRemote.onlineStatus())
+ }
+ table.add("GET", "/voice/audio/{sid}") { [unowned self] c in try self.audio(c) }
+ table.add("DELETE", "/voice/audio/{sid}") { [unowned self] c in try self.audioDrop(c) }
+ table.add("GET", "/voice/transcribe/status") { c in APIResponse.json(VoiceListen.status(c.query("language") ?? "auto")) }
+ table.add("POST", "/voice/transcribe/setup") { _ in APIResponse.json(try VoiceListen.startSetup(), status: 202) }
+ table.add("GET", "/voice/transcribe/job") { _ in APIResponse.json(["job": VoiceListen.currentJob()]) }
+ table.add("DELETE", "/voice/transcribe/job") { _ in APIResponse.json(["cancelled": false]) }
+ table.add("DELETE", "/voice/transcribe") { _ in APIResponse.json(["removed": false]) }
+
+ addAsync("POST", "/voice/local/probe") { [unowned self] c in try await self.localProbe(c) }
+ addAsync("GET", "/voice/online/voices") { _ in
+ let voices = try await VoiceRemote.onlineVoices()
+ return APIResponse.json(["voices": voices])
+ }
+ addAsync("POST", "/voice/speak") { [unowned self] c in try await self.speak(c) }
+ addAsync("POST", "/voice/transcribe") { c in
+ let language = EngineText.prefix(c.query("language") ?? "auto", 12)
+ return APIResponse.json(try await VoiceListen.transcribe(c.body, language: language))
+ }
+ }
+
+ private func addAsync(_ method: String, _ pattern: String, _ handler: @escaping AsyncHandler) {
+ asyncRoutes.append(AsyncRoute(method: method, parts: EngineHTTP.split(pattern), handler: handler))
+ }
+
+ func handle(_ request: APIRequest) async -> APIResponse? {
+ let segs = EngineHTTP.segments(request.path)
+ let method = request.method.uppercased()
+ var asyncPath = false
+ for route in asyncRoutes where route.parts == segs {
+ asyncPath = true
+ if route.method != method { continue }
+ do {
+ return try await route.handler(RouteContext(request: request, params: [:]))
+ } catch let e as EngineError {
+ return APIResponse.error(e.status, e.detail)
+ } catch {
+ return APIResponse.error(500, "Internal Server Error")
+ }
+ }
+ if table.handles(request) {
+ return await EngineWork.run { return self.table.dispatch(request) }
+ }
+ return asyncPath ? APIResponse.error(405, "Method Not Allowed") : nil
+ }
+
+ // MARK: status
+
+ private func status(_ c: RouteContext) throws -> APIResponse {
+ let builtin: [String: Any] = ["ready": false, "runtime": false, "model": false, "python": NSNull(), "folder": "", "bytes": 0,
+ "job": NSNull(), "available": false, "reason": VoiceRoutes.noBuiltin]
+ let r: [String: Any] = ["builtin": builtin, "local": VoiceRemote.localSettings(), "online": VoiceRemote.onlineStatus(), "platform": "ipad"]
+ return APIResponse.json(r)
+ }
+
+ // MARK: the voice app and the online key
+
+ private func limitedString(_ b: JSONBody, _ key: String, max: Int, required: Bool = false) throws -> String? {
+ guard let v = try b.optString(key) else {
+ if required { throw EngineError(422, "Field required: \(key)") }
+ return nil
+ }
+ if EngineText.length(v) > max { throw EngineError(422, "String should have at most \(max) characters: \(key)") }
+ if required && v.isEmpty { throw EngineError(422, "String should have at least 1 character: \(key)") }
+ return v
+ }
+
+ private func localSave(_ c: RouteContext) throws -> APIResponse {
+ let b = try c.json()
+ let base = try limitedString(b, "base", max: 200) ?? ""
+ let model = try limitedString(b, "model", max: 120) ?? ""
+ let voice = try limitedString(b, "voice", max: 120) ?? ""
+ let key = try limitedString(b, "key", max: 400)
+ return APIResponse.json(try VoiceRemote.saveLocal(base: base, model: model, voice: voice, key: key))
+ }
+
+ private func localProbe(_ c: RouteContext) async throws -> APIResponse {
+ let b = try c.json()
+ let base = try limitedString(b, "base", max: 200, required: true) ?? ""
+ return APIResponse.json(try await VoiceRemote.probeLocal(base))
+ }
+
+ private func onlineKey(_ c: RouteContext) throws -> APIResponse {
+ let b = try c.json()
+ let key = try limitedString(b, "key", max: 400, required: true) ?? ""
+ try VoiceRemote.setOnlineKey(key)
+ return APIResponse.json(VoiceRemote.onlineStatus())
+ }
+
+ // MARK: speaking
+
+ static var outDir: URL {
+ let caches = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
+ let u = caches.appendingPathComponent("Voice", isDirectory: true).appendingPathComponent("out", isDirectory: true)
+ try? FileManager.default.createDirectory(at: u, withIntermediateDirectories: true)
+ return u
+ }
+
+ @discardableResult
+ static func sweep(now: Date = Date()) -> Int {
+ let limit = now.timeIntervalSince1970 - keepSeconds
+ let dir = outDir
+ var gone = 0
+ for n in EngineFS.names(dir) {
+ let u = dir.appendingPathComponent(n)
+ if EngineFS.isFile(u), let st = EngineFS.stat(u), st.modified < limit {
+ EngineFS.remove(u)
+ gone += 1
+ }
+ }
+ return gone
+ }
+
+ private func speak(_ c: RouteContext) async throws -> APIResponse {
+ let b = try c.json()
+ let engine = try b.optString("engine") ?? "builtin"
+ guard let raw = try b.optString("text") else { throw EngineError(422, "Field required: text") }
+ if raw.isEmpty { throw EngineError(422, "String should have at least 1 character: text") }
+ if EngineText.length(raw) > VoiceRoutes.maxText {
+ throw EngineError(422, "String should have at most \(VoiceRoutes.maxText) characters: text")
+ }
+ let voice = try b.optString("voice") ?? ""
+ let model = try b.optString("model") ?? ""
+ var speed = 1.0
+ if let s = b.dict["speed"], !(s is NSNull) {
+ guard let n = s as? NSNumber else { throw EngineError(422, "Input should be a valid number: speed") }
+ speed = n.doubleValue
+ }
+ if !(speed >= 0.5 && speed <= 2.0) { throw EngineError(422, "Input should be between 0.5 and 2.0: speed") }
+ if !VoiceRoutes.engines.contains(engine) { throw EngineError(422, "There is no voice engine named \(engine).") }
+ let text = EngineText.strip(raw)
+ if text.isEmpty { throw EngineError(422, "There is no text to speak.") }
+ VoiceRoutes.sweep()
+ let spoken: VoiceRemote.Spoken
+ switch engine {
+ case "local": spoken = try await VoiceRemote.speakLocal(text: text, voice: voice, model: model, speed: speed)
+ case "online": spoken = try await VoiceRemote.speakOnline(text: text, voice: voice, model: model)
+ default: throw EngineError(409, VoiceRoutes.noBuiltin)
+ }
+ guard let suffix = VoiceRoutes.ext[spoken.mime], !spoken.audio.isEmpty else {
+ throw EngineError(502, "The voice answered with something that is not a sound.")
+ }
+ let sid = EngineText.hex(32)
+ let dir = VoiceRoutes.outDir
+ let info: [String: Any] = [
+ "id": sid, "mime": spoken.mime, "engine": engine, "voice": spoken.voice.isEmpty ? voice : spoken.voice,
+ "seconds": NSNull(), "cues": [[String: Any]](), "text": text, "bytes": spoken.audio.count,
+ ]
+ do {
+ try EngineFS.atomicWrite(spoken.audio, to: dir.appendingPathComponent(sid + suffix))
+ try EngineFS.atomicWrite(EngineJSON.encode(info), to: dir.appendingPathComponent(sid + ".json"))
+ } catch {
+ throw EngineError(500, "The spoken sound could not be kept for the window.")
+ }
+ return APIResponse.json(info, status: 201)
+ }
+
+ private func sound(_ sid: String) throws -> (URL, String) {
+ if !EngineText.matches("^[0-9a-f]{32}$", sid) { throw EngineError(404, VoiceRoutes.noSound) }
+ let dir = VoiceRoutes.outDir
+ guard let info = EngineJSON.readObject(dir.appendingPathComponent(sid + ".json")),
+ let mime = info["mime"] as? String, let suffix = VoiceRoutes.ext[mime] else {
+ throw EngineError(404, VoiceRoutes.noSound)
+ }
+ let path = dir.appendingPathComponent(sid + suffix)
+ if !EngineFS.isFile(path) { throw EngineError(404, VoiceRoutes.noSound) }
+ return (path, mime)
+ }
+
+ private func audio(_ c: RouteContext) throws -> APIResponse {
+ let (path, mime) = try sound(c.param("sid"))
+ guard let data = try? Data(contentsOf: path, options: .mappedIfSafe) else { throw EngineError(404, VoiceRoutes.noSound) }
+ return APIResponse.data(data, contentType: mime)
+ }
+
+ private func audioDrop(_ c: RouteContext) throws -> APIResponse {
+ let sid = c.param("sid")
+ let (path, _) = try sound(sid)
+ EngineFS.remove(path)
+ EngineFS.remove(VoiceRoutes.outDir.appendingPathComponent(sid + ".json"))
+ return APIResponse.json(["removed": true])
+ }
+}
diff --git a/ios/HASHOUT_LOG.md b/ios/HASHOUT_LOG.md
index 18550db..9204a13 100644
--- a/ios/HASHOUT_LOG.md
+++ b/ios/HASHOUT_LOG.md
@@ -2,6 +2,30 @@
Decisions and removed code for the iPad app (MorpheusMobile). Plan: `MOBILE_PLAN.md` in the planning sidecar. Newest entries first.
+## v0.38.0 · the iPad brought up to 0.37.0: scenes, AI Voice, listening
+
+- refers-to: Engine/ScenesRoutes.swift; Engine/TrashRoutes.swift (`meta`, `restore`); Engine/VoiceRoutes.swift; Engine/VoiceRemote.swift; Engine/VoiceKeychain.swift; Engine/VoiceListen.swift; Engine/EngineRouter.swift; App/Info.plist; App/*.lproj/InfoPlist.strings; setup/api_contract_check; docs/ios/BUILD.md (`## Check on the iPad (0.38.0)`)
+- kind: decision
+- logged: v0.38.0 · 2026-11-28
+
+- **Nothing here was compiled or run** (no Swift toolchain in the workspace). The interface side was looked at in Chrome made to behave as the iPad, with the native side and the voice routes stubbed. The first real build is the owner's, in Xcode; the lines under "Could not be confirmed" are where to look first if it stops.
+- **Read for 0.32.0 to 0.37.0.** Two things have engine routes the iPad lacked: My scenes (`/api/scenes`, and the `scene` kind in Recently Deleted) and AI Voice with listening (`/api/voice`). Everything else of those versions is interface only and needed no Swift: the Build panel, props, starter scenes, scene effects, camera moves, scenes on the timeline, depth, character views, the walk, Save to (hidden on iPad). `sceneFx`, `scenes` and a character's `view` ride inside the movie JSON, which the iPad stores and never reads.
+- **Scenes.** `ScenesRoutes` is `CharactersRoutes` route for route with the sentences of `services/scenes.py`; the folder is `Documents/Scenes` through `EngineConfig.folder("Scenes")`, made on first use (it is not in `ensureTree`, so the Files app shows it after the first scene is saved or listed). The store is `ScenesStore`, not `SceneStore`, to stay clear of the UIScene types.
+- **Voice, what the iPad can do.** The built-in voice is a Python runtime and cannot exist here: status reports it as not ready with `available: false` and a reason, and its routes answer 409 "The built-in voice is not available on iPad." Online is the desktop's requests through URLSession with the key in the Keychain (service `FormMorpheus`, this device only, no environment fallback). The voice app is a speech server on another computer: allowed addresses are loopback, 10/8, 172.16/12, 192.168/16, 169.254/16, fc00::/7, fe80::/10 and names ending in `.local`; everything else is refused, and redirects are refused. The default address is empty (loopback on iPad is the iPad). A `.local` name is resolved by the system and the resolved address is not checked again.
+- **Listening is the Speech framework, on the device only** (`requiresOnDeviceRecognition = true` on every request). A language with no on-device support answers 409 and is never sent to the network. `POST /transcribe/setup` asks for the permission and answers a job the page polls, the desktop's pattern; denied answers 409 with a sentence that points to Settings. Word times are grouped into lines by the desktop's rules (7 words, 42 characters, 3.5 s, a 0.7 s gap or a sentence end). `DELETE /transcribe/job` does not stop a running recognition; it ends by itself or at the timeout.
+- **Routes that wait** (probe, online voices, speak, transcribe) are `addAsync` entries handled in `VoiceRoutes.handle`; the rest go through the `RouteTable`. `setup/api_contract_check` reads `addAsync(` lines too and no longer lists `/api/voice/*` as desktop only.
+- **Info.plist.** `NSSpeechRecognitionUsageDescription`, `NSLocalNetworkUsageDescription`, and `NSAppTransportSecurity` with `NSAllowsLocalNetworking` for plain http to the speech server; both sentences in all 30 `InfoPlist.strings`.
+- **Interface** (`frontend/src/styles/ipad-window.css`, `app/app.ts`, `ui/ai-voice-panel.ts`, `ui/subtitles-panel.ts`; reasons in `frontend/HASHOUT_LOG.md`): the `ai-voice` command is on for iPad; 44 px targets in the surfaces of 0.32.0 to 0.37.0 by mapping their control tokens to `--touch-target`; the Timeline's top row has an upright layout; Walk To Here by touch and hold.
+- **Could not be confirmed without a compiler:**
+ - `VoiceRemote` · the no-redirect delegate method's completion handler is written without `@Sendable`; if a newer SDK does not accept it as the delegate method, redirects would be followed.
+ - `VoiceRemote` · `connectionProxyDictionary = [:]` is assumed to turn the system proxy off, and `dataTask(with:completionHandler:)` to still call the session delegate for a redirect.
+ - `VoiceRemote` · `URLComponents.host` for an IPv6 literal with or without brackets (both handled).
+ - `VoiceListen` · `request.addsPunctuation`, `Locale.current.region` and `SFSpeechRecognitionTask.error` are assumed to exist with these spellings on the deployment target; error code 1110 of `kAFAssistantErrorDomain` is read as "no speech"; `didFinishRecognition` is assumed to come once per final utterance with times from the start of the file, and `didFinishSuccessfully` last.
+ - `VoiceListen` · a recognizer made on the engine's queue for status is assumed safe; recognition itself starts on the main thread.
+ - `VoiceRoutes`, `VoiceListen` · `NSLock.withLock` inside async functions warns in Swift 5, as noted before for `ExportCapabilities.runProbe`.
+ - Plain http to a `.local` name or a private address is assumed to be covered by `NSAllowsLocalNetworking`.
+- Left open: the 200 MB cap on a spoken sound is checked when the whole reply has arrived, not while it streams; rows of the content's menu stay 38 px like every menu on iPad; the Help pictures have no tap to enlarge.
+
## v0.31.0 · the device check, and no Swift change
- refers-to: docs/ios/BUILD.md (`## Check on the iPad (0.31.0)`)
diff --git a/ios/project.yml b/ios/project.yml
index 0684f5a..dbcecc0 100644
--- a/ios/project.yml
+++ b/ios/project.yml
@@ -27,7 +27,7 @@ settings:
TARGETED_DEVICE_FAMILY: "2"
SUPPORTS_MACCATALYST: NO
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: NO
- MARKETING_VERSION: "0.37.0"
+ MARKETING_VERSION: "0.38.0"
CURRENT_PROJECT_VERSION: "1"
configs:
Debug:
diff --git a/setup/api_contract_check b/setup/api_contract_check
index cc4806b..dcbbf61 100755
--- a/setup/api_contract_check
+++ b/setup/api_contract_check
@@ -15,7 +15,6 @@ have: ffmpeg, a socket server, or a folder dialog onto the file system.
/api/files/stat watches a linked SVG by its path; the iPad picks the file again instead
/api/files/source reads a linked SVG by its path; the iPad picks the file again instead
/api/video-tools* finds, downloads and removes ffmpeg; the iPad encodes with its own video encoders
- /api/voice/* AI voices run a Python runtime, a voice app on this computer or the keychain; off on iPad
/api/agents*, /api/agent/*, /api/terminal*, /api/mcp/*, /mcp
outside agents and the terminal panel are desktop only
/api/window/* the window key guards a loopback server other programs can reach; the iPad's scheme
@@ -25,6 +24,7 @@ Everything else is required.
How routes are found in Swift:
table.add("GET", "/library/{name}") exact: the method and the path are written out
+ addAsync("POST", "/voice/speak") exact as well: a group's own list of routes that wait (VoiceRoutes)
a group that parses request.path by hand (prefix "/jobs" and tests such as rest[1] == "audio"): matched by
heuristic, shown as "~" in the lists: the group's prefix, every literal segment of the route and its method
must all appear in the group's file.
@@ -54,7 +54,6 @@ DESKTOP_ONLY = [
("*", "/api/terminal"),
("*", "/api/terminal/*"),
("*", "/api/mcp/*"),
- ("*", "/api/voice/*"),
("*", "/api/video-tools"),
("*", "/api/video-tools/*"),
("*", "/api/window/*"),
@@ -78,7 +77,7 @@ def is_desktop_only(method: str, path: str) -> bool:
return False
-ADD = re.compile(r'\.add\(\s*"([A-Za-z]+)"\s*,\s*"([^"]+)"')
+ADD = re.compile(r'(?:\.add|\baddAsync)\(\s*"([A-Za-z]+)"\s*,\s*"([^"]+)"')
PREFIX = re.compile(r'\bprefix\s*=\s*"(/[^"]*)"')
FIRST = re.compile(r'parts\.first\s*==\s*"([^"]+)"')
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 30a7c64..3bc82de 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -1047,7 +1047,7 @@ dependencies = [
[[package]]
name = "formmorpheus"
-version = "0.37.0"
+version = "0.38.0"
dependencies = [
"gtk",
"objc2",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index c2435c2..93b310c 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "formmorpheus"
-version = "0.37.0"
+version = "0.38.0"
description = "FormMorpheus desktop shell"
authors = ["NodeAgentc, Inc."]
license = "Apache-2.0"
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index f0e83b1..86916cb 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "FormMorpheus",
- "version": "0.37.0",
+ "version": "0.38.0",
"identifier": "ai.nodemode.formmorpheus",
"build": {
"frontendDist": "../frontend/dist"