Supports 4-channel WAV files, presumed to be B-format (FuMa) first-order Ambisonic. Supports WAV with arbitrary sample rate (needs optimization). Supports soundfield volume and orientation set via script. Supports localOnly client-side injection using simple (non-spatialized) test renderer.
Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 11 files). Show all
Unified · Split
| @@ -45,6 +45,9 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(SharedSoundPointer sound · 44 unmodified lines | ||
| 45 | 45 | // stereo option isn't set from script, this comes from sound metadata or filename |
| 46 | 46 | AudioInjectorOptions optionsCopy = injectorOptions; |
| 47 | 47 | optionsCopy.stereo = sound->isStereo(); |
| 48 | + optionsCopy.ambisonic = sound->isAmbisonic(); | |
| 49 | + optionsCopy.localOnly = sound->isAmbisonic(); // always localOnly for Ambisonic | |
| 50 | + | |
| 48 | 51 | auto injector = AudioInjector::playSound(sound->getByteArray(), optionsCopy); |
| 49 | 52 | if (!injector) { |
| 50 | 53 | return NULL; |