Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 27 additions & 23 deletions extensions/2.0/KHR_audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,12 @@ Audio emitter objects may be added to 3D nodes for positional audio or to the sc
{
"extensions": {
"KHR_audio": {
"sources": [
{
"name": "environment",
"uri": "./environment.mp3"
},
{
"name": "quack",
"mimeType": "audio/mpeg",
"bufferView": 5
}
],
"emitters": [
{
"name": "environment emitter",
"type": "global",
"gain": 1.0,
"loop": true,
"playing": true,
"source": 0
},
{
"name": "duck emitter",
"name": "Positional Emitter",
"type": "positional",
"gain": 0.8,
"loop": false,
"playing": false,
"source": 1,
"sources": [0, 1],
"positional": {
"coneInnerAngle": 6.283185307179586,
"coneOuterAngle": 6.283185307179586,
Expand All @@ -66,6 +45,31 @@ Audio emitter objects may be added to 3D nodes for positional audio or to the sc
"rolloffFactor": 0.8
}
}
],
"sources": [
{
"name": "Clip 1",
"gain": 0.6,
"autoPlay": true,
"loop": true,
"audio": 0
},
{
"name": "Clip 2",
"gain": 0.6,
"autoPlay": true,
"loop": true,
"audio": 1
}
],
"audio": [
{
"uri": "audio1.mp3",
},
{
"bufferView": 0,
"mimeType": "audio/mpeg"
}
]
}
},
Expand Down
21 changes: 6 additions & 15 deletions extensions/2.0/KHR_audio/schema/emitter.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,13 @@
"minimum": 0.0,
"default": 1.0
},
"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.",
"sources": {
"description": "An array of audio sources used by the audio emitter.",
"type": "array",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
{
"$ref": "glTFid.schema.json"
}
]
},
"positional": {
Expand Down
36 changes: 35 additions & 1 deletion extensions/2.0/KHR_audio/schema/glTF.KHR_audio.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@
"type": "object",
"$ref": "source.schema.json"
},
"autoPlay": {
"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
},
"gain": {
"description": "Unitless multiplier against original source volume for determining emitter loudness.",
"type": "number",
"minimum": 0.0,
"default": 1.0
},
"loop": {
"description": "Whether or not to loop the specified audio clip when finished.",
"type": "boolean",
"default": false
},
"audio": {
"description": "The id of the audio file assigned to this clip.",
"allOf": [
{
"$ref": "glTFid.schema.json"
}
]
},
"minItems": 1
},
"emitters": {
Expand All @@ -21,12 +45,22 @@
"$ref": "emitter.schema.json"
},
"minItems": 1
},
"audio": {
"description": "An array of audio that can be referenced by nodes.",
"type": "array",
"items": {
"type": "object",
"$ref": "source.schema.json"
},
"minItems": 1
},
"extensions": { },
"extras": { }
},
"required": [
"sources",
"emitters"
"emitters",
"audio"
]
}