public class SourceJavaSound extends Source
| Modifier and Type | Field and Description |
|---|---|
protected ChannelJavaSound |
channelJavaSound
The source's basic Channel type-cast to a ChannelJavaSound.
|
ListenerData |
listener
Handle to the listener information.
|
attModel, channel, codec, distanceFromListener, distOrRoll, fadeInGain, fadeInMilis, fadeOutGain, fadeOutMilis, filenameURL, gain, lastFadeCheck, libraryType, pitch, position, preLoad, priority, rawDataFormat, rawDataStream, soundBuffer, soundSequenceLock, soundSequenceQueue, sourcename, sourceVolume, temporary, toLoop, toPlay, toStream, velocity| Constructor and Description |
|---|
SourceJavaSound(ListenerData listener,
AudioFormat audioFormat,
boolean priority,
String sourcename,
float x,
float y,
float z,
int attModel,
float distOrRoll)
Constructor: Creates a new streaming source that will be directly fed with
raw audio data.
|
SourceJavaSound(ListenerData listener,
boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
SoundBuffer soundBuffer,
float x,
float y,
float z,
int attModel,
float distOrRoll,
boolean temporary)
Constructor: Creates a new source using the specified parameters.
|
SourceJavaSound(ListenerData listener,
Source old,
SoundBuffer soundBuffer)
Constructor: Creates a new source matching the specified source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculateGain()
Calculates the gain for this source based on its attenuation model and
distance from the listener.
|
void |
calculatePan()
Calculates the panning for this source based on its position in relation to
the listener.
|
void |
calculatePitch()
Calculates the pitch for this source based on its position in relation to
the listener.
|
void |
changeSource(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
SoundBuffer soundBuffer,
float x,
float y,
float z,
int attModel,
float distOrRoll,
boolean temporary)
Changes the peripheral information about the source using the specified
parameters.
|
void |
cleanup()
Shuts the source down and removes references to all instantiated objects.
|
void |
listenerMoved()
Called every time the listener's position or orientation changes.
|
float |
min(float a,
float b) |
void |
play(Channel c)
Plays the source on the specified channel.
|
void |
positionChanged()
Updates the pan and gain.
|
boolean |
preLoad()
Queues up the initial stream-buffers for the stream.
|
void |
setAttenuation(int model)
Sets this source's attenuation model.
|
void |
setDistOrRoll(float dr)
Sets this source's fade distance or rolloff factor, depending on the
attenuation model.
|
void |
setPitch(float value)
Manually sets this source's pitch.
|
void |
setPosition(float x,
float y,
float z)
Moves the source to the specified position.
|
void |
setVelocity(float x,
float y,
float z)
Sets this source's velocity, for use in Doppler effect.
|
activate, active, checkFadeOut, cull, dequeueSound, errorCheck, errorMessage, fadeOut, fadeOutIn, feedRawAudioData, flush, getClassName, getDistanceFromListener, getPitch, getSoundSequenceQueueSize, importantMessage, incrementSoundSequence, message, millisecondsPlayed, pause, paused, playing, printStackTrace, queueSound, reverseByteOrder, rewind, setLooping, setPriority, setTemporary, stop, stopped, streamprotected ChannelJavaSound channelJavaSound
public ListenerData listener
public SourceJavaSound(ListenerData listener, boolean priority, boolean toStream, boolean toLoop, String sourcename, FilenameURL filenameURL, SoundBuffer soundBuffer, float x, float y, float z, int attModel, float distOrRoll, boolean temporary)
listener - Handle to information about the listener.priority - Setting this to true will prevent other sounds from overriding this one.toStream - Setting this to true will create a streaming source.toLoop - Should this source loop, or play only once.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.filenameURL - Filename/URL of the sound file to play at this source.soundBuffer - Sound buffer to use if creating a new normal source.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of 'att'.temporary - Whether or not to remove this source after it finishes playing.public SourceJavaSound(ListenerData listener, Source old, SoundBuffer soundBuffer)
listener - Handle to information about the listener.old - Source to copy information from.soundBuffer - Sound buffer to use if creating a new normal source.public SourceJavaSound(ListenerData listener, AudioFormat audioFormat, boolean priority, String sourcename, float x, float y, float z, int attModel, float distOrRoll)
listener - Handle to information about the listener.audioFormat - Format that the data will be in.priority - Setting this to true will prevent other sounds from overriding this one.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of 'att'.public void cleanup()
public void changeSource(boolean priority,
boolean toStream,
boolean toLoop,
String sourcename,
FilenameURL filenameURL,
SoundBuffer soundBuffer,
float x,
float y,
float z,
int attModel,
float distOrRoll,
boolean temporary)
changeSource in class Sourcepriority - Setting this to true will prevent other sounds from overriding this one.toStream - Setting this to true will create a streaming source.toLoop - Should this source loop, or play only once.sourcename - A unique identifier for this source. Two sources may not use the same sourcename.filenameURL - Filename/URL of the sound file to play at this source.soundBuffer - Sound buffer to use if creating a new normal source.x - X position for this source.y - Y position for this source.z - Z position for this source.attModel - Attenuation model to use.distOrRoll - Either the fading distance or rolloff factor, depending on the value of 'att'.temporary - Whether or not to remove this source after it finishes playing.public void listenerMoved()
listenerMoved in class Sourcepublic void setVelocity(float x,
float y,
float z)
setVelocity in class Sourcex - Velocity along world x-axis.y - Velocity along world y-axis.z - Velocity along world z-axis.public void setPosition(float x,
float y,
float z)
setPosition in class Sourcex - X coordinate to move to.y - Y coordinate to move to.z - Z coordinate to move to.public void positionChanged()
positionChanged in class Sourcepublic void setPitch(float value)
public void setAttenuation(int model)
setAttenuation in class Sourcemodel - Attenuation model to use.public void setDistOrRoll(float dr)
setDistOrRoll in class Sourcedr - New value for fade distance or rolloff factor.public void play(Channel c)
public boolean preLoad()
public void calculateGain()
public void calculatePan()
public void calculatePitch()
public float min(float a,
float b)
Copyright © 2017. All rights reserved.