These samples primarily demonstrate Qualcomm q3d_audio SDK in a VR context.  (In doing so, some aspects of SnapdragonVR SDK are demonstrated)


To build all the spatialaudio samples and install their assets, you can run a python script with up to four of the following arguments:

spatialaudio_samples_build_all.py compile package deploy installAssets

clean: cleans each sample.  Generally not necessary unless you want to remove non-source files, or the build system gets into a bad state
compile: builds and links each C++ sample
package: creates each sample's package from the built C++ assets
deploy: installs each sample's package on a connected Android device
installAssets: installs all graphics and audio assets each sample needs on the connected Android device


For each sample, you need to run “InstallAssetsAndroid.bat” so the configuration file and all sounds, models, shaders and textures are ready to go (spatialaudio_samples_build_all.py installAssets will perform this step for all samples)

Suspend/resume restarts each application as if it was relaunched (eg no state is saved between suspend/resume).

Touching the screen recenters the player's position and orientation.

Reverb functionality exists in object_dynamic, object_static and soundfield.  There are three Reverb settings that can be changed by gazing at boxes in the sample: Reverb A and Reverb B are, by default, somewhat different sounding reverbs (how different depends on the sounds playing), and Reverb C is "no reverb".

In all the samples, pausing and unpausing can be performed by gazing at the "Pause" box.  Note that in soundfield, each time a new soundfield sound is played that sound is not paused, because in soundfield the "pause" functionality is applied only to the currently playing sound, so new sounds don't respect previous instructions to "pause".  object_dynamic uses the "global pause/resume" functionality, whereas all the other samples specifically call "pause/resume" on each individual sound; this is to completely exercise the API.

Rolloff can be manipulated in object_static and object_dynamic and has three settings: Rolloff A is logarithmic, Rolloff B is linear, and Rollof C is "no rolloff" (eg object volume is unaffected by distance).

Whether or not play calls are instructed to "loop" can be switched on and off with the appropriate gaze box.

Circa July 5, 2017, a known issue with the current qvrservice (which is unrelated to q3d_audio) is that if the phone is left on for several hours (maybe a day or two), then the player position and orientation are reported as garbage until "adb reboot" is performed.  So if you see a black screen or a wildly moving camera, reboot the phone and try again.

Every q3d_audio call is logged (although the most frequent calls such as "update" are by default switched off unless specifically switched on in app_config.txt).  When isolating bugs, it is often helpful to run:
adb logcat | grep q3d_audio
...so that you see q3d_audio calls in the order they are issued.

Note that the behavior of many application can be changed by modifying that app's app_config.txt.  Below are supported variables(1):


soundchannel
•	Repeatedly plays three sounds in sequence: a stereo sound, a 5.1 sound and a 7.1 sound.  Each sound is faded in upon playing and faded out upon completion

object_static:
•	16 stationary spatialized sounds are visualized by 16 spheres – each sound can be gaze-activated and deactivated

Object_dynamic
•	One moving spatialized sound (visualized by a torus) moves in a helix about the vertical axis, so the listener should hear the sound above, below and all around her at different times.  The sound crossfades between two different sounds
•	Rolloff A and B are by default tuned so that if the player remains at the origin, then when the object is near it's highest (or lowest) point, it will be slightly "out of earshot" (meaning its volume will go to zero) when the radius (or horizontal distance) from the listener is close to maximally far

Soundfield
•	Two soundfields rotate about the listener and crossfade between them.  The “focal sound” of each soundfield is illustrated by a box that appears where the “focal sound” should be emanating
•	There are four "Rotation" settings, so the ambisonics can rotate at different speeds and along different axes (depending on app_config.txt).  By default, Rotation D, is "no rotation", so the player can freeze the ambisonics in their current orientation


(1) app_config.txt files:
//most samples
gLogFramesPerSecond
gRenderFieldOfView
gLooping

gMsaaSamples
gForceOrientationTexture, f
gForcedVSyncTime
gLogSensorData

gReverb_Setting

gReverbA_Enabled
gReverbA_RoomX
gReverbA_RoomY
gReverbA_RoomZ
gReverbA_Gain
gReverbA_TimeAdjust
gReverbA_BrightnessAdjust
gReverbA_RoomWallMaterial
gReverbA_RoomCeilingMaterial
gReverbA_RoomFloorMaterial

gReverbB_Enabled
gReverbB_RoomX
gReverbB_RoomY
gReverbB_RoomZ
gReverbB_Gain
gReverbB_TimeAdjust
gReverbB_BrightnessAdjust
gReverbB_RoomWallMaterial
gReverbB_RoomCeilingMaterial
gReverbB_RoomFloorMaterial

gReverbC_Enabled
gReverbC_RoomX
gReverbC_RoomY
gReverbC_RoomZ
gReverbC_Gain
gReverbC_TimeAdjust
gReverbC_BrightnessAdjust
gReverbC_RoomWallMaterial
gReverbC_RoomCeilingMaterial
gReverbC_RoomFloorMaterial

gRolloff_Setting

gRolloffA_Type
gRolloffA_MinDistance
gRolloffA_MaxDistance

gRolloffB_Type
gRolloffB_MinDistance
gRolloffB_MaxDistance

gRolloffC_Type
gRolloffC_MinDistance
gRolloffC_MaxDistance

gLogAudioUpdate
gLogHeadPoseUpdate
gLogSoundVolume
gLogObjectTransform
gLogSoundfieldTransform
gLogIsSoundPlaying
gRolloffBugWorkaround


//object_static
gObjectDistance


//soundchannel
gSoundTimeToPlay
gSoundTimeToVolumeFade


//object_dynamic
gVerticalExtremaSeconds
gVerticalFunctionPeriodSeconds
gHorizontalFunctionPeriodSeconds
gHorizontalRadiusFunctionHalfPeriodSeconds
gMinRadius
gMaxRadius
gHalfHeight
gSoundTimeToPlay
gSoundTimeToCrossfade


//soundfield
gRotation_Setting

gRotationA_SpeedDegreesPerSecond
gRotationA_AxisX
gRotationA_AxisY
gRotationA_AxisZ

gRotationB_SpeedDegreesPerSecond
gRotationB_AxisX
gRotationB_AxisY
gRotationB_AxisZ

gRotationC_SpeedDegreesPerSecond
gRotationC_AxisX
gRotationC_AxisY
gRotationC_AxisZ

gRotationD_SpeedDegreesPerSecond
gRotationD_AxisX
gRotationD_AxisY
gRotationD_AxisZ

gSoundTimeToPlay
gSoundTimeToCrossfade
