See·two-phase async
ᛜ
Audio Generation
Generate audio
Voice and music synthesis. Configurable sample rate.
0x0000000000000000000000000000000000000819Explorer
Two-phase async. eth_call validates encoding only. Real generation requires a consumer contract with
onAudioReady callback.click 'auto' (capability = 5)
milliseconds
min escrow: 0.1000 RITUALyou have: — RITUAL
Connect your wallet to submit a real transaction.
to: 0x0000000000000000000000000000000000000819chainId 1979 · two-phase
Output
Click Validate to encode the audio request.
10.0s · LFM2.5-Audio-1.5B
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {PrecompileConsumer} from "./utils/PrecompileConsumer.sol";
contract AudioGenerator is PrecompileConsumer {
address constant AUDIO = address(0x819);
address constant ASYNC_DELIVERY = 0x5A16214fF555848411544b005f7Ac063742f39F6;
event AudioRequested(bytes32 indexed jobId, address indexed sender);
event AudioReady(bytes32 indexed jobId, string uri, uint32 durationMs);
function generate(address executor) external {
// ModalInput[] with prompt as TEXT input
// OutputConfig with outputType=2 (AUDIO), maxParam1=maxDurationMs
// … see /playground/audio for full encode call
// Use abi.encode with tuple-aware ABI — flat scalar encoding fails.
}
function onAudioReady(bytes32 jobId, bytes calldata result) external {
require(msg.sender == ASYNC_DELIVERY, "unauth");
(
bool hasError, , string memory uri, , , ,
uint32 durationMs, /* errorMessage */
) = abi.decode(result, (bool, bytes, string, bytes32, bool, uint32, uint32, string));
require(!hasError, "audio gen failed");
emit AudioReady(jobId, uri, durationMs);
}
}