Skip to content

Add Lua audio recording and local hot mic APIs - #27

Merged
JamieW105 merged 2 commits into
mainfrom
feature/recording-hot-mic
Oct 11, 2026
Merged

JamieW105 merged 2 commits into
mainfrom
feature/recording-hot-mic

Conversation

@JamieW105

@JamieW105 JamieW105 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Lua/Luau scripts can now capture game audio with local rec = rustic.game:startRecording(path?), stop it with rec:stopRecording(), and read retained PCM from the handle. Optional new .wav destinations 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 with read() and stopHotMic() 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:

  • All 61 engine-play library tests pass, including Lua and Luau recording, WAV round trips, handle ownership, cleanup, bounded reads, hot mic input fixtures and resource limits.
  • cargo clippy -p engine-play --all-targets -- -D warnings and formatting pass.
  • The native microphone module cross-compiles and passes strict Clippy for x86_64-pc-windows-gnu using CPAL 0.16.
  • Website lint, build, TypeScript, API examples and audit pass.

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.

@JamieW105

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T08:27:58.259680Z 2b3dc3c Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@JamieW105
JamieW105 marked this pull request as ready for review October 11, 2026 08:29
@JamieW105
JamieW105 merged commit 017db99 into main Oct 11, 2026
8 checks passed
@github-actions
github-actions Bot deleted the feature/recording-hot-mic branch October 11, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants