GvrAudioSource

GVR audio source component that enhances AudioSource to provide advanced spatial audio features.

Summary

Inheritance

Inherits from: MonoBehaviour

Public attributes

bypassRoomEffects = false
bool
Denotes whether the room effects should be bypassed.
directivityAlpha = 0.0f
float
Directivity pattern shaping factor.
directivitySharpness = 1.0f
float
Directivity pattern order.
gainDb = 0.0f
float
Input gain in decibels.
listenerDirectivityAlpha = 0.0f
float
Listener directivity pattern shaping factor.
listenerDirectivitySharpness = 1.0f
float
Listener directivity pattern order.
occlusionEnabled = false
bool
Occlusion effect toggle.
playOnAwake = true
bool
Play source on awake.

Properties

clip
AudioClip
The default AudioClip to play.
dopplerLevel
float
Sets the Doppler scale for this audio source.
isPlaying
bool
Is the clip playing right now (Read Only)?
loop
bool
Is the audio clip looping?
maxDistance
float
MaxDistance is the distance a sound stops attenuating at.
minDistance
float
Within the Min distance the GvrAudioSource will cease to grow louder in volume.
mute
bool
Un- / Mutes the source. Mute sets the volume=0, Un-Mute restore the original volume.
pitch
float
The pitch of the audio source.
priority
int
Sets the priority of the audio source.
rolloffMode
AudioRolloffMode
Volume rolloff model with respect to the distance.
spread
float
Sets the spread angle (in degrees) in 3D space.
time
float
Playback position in seconds.
timeSamples
int
Playback position in PCM samples.
volume
float
The volume of the audio source (0.0 to 1.0).

Public functions

GetOutputData(float[] samples, int channel)
void
Provides a block of the currently playing source's output data.
GetSpectrumData(float[] samples, int channel, FFTWindow window)
void
Provides a block of the currently playing audio source's spectrum data.
Pause()
void
Pauses playing the clip.
Play()
void
Plays the clip.
PlayDelayed(float delay)
void
Plays the clip with a delay specified in seconds.
PlayOneShot(AudioClip clip)
void
Plays an AudioClip.
PlayOneShot(AudioClip clip, float volume)
void
Plays an AudioClip, and scales its volume.
PlayScheduled(double time)
void
Plays the clip at a specific time on the absolute time-line that AudioSettings.dspTime reads from.
Stop()
void
Stops playing the clip.
UnPause()
void
Unpauses the paused playback.

Public attributes

bypassRoomEffects

bool bypassRoomEffects = false

Denotes whether the room effects should be bypassed.

directivityAlpha

float directivityAlpha = 0.0f

Directivity pattern shaping factor.

directivitySharpness

float directivitySharpness = 1.0f

Directivity pattern order.

gainDb

float gainDb = 0.0f

Input gain in decibels.

listenerDirectivityAlpha

float listenerDirectivityAlpha = 0.0f

Listener directivity pattern shaping factor.

listenerDirectivitySharpness

float listenerDirectivitySharpness = 1.0f

Listener directivity pattern order.

occlusionEnabled

bool occlusionEnabled = false

Occlusion effect toggle.

playOnAwake

bool playOnAwake = true

Play source on awake.

Properties

clip

AudioClip clip

The default AudioClip to play.

dopplerLevel

float dopplerLevel

Sets the Doppler scale for this audio source.

isPlaying

bool isPlaying

Is the clip playing right now (Read Only)?

loop

bool loop

Is the audio clip looping?

maxDistance

float maxDistance

MaxDistance is the distance a sound stops attenuating at.

minDistance

float minDistance

Within the Min distance the GvrAudioSource will cease to grow louder in volume.

mute

bool mute

Un- / Mutes the source. Mute sets the volume=0, Un-Mute restore the original volume.

pitch

float pitch

The pitch of the audio source.

priority

int priority

Sets the priority of the audio source.

rolloffMode

AudioRolloffMode rolloffMode

Volume rolloff model with respect to the distance.

spread

float spread

Sets the spread angle (in degrees) in 3D space.

time

float time

Playback position in seconds.

timeSamples

int timeSamples

Playback position in PCM samples.

volume

float volume

The volume of the audio source (0.0 to 1.0).

Public functions

GetOutputData

void GetOutputData(
  float[] samples,
  int channel
)

Provides a block of the currently playing source's output data.

Note:The array given in samples will be filled with the requested data before spatialization.

GetSpectrumData

void GetSpectrumData(
  float[] samples,
  int channel,
  FFTWindow window
)

Provides a block of the currently playing audio source's spectrum data.

Note:The array given in samples will be filled with the requested data before spatialization.

Pause

void Pause()

Pauses playing the clip.

Play

void Play()

Plays the clip.

PlayDelayed

void PlayDelayed(
  float delay
)

Plays the clip with a delay specified in seconds.

PlayOneShot

void PlayOneShot(
  AudioClip clip
)

Plays an AudioClip.

PlayOneShot

void PlayOneShot(
  AudioClip clip,
  float volume
)

Plays an AudioClip, and scales its volume.

PlayScheduled

void PlayScheduled(
  double time
)

Plays the clip at a specific time on the absolute time-line that AudioSettings.dspTime reads from.

Stop

void Stop()

Stops playing the clip.

UnPause

void UnPause()

Unpauses the paused playback.