pyunity.audio module¶
Classes to manage the playback of audio.
-
class
pyunity.audio.
AudioClip
(file)[source]¶ Bases:
object
Class to store information about an audio file.
-
file
¶ Name of the file
- Type
str
-
sound
¶ Sound file that can be played with a
pygame.mixer.Channel
. Only set when the AudioClip is in anAudioSource
n a running scene.- Type
pygame.mixer.Sound
-
SetSound
(file)[source]¶ Changes the audio file.
- Parameters
file (str) – Name of the audio file Must be a .ogg file, which can work on any platform.
- Raises
PyUnityException – If the provided file is not an OGG audio file
TypeError – If the provided file is not of type str
-
-
class
pyunity.audio.
AudioSource
[source]¶ Bases:
pyunity.core.Component
Manages playback on an AudioSource.
-
PlayOnStart
¶ Whether it plays on start or not.
- Type
bool
-
Loop
¶ Whether it loops or not. This is not fully supported.
- Type
bool
-