Rally Client
HTTP client for communicating with a local rally companion server. Sends recording cut commands and retrieves transcription results via REST API on `localhost:27872`.
HTTP client for communicating with a local rally companion server. Sends recording cut commands and retrieves transcription results via REST API on localhost:27872.
Public API
| Function | Signature | Returns | Description |
|---|---|---|---|
M.transcribe_recording_cut | (requestBody) | table | POSTs a recording cut request to the server |
M.transcribe_transcripts_get | (count) | table | GETs the specified number of transcription results |
Internals
| Name | Type | Description |
|---|---|---|
base_url | string | http://localhost:27872 - local companion server |
httpClient.TIMEOUT | number | 0.5 seconds HTTP timeout |
Response Format
All API calls return a table with:
ok-trueon success,falseon errorerror- error code/message string on failureclient_msg- user-facing error message
Internal Helpers
| Function | Description |
|---|---|
jsonRequestGet(uri) | Performs GET, decodes JSON response |
jsonRequestPost(uri, data) | Performs POST with JSON body, decodes response |
How It Works
- Uses
socket.httpmodule with a 0.5s timeout for non-blocking behavior transcribe_recording_cut()POSTs to/recordings/actions/cut- tells the companion to cut and transcribe a recording segmenttranscribe_transcripts_get(count)GETs from/transcripts/<count>- retrieves recent transcription results- Non-200 responses return
{ok = false, error = <code>}withclient_msgset
Usage Examples
local client = require('/lua/ge/extensions/gameplay/rally/client')
-- Cut the current recording
local resp = client.transcribe_recording_cut({ position = {x=100, y=200, z=50} })
if resp.ok then
-- cut successful
end
-- Get latest transcriptions
local transcripts = client.transcribe_transcripts_get(5)Notes
- The companion server is an external process (Python-based) that handles audio recording and speech-to-text
- Several endpoints are defined but commented out:
recording_start,recording_stop,remote_audio_play_file,remote_audio_reset,remote_audio_queue_size - Uses
ltn12.sink.tableandltn12.source.stringfor HTTP body handling - Short timeout prevents blocking the game loop if the server is unavailable
See Also
- Rally Audio Manager - Related reference
- Rally Camera Path Player - Related reference
- Rally Cut Capture - Related reference
- Gameplay Systems Guide - Guide
Rally Camera Path Player
Plays a cinematic camera path along a snaproad for rally stage preview. Generates a Catmull-Rom camera path from driveline points with configurable height offset, FOV, and playback speed.
Rally Cut Capture
Captures vehicle position/rotation snapshots ("cuts") during recce recording sessions. Each cut is written as a JSON line to a file for later processing by the transcription pipeline.