-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OMI_audio_emitter #1
Merged
Merged
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2cae7b0
OMI_audio_emitter first draft
robertlong d2248c9
Remove muted property
robertlong 524df3e
Respond to OMI_audio_emitter PR feedback
robertlong f353a5b
Move to audio sources instead of clips
robertlong 808dae1
Added descriptions and fixed PR feedback
robertlong 5f32b79
Readme volume -> gain
robertlong 7f3a577
Merge branch 'main' into OMI_audio_emitter
robertlong 87c700d
Add explainer
robertlong 56a3d3b
Update explainer
robertlong 73720dc
changes autoplay to playing and revises docs
antpb 078b856
revises readme
antpb 8249dc6
revises phrasing of description
antpb 525b335
use the word setting instead of saving
antpb 06c81d4
Merge pull request #45 from antpb/autoplay-rename-to-playing
robertlong 7d79f9b
adds explainer formulas
antpb 4c0ebc6
reformats code block
antpb aaafdf3
adds audio cone gain algorithm example graphic and explainer docs
9ca0547
fix relative path for audio cone figure
0767da7
adds white background to audio cone figure
3b30b9b
adds Third Room to list of implementations
5fada8b
add anthony to contributor list
antpb df24720
adds figure source of audiio cone graphic
antpb 8d995c1
open cone graphic external link in new tab
antpb 88fbc60
adjusts figure 1 caption markup
antpb 32c29d2
Merge pull request #46 from antpb/add-explainer-documentation
robertlong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# OMI_audio_emitter | ||
|
||
## Example | ||
|
||
```json | ||
{ | ||
"extensions": { | ||
"OMI_audio_emitter": { | ||
"audioSources": [ | ||
{ | ||
"name": "environment", | ||
"uri": "./environment.mp3" | ||
}, | ||
{ | ||
"name": "quack", | ||
"mimeType": "audio/mpeg", | ||
"bufferView": 5 | ||
} | ||
], | ||
"audioEmitters": [ | ||
{ | ||
"name": "environment emitter", | ||
"type": "global", | ||
"volume": 1, | ||
"loop": true, | ||
"autoPlay": true, | ||
"source": 0 | ||
}, | ||
{ | ||
"name": "duck emitter", | ||
"type": "positional", | ||
"volume": 0.8, | ||
"loop": false, | ||
"autoPlay": false, | ||
"source": 1, | ||
"coneInnerAngle": 6.283185307179586, | ||
"coneOuterAngle": 6.283185307179586, | ||
"coneOuterGain": 0, | ||
"distanceModel": "inverse", | ||
"maxDistance": 10, | ||
"refDistance": 1, | ||
"rolloffFactor": 0.8 | ||
} | ||
] | ||
} | ||
}, | ||
"scenes": [ | ||
{ | ||
"name": "Default Scene", | ||
"extensions": { | ||
"OMI_audio_emitter": { | ||
"audioEmitters": [0] | ||
} | ||
} | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"name": "Duck", | ||
"translation": [1, 2, 3], | ||
"extensions": { | ||
"OMI_audio_emitter": { | ||
"audioEmitter": 1 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
``` |
109 changes: 109 additions & 0 deletions
109
extensions/2.0/OMI_audio_emitter/schema/audioEmitter.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"$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." | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"volume": { | ||
"type": "number", | ||
"minimum": 0, | ||
"default": 1 | ||
robertlong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"loop": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"autoPlay": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"source": { | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFid.schema.json" | ||
} | ||
], | ||
"description": "The id of the audio source referenced by this audio emitter." | ||
}, | ||
"coneInnerAngle": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 6.283185307179586, | ||
"default": 6.283185307179586 | ||
}, | ||
"coneOuterAngle": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 360, | ||
"default": 360 | ||
}, | ||
"coneOuterGain": { | ||
"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": { | ||
"type": "number", | ||
"minimum": 0, | ||
"exclusiveMinimum": true, | ||
"default": 10000, | ||
"description": "maximumDistance may only be applied when the distanceModel is set to linear. Otherwise, it should be ignored." | ||
}, | ||
"refDistance": { | ||
"type": "number", | ||
"minimum": 0, | ||
"default": 1 | ||
}, | ||
"rolloffFactor": { | ||
"type": "number", | ||
"description": "When distanceModel is set to linear, the maximum value is 1.", | ||
"minimum": 0, | ||
"default": 1 | ||
}, | ||
"name": { }, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"required": [ | ||
"type", | ||
"source" | ||
robertlong marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
extensions/2.0/OMI_audio_emitter/schema/audioSource.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "Audio Source", | ||
"type": "object", | ||
"description": "A source for audio data referenced in Audio Emitters Audio can be referenced by URI or `bufferView` index. `mimeType` is required when `bufferView` is used.", | ||
"allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
"properties": { | ||
"uri": { | ||
"type": "string", | ||
"description": "The uri of the audio file.", | ||
"format": "uriref", | ||
"gltf_detailedDescription": "The uri of the audio file. Relative paths are relative to the .gltf file.", | ||
"gltf_uriType": "audio" | ||
}, | ||
"mimeType": { | ||
"type": "string", | ||
"description": "The audio's MIME type. Required if `bufferView` is defined. Unless specified by another extension, the only supported mimeType is audio/mpeg.", | ||
"anyOf": [ | ||
{ | ||
"enum": [ "audio/mpeg" ] | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"bufferView": { | ||
"allOf": [ { "$ref": "glTFid.schema.json" } ], | ||
"description": "The index of the bufferView that contains the audio data. Use this instead of the image's uri property." | ||
}, | ||
"name": { }, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"dependencies": { | ||
"bufferView": [ "mimeType" ] | ||
}, | ||
"oneOf": [ | ||
{ "required": [ "uri" ] }, | ||
{ "required": [ "bufferView" ] } | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
extensions/2.0/OMI_audio_emitter/schema/glTF.OMI_audio_emitter.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "OMI_audio_emitter glTF extension", | ||
"type": "object", | ||
"allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
"properties": { | ||
"audioSources": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "audioSource.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"audioEmitters": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"$ref": "audioEmitter.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"required": [ | ||
"audioSources", | ||
"audioEmitters" | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
extensions/2.0/OMI_audio_emitter/schema/node.OMI_audio_emitter.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "OMI_audio_emitter node extension", | ||
"type": "object", | ||
"allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
"properties": { | ||
"audioEmitter": { | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFid.schema.json" | ||
} | ||
], | ||
"description": "The id of the audioEmitter referenced by this node." | ||
}, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"required": [ | ||
"audioEmitter" | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that
KHR_LIGHTS_PUNCTUAL
usesinnerConeAngle
andouterConeAngle
to describe it's spotlight cone. As we have updated the proposed specification already to more closely mirror the way images are added, should we also look to other primary extensions for naming inspiration?