Title: Sonix
1Sonix
2Overview
- Why use audio
- Introduction of sonix
- Standalone usage
- VR Juggler application usage
- Goal
- Be able to add sound to VR Juggler applications
3Audio Introduction
- The benefits of using audio
- Takes no screen space
- Works well with background processes
- Humans process audio in parallel with visual
information - Human focus works well
- Audio channel is available.
- Key More immersive
4Sonix
- Provides simple audio objects for playing sounds
using one of several audio APIs - Features
- Simple API
- Short learning curve
- Simple usage, stays out of the way
- Access to spatialized audio and triggering
- Supports features needed for virtual environments
- Spatialized or ambient sounds
- One-shot and looping sounds
- Supports runtime reconfigurability
5SonixSystem
- System
- Handle
- Sound info
- API plugins
6Using Sonix
- Basic steps
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step function
7Using Sonix
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource snxSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
simulate running application while (1)
float time_delta(getTimeChangeInSeconds())
sonixinstance()-gtstep(time_delta)
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step func
8Using Sonix
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource snxSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
simulate running application while (1)
float time_delta(getTimeChangeInSeconds())
sonixinstance()-gtstep(time_delta)
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step func
9Using Sonix
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource snxSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
simulate running application while (1)
float time_delta(getTimeChangeInSeconds())
sonixinstance()-gtstep(time_delta)
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step func
10Using Sonix
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource snxSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
simulate running application while (1)
float time_delta(getTimeChangeInSeconds())
sonixinstance()-gtstep(time_delta)
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step func
11Using Sonix
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource snxSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
simulate running application while (1)
float time_delta(getTimeChangeInSeconds())
sonixinstance()-gtstep(time_delta)
- Set sound API
- Configure sound info
- Initialize sound handle
- Trigger sound
- Call time step func
12Reconfiguration
- Example uses
- Change sound API being used
- Disable sounds
- Benefits
- Portability of application
- Enforces decoupling in implementation
13Reconfiguration example
include ltsnx/sonix.hgt int main (int argc, char
argv) // Start API (set to OpenAL)
sonixinstance()-gtchangeAPI("OpenAL") //
Setup sound description for our sound
snxSoundInfo si si.filename "sound.wav"
si.datasource xnsSoundInfoFILESYSTEM
// Create sound handle object snxSoundHandle
mySound("MySound") mySound.configure(si)
// Trigger the sound mySound.trigger() //
Switch API sonixinstance()-gtchangeAPI(Audiow
orks") // simulate running application
while (1) float time_delta(getTimeChangeInSec
onds()) sonixinstance()-gtstep(time_delta)
- Single call to system controller
- Already used in every application
14Sound Manager
- Capabilities
- Integrates sonix control with VR Juggler kernel
- User can configure sounds in config file
- Still allows full sonix API, but simplifies
common usages
15Configuring Sound Manager
16Sound Manager Example
class myApp public vrjGlApp void
init() mSound.init(bump)
mButton0.init(VJButton0) void
preFrame() if(mButton0-gtgetData()
gadgetDigitalON) mSound.trigger()
snxSoundHandle mSound
gadgetDigitalInterface mButton0
- Initialize sound handle
- Trigger sound
17Sound Manager Example
class myApp public vrjGlApp void
init() mSound.init(bump)
mButton0.init(VJButton0) void
preFrame() if(mButton0-gtgetData()
gadgetDigitalON) mSound.trigger()
snxSoundHandle mSound
gadgetDigitalInterface mButton0
- Initialize sound handle
- Trigger sound
18Demo
- Example of sonix VR Juggler application
19Thats all there is to it
- Questions???
- Give it a try and let us know what you think
- Documentation
- http//www.vrjuggler.org/sonix/docs.php
- Future work
- Support for more sound APIs
- Great place to contribute to project (hint, hint
)