Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Sound.py « doc « api2_2x « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6cc72f471cf02cdb37c42197d7745eaed635b17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Blender.Sound module and the Sound PyType object

"""
The Blender.Sound submodule.

Sound
=====

This module provides access to B{Sound} objects in Blender.

Example::
  import Blender
  from Blender import Sound
  #
  sound = Sound.Load("/path/to/my/sound.wav")    # load a sound file
  print "Sound from", sound.getFilename(),
  print "loaded to obj", sound.getName())
  print "All Sounds available now:", Sound.Get()
"""

def Load (filename):
  """
  Load the sound called 'filename' into a Sound object.
  @type filename: string
  @param filename: The full path to the sound file.
  @rtype:  Blender Sound
  @return: A Blender Sound object with the data from I{filename}.
  """

def Get (name = None):
  """
  Get the Sound object(s) from Blender.
  @type name: string
  @param name: The name of the Sound object.
  @rtype: Blender Sound or a list of Blender Sounds
  @return: It depends on the I{name} parameter:
      - (name): The Sound object called I{name}, None if not found;
      - (): A list with all Sound objects in the current scene.
  """


class Sound:
  """
  The Sound object
  ================
    This object gives access to Sounds in Blender.
  @cvar name: The name of this Sound object.
  @cvar filename: The filename (path) to the sound file loaded into this Sound
     object.
  """

  def getName():
    """
    Get the name of this Sound object.
    @rtype: string
    """

  def getFilename():
    """
    Get the filename of the sound file loaded into this Sound object.
    @rtype: string
    """

  def play():
    """
    Play this sound.
    """

  def setCurrent():
    """
    Make this the active sound in the sound buttons window (also redraws).
    """

  def getVolume():
    """
    Get this sound's volume.
    rtype: float
    """

  def setVolume(f):
    """
    Set this sound's volume.
    @type f: float
    @param f: the new volume value in the range [0.0, 1.0].
    """

  def getAttenuation():
    """
    Get this sound's attenuation value.
    rtype: float
    """

  def setAttenuation(f):
    """
    Set this sound's attenuation.
    @type f: float
    @param f: the new attenuation value in the range [0.0, 5.0].
    """

  def getPitch():
    """
    Get this sound's pitch value.
    rtype: float
    """

  def setPitch(f):
    """
    Set this sound's pitch.
    @type f: float
    @param f: the new pitch value in the range [-12.0, 12.0].    
    """