Next: The Listener, Previous: Audio Files, Up: Audio [Contents][Index]
While the audio-play
procedure provides a quick and convenient
way to play audio, it has some limitations. What if the audio is a
long piece of music that might need to be paused or stopped later?
What if the audio should be looped? What if the volume or pitch needs
to be altered? For manipulating audio in these ways, a “source” is
required. Sources can be thought of like a boombox: They sit
somewhere in the room and play sound. The pause or stop buttons can
be pressed; it can be moved somewhere else; the volume knob can be
adjusted; the CD can be changed.
Sources are a great fit for handling background music, among other
things. For quick, one-off sound effects, audio-play
is a
better fit.
(vec3 0.0 0.0 0.0)
] [#:velocity (vec3 0.0 0.0 0.0)
] [#:direction (vec3 0.0 0.0 0.0)
] [#:relative? #f
]Return a new audio source. audio is the audio data to use when playing. loop? specifies whether or not to loop the audio during playback.
Refer to audio-play
(see Audio Files) for information about
the optional keyword arguments.
Return #t
if obj is an audio source object.
Return #t
if source contains streaming audio.
Return #t
if source contains static audio.
Return #t
if source is currently playing.
Return #t
if source is currently paused.
Return #t
if source is currently stopped.
Return the pitch multiplier of source.
Return the volume multiplier of source.
Return the minimum volume of source.
Return the maximum volume of source.
Return the maximum distance of source.
Return the reference distance of source.
Return the rolloff factor of source.
Return the volume of source when outside the oriented cone.
Return the inner angle of the sound cone of source in radians.
Return the outer angle of the sound cone of source in radians.
Return the position of source as a 3D vector.
Return the velocity of source as a 3D vector.
Return the direction of source as a 3D vector.
Return #t
if the position of source is relative to the
listener’s position.
Begin/resume playback of source.
Pause playback of source.
Play source if it is currently paused or pause source if it is currently playing.
Stop playing source or, if no source is specified, stop playing all sources.
Rewind source to the beginning of the audio stream.
Set the playback stream for source to audio.
Configure whether or not source should loop the audio stream.
Set the pitch multiplier of source to pitch
Set the volume of source to volume. A value of 1.0 is 100% volume.
Set the minimum volume of source to volume.
Set the maximum volume of source to volume.
Set the distance where there will no longer be any attenuation of source to distance.
Set the reference distance of source to distance.
Set the rolloff factor for source to factor.
Set the volume for source when outside the sound cone to volume.
Set the inner angle of the sound cone of source to angle radians.
Set the outer angle of the sound cone of source to angle radians.
Set the position of source to the 3D vector position.
Set the velocity of source to the 3D vector velocity.
Set the velocity of source to the 3D vector direction.
If relative? is #t
, the position of source is
interpreted as relative to the listener’s position. Otherwise, the
position of source is in absolute coordinates.
Next: The Listener, Previous: Audio Files, Up: Audio [Contents][Index]