1
# Blender.Sound module and the Sound PyType object
4
The Blender.Sound submodule.
9
This module provides access to B{Sound} objects in Blender.
13
from Blender import Sound
15
sound = Sound.Load("/path/to/my/sound.wav") # load a sound file
16
print "Sound from", sound.getFilename(),
17
print "loaded to obj", sound.getName())
18
print "All Sounds available now:", Sound.Get()
23
Load the sound called 'filename' into a Sound object.
24
@type filename: string
25
@param filename: The full path to the sound file.
27
@return: A Blender Sound object with the data from I{filename}.
30
def Get (name = None):
32
Get the Sound object(s) from Blender.
34
@param name: The name of the Sound object.
35
@rtype: Blender Sound or a list of Blender Sounds
36
@return: It depends on the I{name} parameter:
37
- (name): The Sound object called I{name}, None if not found;
38
- (): A list with all Sound objects in the current scene.
46
This object gives access to Sounds in Blender.
47
@ivar name: The name of this Sound object.
48
@ivar filename: The filename (path) to the sound file loaded into this Sound
54
Get the name of this Sound object.
60
Get the filename of the sound file loaded into this Sound object.
71
Make this the active sound in the sound buttons window (also redraws).
76
Get this sound's volume.
82
Set this sound's volume.
84
@param f: the new volume value in the range [0.0, 1.0].
89
Get this sound's attenuation value.
93
def setAttenuation(f):
95
Set this sound's attenuation.
97
@param f: the new attenuation value in the range [0.0, 5.0].
102
Get this sound's pitch value.
108
Set this sound's pitch.
110
@param f: the new pitch value in the range [-12.0, 12.0].