Sound data is represented by a special <audio>
data type that
stores not only the audio samples themselves, but metadata such as
sample rate, number of channels, and how many bits are used for each
sample.
static
]Load audio within file-name. The following file formats are currently supported:
Audio files can be loaded in two different ways, as indicated by mode:
Generally speaking, sound effects don’t take up much space and should be loaded statically, but music files are much larger and should use streaming. Static loading is the default.
Return #t
if obj is an audio object.
Return #t
if audio uses stream loading.
Return #t
if audio uses static loading.
Return the loading mode for audio, either static
or
stream
.
Return the duration of audio in seconds.
Return the number of bits per sample in audio.
Return the number of channels in audio.
Return the sample rate of audio.
(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
]Play audio. There are many, many knobs to tweak that will affect the sound that comes out of the player’s speakers.:
For games with basic sound needs (that is to say they don’t need 3D sound modeling), the only things that really matter are volume and pitch.