Banter Voice Transcription and AI Generation
BanterScene exposes voice detection and transcription methods alongside AI image and image-to-3D generation methods. These are separate workflows: voice input produces a transcription event, AiImage() accepts a text prompt, and AiModel() accepts base64 image data.
Register the result event first, start the request with a stable identifier or supported enum, and keep the generated output separate from the request controls.
- Wait for BanterScene to be ready.
- Register the transcription or generation result handling required by the feature.
- Start the voice or AI request using the documented method and values.
Start Voice Detection
The official SDK places these methods under Text-to-Speech, but the documented flow starts voice detection and returns transcription text:
scene.StartTTS(true);
The boolean argument enables voice detection in the official example.
Stop and Request a Transcription
scene.StopTTS("request-1");
The supplied ID is returned with the transcription event so the result can be matched to the request.
Register the listener before stopping:
scene.On("transcription", (event) => {
console.log(event.detail.id);
console.log(event.detail.message);
});
The scene also exposes a voice-started event for the start of listening.
Track Requests with Stable IDs
Use a distinct request ID when several interactions can start transcription. This lets the event handler route the returned message to the correct UI, object, or game state.
Generate an AI Image
scene.AiImage(
"a sunset over mountains",
BS.AiImageRatio._16_9
);
The official reference currently lists:
_1_1_3_2_4_3_16_9_21_9_2_3_3_4_9_16_9_21
Use the enum value rather than a free-form aspect-ratio string.
Generate a 3D Model from Image Data
scene.AiModel(
base64ImageData,
BS.AiModelSimplify.med,
512
);
The documented simplification values are low, med, and high through BS.AiModelSimplify. The third value in the official example is 512.
The input is base64 image data, not a normal image URL.
Connect File Selection to AI Model Generation
The scene utility API exposes:
scene.SelectFile(BS.SelectFileType.Image);
Use the file-selection result flow documented by Banter to obtain image data before calling AiModel(). Do not pass a local filesystem path into the model method.
Common Questions
Why can I not match the Banter transcription to my request?
Pass a stable ID to StopTTS() and compare it with event.detail.id in the transcription listener.
Why does AiModel reject my normal image URL?
The official method example passes base64 image data. Obtain or convert the image through the appropriate Banter file or data workflow before calling AiModel().
Official References
Related Navigation
- Banter Loading Events and Runtime Utilities
- Banter In-World UI System
- Banter Media Components
- Banter VR Documentation