ChatSoundResult chat.sound-result@1
Generated at from
openvibe-contracts v0.107.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/chat/sound-result.v1.json
chat.sound-result@1: the answer of GET /internal/chat/sounds/by-command?channel_id&command on OpenVibe.Chat (capability chat.sounds.read): the approved channel sound a !command plays, one at random when several match (OpenVibe.Live's getChannelSoundByCommand), projected exactly as chat.sounds-result@1's sound. channel_id is the channel owner's Live user id (channel_sounds.channel_owner_id). An unknown command or channel is a 404, answered as chat.ingress-ack@1's error.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: by-command
{
"ok": true,
"sound": {
"id": 904,
"channel_owner_id": 77,
"command": "airhorn",
"url": "/sounds/77/airhorn.mp3",
"mime": "audio/mpeg",
"duration_seconds": 2.4,
"created_by": 512,
"created_by_name": "pixelfox",
"media_url": "https://media.openvibe.network/med_01K6R3A1B2C3D4E5F6G7H8J9KA",
"media_asset_id": 4402
}
}Rejected: sound-without-url
{
"sound": {
"id": 904,
"channel_owner_id": 77,
"command": "airhorn",
"mime": "audio/mpeg",
"duration_seconds": 2.4,
"created_by": 512,
"created_by_name": "pixelfox",
"media_url": null,
"media_asset_id": null
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.sound-result@1', value); // { valid, errors: [{ path, message }] }