tes3audioController⚓︎
A controller for audio. It holds data on the status of the current and next music tracks, volume settings and other related facilities. All the volumes are expressed in range [0, 1].
Properties⚓︎
audioFlags
⚓︎
A bit set for audio flags.
Returns:
result
(number)
currentMusicFilePath
⚓︎
File path of the currently playing music track. The path can not be longer than 260 characters.
Returns:
result
(string)
directSoundInitFailed
⚓︎
A flag marking if the DirectSound initialization failed. Part of the audio flags.
Returns:
result
(boolean)
disableAudio
⚓︎
A flag which controls whether the audio is disabled or not.
Returns:
result
(boolean)
dsound3DChanged
⚓︎
A flag marking if the direct 3D sound has changed.
Returns:
result
(boolean)
dsound3DCommitted
⚓︎
A flag marking if the direct 3D sound has been committed.
Returns:
result
(boolean)
hasStaticBuffers
⚓︎
A flag marking if there are static audio buffers. Part of the audio flags.
Returns:
result
(boolean)
hasStreamingBuffers
⚓︎
A flag marking if there are streaming audio buffers. Part of the audio flags.
Returns:
result
(boolean)
isFilterGraphValid
⚓︎
A flag marking if the music filter graph is valid. Part of the music flags.
Returns:
result
(boolean)
isMusicPaused
⚓︎
A flag marking if music is paused. Part of the music flags.
Returns:
result
(boolean)
isMusicPlaying
⚓︎
A flag marking if music is playing. Part of the music flags.
Returns:
result
(boolean)
listenerPosition
⚓︎
The sound listener position.
Returns:
result
(tes3vector3)
musicDuration
⚓︎
Read-only. The duration of the currently playing music track.
Returns:
result
(number)
musicFadeBeginTimestamp
⚓︎
The timestamp at which currently playing music track started fading in. So, it's a timestamp at which currently playing music track started.
Returns:
result
(number)
musicFlags
⚓︎
A bit set for music flags.
Returns:
result
(number)
musicNextTrackStartTimestamp
⚓︎
The timestamp at which next track will start playing.
Returns:
result
(number)
musicNextTrackVolume
⚓︎
The volume of the next track.
Returns:
result
(number)
musicPosition
⚓︎
Current play time for currently playing music track.
Returns:
result
(number)
nextMusicFilePath
⚓︎
File path of the music track which is to be played next. The path can not be longer than 260 characters.
Returns:
result
(string)
pitchAxis
⚓︎
Approximated pitch axis in radians.
Returns:
result
(number)
volumeEffects
⚓︎
Volume of the effects. Corresponds to the effects volume slider in Audio settings.
Returns:
result
(number)
volumeFootsteps
⚓︎
Volume of the footsteps. Corresponds to the footsteps volume slider in Audio settings.
Returns:
result
(number)
volumeMaster
⚓︎
Master volume. Corresponds to the master volume slider in Audio settings.
Returns:
result
(number)
volumeMusic
⚓︎
Volume of the music. Corresponds to the music volume slider in Audio settings.
Returns:
result
(number)
volumeVoice
⚓︎
Volume of the voices. Corresponds to the voice volume slider in Audio settings.
Returns:
result
(number)
yawAxis
⚓︎
Approximated yaw axis in radians.
Returns:
result
(number)
Methods⚓︎
changeMusicTrack
⚓︎
Changes currently playing music track according to provided parameters.
myObject:changeMusicTrack(filename, crossfade, volume)
Parameters:
filename
(string): File name of the new music track.crossfade
(number): Default:1000
. Duration of the crossfading between music tracks. Measured in miliseconds.volume
(number): Default:1
. Allows changing the volume of the music track.
getMixVolume
⚓︎
Final volume of a provided type of audio, after master volume and its own volume adjustments. Music volume is an exception since it isn't affected by master volume.
local volume = myObject:getMixVolume(mix)
Parameters:
mix
(tes3.soundMix): The type of sound mix to perform a check for. Accepts values fromtes3.soundMix
namespace.
Returns:
volume
(number)
getMusicFileDuration
⚓︎
Loads a music file and determines its duration, in seconds.
local duration = myObject:getMusicFileDuration(path)
Parameters:
path
(string): The path to the music track, relative to the game installation directory.
Returns:
duration
(number): The number of seconds of the track, in seconds.
pauseMusic
⚓︎
Pauses the game's music.
myObject:pauseMusic()
unpauseMusic
⚓︎
Unpauses the game's music.
myObject:unpauseMusic()