{
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Audio Emitter",
"type": "object",
"description": "A positional or global audio emitter.",
"allOf": [ { "$ref": "glTFProperty.schema.json" } ],
"properties": {
"type": {
"type": "string",
"description": "Specifies the audio emitter type.",
"anyOf": [
{
"enum": [ "positional" ],
"description": "Positional audio emitters."
},
{
"enum": [ "global" ],
"description": "Global audio emitters are not affected by the position of audio listeners. `coneInnerAngle`, `coneOuterAngle`, `coneOuterGain`, `distanceModel`, `maxDistance`, `refDistance`, and `rolloffFactor` should all be ignored when set."
},
{
"type": "string"
}
]
},
"gain": {
"description": "Unitless multiplier against original source volume for determining emitter loudness.",
"type": "number",
"minimum": 0,
"default": 1
},
"loop": {
"description": "Whether or not to loop the specified audio clip when finished.",
"type": "boolean",
"default": false
},
"playing": {
"description": "Whether or not the specified audio clip is playing. Setting this property true will set the audio clip to play on load (autoplay).",
"type": "boolean",
"default": false
},
"source": {
"description": "The id of the audio source referenced by this audio emitter.",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
},
"coneInnerAngle": {
"description": "The angle, in radians, of a cone inside of which there will be no volume reduction.",
"type": "number",
"minimum": 0,
"maximum": 6.283185307179586,
"default": 6.283185307179586
},
"coneOuterAngle": {
"description": "The angle, in radians, of a cone outside of which the volume will be reduced to a constant value of`coneOuterGain`.",
"type": "number",
"minimum": 0,
"maximum": 6.283185307179586,
"default": 6.283185307179586
},
"coneOuterGain": {
"description": "The gain of the audio emitter set when outside the cone defined by the `coneOuterAngle` property. It is a linear value (not dB).",
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 0
},
"distanceModel": {
"type": "string",
"description": "Specifies the distance model for the audio emitter.",
"anyOf": [
{
"enum": [ "linear" ],
"description": "A linear distance model calculating the gain induced by the distance according to: 1 - rolloffFactor * (distance - refDistance) / (maxDistance - refDistance)"
},
{
"enum": [ "inverse" ],
"description": "An inverse distance model calculating the gain induced by the distance according to: refDistance / (refDistance + rolloffFactor * (Math.max(distance, refDistance) - refDistance))"
},
{
"enum": [ "exponential" ],
"description": "An exponential distance model calculating the gain induced by the distance according to: pow((Math.max(distance, refDistance) / refDistance, -rolloffFactor)"
}
],
"default": "inverse"
},
"maxDistance": {
"description": "The maximum distance between the emitter and listener, after which the volume will not be reduced any further. `maximumDistance` may only be applied when the distanceModel is set to linear. Otherwise, it should be ignored.",
"type": "number",
"minimum": 0,
"exclusiveMinimum": true,
"default": 10000
},
"refDistance": {
"description": "A reference distance for reducing volume as the emitter moves further from the listener. For distances less than this, the volume is not reduced.",
"type": "number",
"minimum": 0,
"default": 1
},
"rolloffFactor": {
"type": "number",
"description": "Describes how quickly the volume is reduced as the emitter moves away from listener. When distanceModel is set to linear, the maximum value is 1 otherwise there is no upper limit.",
"minimum": 0,
"default": 1
},
"name": { },
"extensions": { },
"extras": { }
},
"required": [
"type"
]
}