Repository navigation
Add Lua audio recording and local hot mic APIs - #27
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b3dc3c82e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Some(if path.is_absolute() { | ||
| path | ||
| } else { | ||
| self.snapshot_root.join(path) |
There was a problem hiding this comment.
Reject parent traversal in relative recording paths
When a script supplies a relative path such as ../record.wav, this branch joins it directly to snapshot_root without rejecting ParentDir components, so the OS resolves the output outside the temporary play snapshot. This contradicts the documented containment of relative recordings and can unexpectedly persist files elsewhere; validate relative components or otherwise ensure the resolved destination remains beneath snapshot_root.
AGENTS.md reference: AGENTS.md:L10-L12
Useful? React with 👍 / 👎.
Lua/Luau scripts can now capture game audio with
local rec = rustic.game:startRecording(path?), stop it withrec:stopRecording(), and read retained PCM from the handle. Optional new.wavdestinations stream 32-bit float audio and finalize on stop or owner cleanup.{source="microphone"}records Windows default-input audio instead.rustic.game:startHotMic()returns a local PCM stream withread()andstopHotMic()methods. Packets include samples, sample rate, channel count, active state and dropped-input counts. Device capture runs outside scene locks; input queues, recording memory and per-script handles are bounded. Handles enforce owner isolation and close devices/finalize files on destruction or successful reload. Network relay and video capture are outside this change. Engine CI adds the built Luau host to PATH on Linux and Windows and checks its version before running tests, ensuring both Lua and Luau recording coverage executes.Companion website documentation: Rustic-Game-Engine/docs#19
Validation:
cargo clippy -p engine-play --all-targets -- -D warningsand formatting pass.x86_64-pc-windows-gnuusing CPAL 0.16.The Windows installer CI job passed and produced a fresh installer for the feature commit. The latest CI run is validating the workflow setup fix. Physical microphone capture still needs a Windows device smoke test.
Workflow validation: reproduced the missing-Luau failure without PATH setup; all 61 engine-play tests pass with the built host on PATH, and actionlint validates the workflow.