blender-python-stubs 4.5.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aud/__init__.pyi +659 -0
- aud/py.typed +0 -0
- bl_math/__init__.pyi +14 -0
- bl_math/py.typed +0 -0
- blender_python_stubs-4.5.8.0.dist-info/METADATA +68 -0
- blender_python_stubs-4.5.8.0.dist-info/RECORD +76 -0
- blender_python_stubs-4.5.8.0.dist-info/WHEEL +4 -0
- blender_python_stubs-4.5.8.0.dist-info/licenses/LICENSE +21 -0
- blf/__init__.pyi +62 -0
- blf/py.typed +0 -0
- bmesh/__init__.pyi +21 -0
- bmesh/geometry/__init__.pyi +7 -0
- bmesh/ops/__init__.pyi +401 -0
- bmesh/py.typed +0 -0
- bmesh/types/__init__.pyi +1120 -0
- bmesh/utils/__init__.pyi +63 -0
- bpy/__init__.pyi +13 -0
- bpy/app/__init__.pyi +146 -0
- bpy/ops/__init__.pyi +176 -0
- bpy/path/__init__.pyi +81 -0
- bpy/props/__init__.pyi +213 -0
- bpy/py.typed +0 -0
- bpy/types/__init__.pyi +47404 -0
- bpy/utils/__init__.pyi +228 -0
- bpy/utils/previews/__init__.pyi +52 -0
- bpy/utils/toolsystem/__init__.pyi +39 -0
- bpy_extras/__init__.pyi +14 -0
- bpy_extras/anim_utils/__init__.pyi +84 -0
- bpy_extras/asset_utils/__init__.pyi +25 -0
- bpy_extras/bmesh_utils/__init__.pyi +12 -0
- bpy_extras/id_map_utils/__init__.pyi +10 -0
- bpy_extras/image_utils/__init__.pyi +18 -0
- bpy_extras/io_utils/__init__.pyi +83 -0
- bpy_extras/keyconfig_utils/__init__.pyi +10 -0
- bpy_extras/mesh_utils/__init__.pyi +42 -0
- bpy_extras/node_shader_utils/__init__.pyi +202 -0
- bpy_extras/node_utils/__init__.pyi +18 -0
- bpy_extras/object_utils/__init__.pyi +56 -0
- bpy_extras/py.typed +0 -0
- bpy_extras/view3d_utils/__init__.pyi +40 -0
- freestyle/__init__.pyi +11 -0
- freestyle/chainingiterators/__init__.pyi +345 -0
- freestyle/functions/__init__.pyi +1273 -0
- freestyle/predicates/__init__.pyi +1329 -0
- freestyle/py.typed +0 -0
- freestyle/shaders/__init__.pyi +820 -0
- freestyle/types/__init__.pyi +2400 -0
- freestyle/utils/__init__.pyi +159 -0
- gpu/__init__.pyi +12 -0
- gpu/capabilities/__init__.pyi +75 -0
- gpu/compute/__init__.pyi +8 -0
- gpu/matrix/__init__.pyi +53 -0
- gpu/platform/__init__.pyi +16 -0
- gpu/py.typed +0 -0
- gpu/select/__init__.pyi +4 -0
- gpu/shader/__init__.pyi +59 -0
- gpu/state/__init__.pyi +89 -0
- gpu/texture/__init__.pyi +9 -0
- gpu/types/__init__.pyi +821 -0
- gpu_extras/__init__.pyi +2 -0
- gpu_extras/batch/__init__.pyi +18 -0
- gpu_extras/presets/__init__.pyi +20 -0
- gpu_extras/py.typed +0 -0
- idprop/__init__.pyi +3 -0
- idprop/py.typed +0 -0
- idprop/types/__init__.pyi +221 -0
- imbuf/__init__.pyi +19 -0
- imbuf/py.typed +0 -0
- imbuf/types/__init__.pyi +42 -0
- mathutils/__init__.pyi +2092 -0
- mathutils/bvhtree/__init__.pyi +58 -0
- mathutils/geometry/__init__.pyi +227 -0
- mathutils/interpolate/__init__.pyi +8 -0
- mathutils/kdtree/__init__.pyi +32 -0
- mathutils/noise/__init__.pyi +117 -0
- mathutils/py.typed +0 -0
aud/__init__.pyi
ADDED
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import collections.abc
|
|
2
|
+
|
|
3
|
+
"""Audaspace (pronounced "outer space") is a high level audio library."""
|
|
4
|
+
|
|
5
|
+
from typing import Generic, TypeVar
|
|
6
|
+
|
|
7
|
+
_T = TypeVar("_T")
|
|
8
|
+
|
|
9
|
+
AP_LOCATION: int
|
|
10
|
+
|
|
11
|
+
AP_ORIENTATION: int
|
|
12
|
+
|
|
13
|
+
AP_PANNING: int
|
|
14
|
+
|
|
15
|
+
AP_PITCH: int
|
|
16
|
+
|
|
17
|
+
AP_VOLUME: int
|
|
18
|
+
|
|
19
|
+
CHANNELS_INVALID: int
|
|
20
|
+
|
|
21
|
+
CHANNELS_MONO: int
|
|
22
|
+
|
|
23
|
+
CHANNELS_STEREO: int
|
|
24
|
+
|
|
25
|
+
CHANNELS_STEREO_LFE: int
|
|
26
|
+
|
|
27
|
+
CHANNELS_SURROUND4: int
|
|
28
|
+
|
|
29
|
+
CHANNELS_SURROUND5: int
|
|
30
|
+
|
|
31
|
+
CHANNELS_SURROUND51: int
|
|
32
|
+
|
|
33
|
+
CHANNELS_SURROUND61: int
|
|
34
|
+
|
|
35
|
+
CHANNELS_SURROUND71: int
|
|
36
|
+
|
|
37
|
+
CODEC_AAC: int
|
|
38
|
+
|
|
39
|
+
CODEC_AC3: int
|
|
40
|
+
|
|
41
|
+
CODEC_FLAC: int
|
|
42
|
+
|
|
43
|
+
CODEC_INVALID: int
|
|
44
|
+
|
|
45
|
+
CODEC_MP2: int
|
|
46
|
+
|
|
47
|
+
CODEC_MP3: int
|
|
48
|
+
|
|
49
|
+
CODEC_OPUS: int
|
|
50
|
+
|
|
51
|
+
CODEC_PCM: int
|
|
52
|
+
|
|
53
|
+
CODEC_VORBIS: int
|
|
54
|
+
|
|
55
|
+
CONTAINER_AAC: int
|
|
56
|
+
|
|
57
|
+
CONTAINER_AC3: int
|
|
58
|
+
|
|
59
|
+
CONTAINER_FLAC: int
|
|
60
|
+
|
|
61
|
+
CONTAINER_INVALID: int
|
|
62
|
+
|
|
63
|
+
CONTAINER_MATROSKA: int
|
|
64
|
+
|
|
65
|
+
CONTAINER_MP2: int
|
|
66
|
+
|
|
67
|
+
CONTAINER_MP3: int
|
|
68
|
+
|
|
69
|
+
CONTAINER_OGG: int
|
|
70
|
+
|
|
71
|
+
CONTAINER_WAV: int
|
|
72
|
+
|
|
73
|
+
DISTANCE_MODEL_EXPONENT: int
|
|
74
|
+
|
|
75
|
+
DISTANCE_MODEL_EXPONENT_CLAMPED: int
|
|
76
|
+
|
|
77
|
+
DISTANCE_MODEL_INVALID: int
|
|
78
|
+
|
|
79
|
+
DISTANCE_MODEL_INVERSE: int
|
|
80
|
+
|
|
81
|
+
DISTANCE_MODEL_INVERSE_CLAMPED: int
|
|
82
|
+
|
|
83
|
+
DISTANCE_MODEL_LINEAR: int
|
|
84
|
+
|
|
85
|
+
DISTANCE_MODEL_LINEAR_CLAMPED: int
|
|
86
|
+
|
|
87
|
+
FORMAT_FLOAT32: int
|
|
88
|
+
|
|
89
|
+
FORMAT_FLOAT64: int
|
|
90
|
+
|
|
91
|
+
FORMAT_INVALID: int
|
|
92
|
+
|
|
93
|
+
FORMAT_S16: int
|
|
94
|
+
|
|
95
|
+
FORMAT_S24: int
|
|
96
|
+
|
|
97
|
+
FORMAT_S32: int
|
|
98
|
+
|
|
99
|
+
FORMAT_U8: int
|
|
100
|
+
|
|
101
|
+
RATE_11025: int
|
|
102
|
+
|
|
103
|
+
RATE_16000: int
|
|
104
|
+
|
|
105
|
+
RATE_192000: int
|
|
106
|
+
|
|
107
|
+
RATE_22050: int
|
|
108
|
+
|
|
109
|
+
RATE_32000: int
|
|
110
|
+
|
|
111
|
+
RATE_44100: int
|
|
112
|
+
|
|
113
|
+
RATE_48000: int
|
|
114
|
+
|
|
115
|
+
RATE_8000: int
|
|
116
|
+
|
|
117
|
+
RATE_88200: int
|
|
118
|
+
|
|
119
|
+
RATE_96000: int
|
|
120
|
+
|
|
121
|
+
RATE_INVALID: int
|
|
122
|
+
|
|
123
|
+
STATUS_INVALID: int
|
|
124
|
+
|
|
125
|
+
STATUS_PAUSED: int
|
|
126
|
+
|
|
127
|
+
STATUS_PLAYING: int
|
|
128
|
+
|
|
129
|
+
STATUS_STOPPED: int
|
|
130
|
+
|
|
131
|
+
class Device:
|
|
132
|
+
"""Device objects represent an audio output backend like OpenAL or SDL, but might also represent a file output or RAM buffer output."""
|
|
133
|
+
|
|
134
|
+
channels: object
|
|
135
|
+
"""The channel count of the device."""
|
|
136
|
+
|
|
137
|
+
distance_model: object
|
|
138
|
+
"""The distance model of the device.
|
|
139
|
+
|
|
140
|
+
.. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__"""
|
|
141
|
+
|
|
142
|
+
doppler_factor: object
|
|
143
|
+
"""The doppler factor of the device.
|
|
144
|
+
This factor is a scaling factor for the velocity vectors in doppler calculation. So a value bigger than 1 will exaggerate the effect as it raises the velocity."""
|
|
145
|
+
|
|
146
|
+
format: object
|
|
147
|
+
"""The native sample format of the device."""
|
|
148
|
+
|
|
149
|
+
listener_location: object
|
|
150
|
+
"""The listeners's location in 3D space, a 3D tuple of floats."""
|
|
151
|
+
|
|
152
|
+
listener_orientation: object
|
|
153
|
+
"""The listener's orientation in 3D space as quaternion, a 4 float tuple."""
|
|
154
|
+
|
|
155
|
+
listener_velocity: object
|
|
156
|
+
"""The listener's velocity in 3D space, a 3D tuple of floats."""
|
|
157
|
+
|
|
158
|
+
rate: object
|
|
159
|
+
"""The sampling rate of the device in Hz."""
|
|
160
|
+
|
|
161
|
+
speed_of_sound: object
|
|
162
|
+
"""The speed of sound of the device.
|
|
163
|
+
The speed of sound in air is typically 343.3 m/s."""
|
|
164
|
+
|
|
165
|
+
volume: object
|
|
166
|
+
"""The overall volume of the device."""
|
|
167
|
+
|
|
168
|
+
def lock(self) -> None:
|
|
169
|
+
"""Locks the device so that it's guaranteed, that no samples are
|
|
170
|
+
read from the streams until :meth:`unlock` is called.
|
|
171
|
+
This is useful if you want to do start/stop/pause/resume some
|
|
172
|
+
sounds at the same time.
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
def play(self, sound: Sound, keep: bool = False) -> Handle:
|
|
176
|
+
"""Plays a sound."""
|
|
177
|
+
|
|
178
|
+
def stopAll(self) -> None:
|
|
179
|
+
"""Stops all playing and paused sounds."""
|
|
180
|
+
|
|
181
|
+
def unlock(self) -> None:
|
|
182
|
+
"""Unlocks the device after a lock call, see :meth:`lock` for
|
|
183
|
+
details.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
class DynamicMusic:
|
|
187
|
+
"""The DynamicMusic object allows to play music depending on a current scene, scene changes are managed by the class, with the possibility of custom transitions.
|
|
188
|
+
The default transition is a crossfade effect, and the default scene is silent and has id 0
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
fadeTime: object
|
|
192
|
+
"""The length in seconds of the crossfade transition"""
|
|
193
|
+
|
|
194
|
+
position: object
|
|
195
|
+
"""The playback position of the scene in seconds."""
|
|
196
|
+
|
|
197
|
+
scene: object
|
|
198
|
+
"""The current scene"""
|
|
199
|
+
|
|
200
|
+
status: object
|
|
201
|
+
"""Whether the scene is playing, paused or stopped (=invalid)."""
|
|
202
|
+
|
|
203
|
+
volume: object
|
|
204
|
+
"""The volume of the scene."""
|
|
205
|
+
|
|
206
|
+
def addScene(self, scene: Sound) -> int:
|
|
207
|
+
"""Adds a new scene."""
|
|
208
|
+
|
|
209
|
+
def addTransition(self, ini: int, end: int, transition: Sound) -> bool:
|
|
210
|
+
"""Adds a new scene."""
|
|
211
|
+
|
|
212
|
+
def pause(self) -> bool:
|
|
213
|
+
"""Pauses playback of the scene."""
|
|
214
|
+
|
|
215
|
+
def resume(self) -> bool:
|
|
216
|
+
"""Resumes playback of the scene."""
|
|
217
|
+
|
|
218
|
+
def stop(self) -> bool:
|
|
219
|
+
"""Stops playback of the scene."""
|
|
220
|
+
|
|
221
|
+
class HRTF:
|
|
222
|
+
"""An HRTF object represents a set of head related transfer functions as impulse responses. It's used for binaural sound"""
|
|
223
|
+
|
|
224
|
+
def addImpulseResponseFromSound(
|
|
225
|
+
self, sound: Sound, azimuth: float, elevation: float
|
|
226
|
+
) -> bool:
|
|
227
|
+
"""Adds a new hrtf to the HRTF object"""
|
|
228
|
+
|
|
229
|
+
@classmethod
|
|
230
|
+
def loadLeftHrtfSet(cls, extension: str, directory: object) -> HRTF:
|
|
231
|
+
"""Loads all HRTFs from a directory."""
|
|
232
|
+
|
|
233
|
+
@classmethod
|
|
234
|
+
def loadRightHrtfSet(cls, extension: str, directory: object) -> HRTF:
|
|
235
|
+
"""Loads all HRTFs from a directory."""
|
|
236
|
+
|
|
237
|
+
class Handle:
|
|
238
|
+
"""Handle objects are playback handles that can be used to control playback of a sound. If a sound is played back multiple times then there are as many handles."""
|
|
239
|
+
|
|
240
|
+
attenuation: object
|
|
241
|
+
"""This factor is used for distance based attenuation of the source.
|
|
242
|
+
|
|
243
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
244
|
+
|
|
245
|
+
cone_angle_inner: object
|
|
246
|
+
"""The opening angle of the inner cone of the source. If the cone values of a source are set there are two (audible) cones with the apex at the :attr:`location` of the source and with infinite height, heading in the direction of the source's :attr:`orientation`.
|
|
247
|
+
In the inner cone the volume is normal. Outside the outer cone the volume will be :attr:`cone_volume_outer` and in the area between the volume will be interpolated linearly."""
|
|
248
|
+
|
|
249
|
+
cone_angle_outer: object
|
|
250
|
+
"""The opening angle of the outer cone of the source.
|
|
251
|
+
|
|
252
|
+
.. seealso:: :attr:`cone_angle_inner`"""
|
|
253
|
+
|
|
254
|
+
cone_volume_outer: object
|
|
255
|
+
"""The volume outside the outer cone of the source.
|
|
256
|
+
|
|
257
|
+
.. seealso:: :attr:`cone_angle_inner`"""
|
|
258
|
+
|
|
259
|
+
distance_maximum: object
|
|
260
|
+
"""The maximum distance of the source.
|
|
261
|
+
If the listener is further away the source volume will be 0.
|
|
262
|
+
|
|
263
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
264
|
+
|
|
265
|
+
distance_reference: object
|
|
266
|
+
"""The reference distance of the source.
|
|
267
|
+
At this distance the volume will be exactly :attr:`volume`.
|
|
268
|
+
|
|
269
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
270
|
+
|
|
271
|
+
keep: object
|
|
272
|
+
"""Whether the sound should be kept paused in the device when its end is reached.
|
|
273
|
+
This can be used to seek the sound to some position and start playback again.
|
|
274
|
+
|
|
275
|
+
.. warning:: If this is set to true and you forget stopping this equals a memory leak as the handle exists until the device is destroyed."""
|
|
276
|
+
|
|
277
|
+
location: object
|
|
278
|
+
"""The source's location in 3D space, a 3D tuple of floats."""
|
|
279
|
+
|
|
280
|
+
loop_count: object
|
|
281
|
+
"""The (remaining) loop count of the sound. A negative value indicates infinity."""
|
|
282
|
+
|
|
283
|
+
orientation: object
|
|
284
|
+
"""The source's orientation in 3D space as quaternion, a 4 float tuple."""
|
|
285
|
+
|
|
286
|
+
pitch: object
|
|
287
|
+
"""The pitch of the sound."""
|
|
288
|
+
|
|
289
|
+
position: object
|
|
290
|
+
"""The playback position of the sound in seconds."""
|
|
291
|
+
|
|
292
|
+
relative: object
|
|
293
|
+
"""Whether the source's location, velocity and orientation is relative or absolute to the listener."""
|
|
294
|
+
|
|
295
|
+
status: object
|
|
296
|
+
"""Whether the sound is playing, paused or stopped (=invalid)."""
|
|
297
|
+
|
|
298
|
+
velocity: object
|
|
299
|
+
"""The source's velocity in 3D space, a 3D tuple of floats."""
|
|
300
|
+
|
|
301
|
+
volume: object
|
|
302
|
+
"""The volume of the sound."""
|
|
303
|
+
|
|
304
|
+
volume_maximum: object
|
|
305
|
+
"""The maximum volume of the source.
|
|
306
|
+
|
|
307
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
308
|
+
|
|
309
|
+
volume_minimum: object
|
|
310
|
+
"""The minimum volume of the source.
|
|
311
|
+
|
|
312
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
313
|
+
|
|
314
|
+
def pause(self) -> bool:
|
|
315
|
+
"""Pauses playback."""
|
|
316
|
+
|
|
317
|
+
def resume(self) -> bool:
|
|
318
|
+
"""Resumes playback."""
|
|
319
|
+
|
|
320
|
+
def stop(self) -> bool:
|
|
321
|
+
"""Stops playback."""
|
|
322
|
+
|
|
323
|
+
class ImpulseResponse:
|
|
324
|
+
"""An ImpulseResponse object represents a filter with which to convolve a sound."""
|
|
325
|
+
|
|
326
|
+
class PlaybackManager:
|
|
327
|
+
"""A PlabackManager object allows to easily control groups os sounds organized in categories."""
|
|
328
|
+
|
|
329
|
+
def addCategory(self, volume: float) -> int:
|
|
330
|
+
"""Adds a category with a custom volume."""
|
|
331
|
+
|
|
332
|
+
def clean(self) -> None:
|
|
333
|
+
"""Cleans all the invalid and finished sound from the playback manager."""
|
|
334
|
+
|
|
335
|
+
def getVolume(self, catKey: int) -> float:
|
|
336
|
+
"""Retrieves the volume of a category."""
|
|
337
|
+
|
|
338
|
+
def pause(self, catKey: int) -> bool:
|
|
339
|
+
"""Pauses playback of the category."""
|
|
340
|
+
|
|
341
|
+
def play(self, sound: Sound, catKey: int) -> Handle:
|
|
342
|
+
"""Plays a sound through the playback manager and assigns it to a category."""
|
|
343
|
+
|
|
344
|
+
def resume(self, catKey: int) -> bool:
|
|
345
|
+
"""Resumes playback of the catgory."""
|
|
346
|
+
|
|
347
|
+
def setVolume(self, volume: float, catKey: int) -> int:
|
|
348
|
+
"""Changes the volume of a category."""
|
|
349
|
+
|
|
350
|
+
def stop(self, catKey: int) -> bool:
|
|
351
|
+
"""Stops playback of the category."""
|
|
352
|
+
|
|
353
|
+
class Sequence(Sound, Generic[_T]):
|
|
354
|
+
"""This sound represents sequenced entries to play a sound sequence."""
|
|
355
|
+
|
|
356
|
+
channels: object
|
|
357
|
+
"""The channel count of the sequence."""
|
|
358
|
+
|
|
359
|
+
distance_model: object
|
|
360
|
+
"""The distance model of the sequence.
|
|
361
|
+
|
|
362
|
+
.. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__"""
|
|
363
|
+
|
|
364
|
+
doppler_factor: object
|
|
365
|
+
"""The doppler factor of the sequence.
|
|
366
|
+
This factor is a scaling factor for the velocity vectors in doppler calculation. So a value bigger than 1 will exaggerate the effect as it raises the velocity."""
|
|
367
|
+
|
|
368
|
+
fps: object
|
|
369
|
+
"""The listeners's location in 3D space, a 3D tuple of floats."""
|
|
370
|
+
|
|
371
|
+
muted: object
|
|
372
|
+
"""Whether the whole sequence is muted."""
|
|
373
|
+
|
|
374
|
+
rate: object
|
|
375
|
+
"""The sampling rate of the sequence in Hz."""
|
|
376
|
+
|
|
377
|
+
speed_of_sound: object
|
|
378
|
+
"""The speed of sound of the sequence.
|
|
379
|
+
The speed of sound in air is typically 343.3 m/s."""
|
|
380
|
+
|
|
381
|
+
def add(self, sound: Sound, begin: float, end: float, skip: float) -> SequenceEntry:
|
|
382
|
+
"""Adds a new entry to the sequence."""
|
|
383
|
+
|
|
384
|
+
def remove(self, entry: SequenceEntry) -> None:
|
|
385
|
+
"""Removes an entry from the sequence."""
|
|
386
|
+
|
|
387
|
+
def setAnimationData(
|
|
388
|
+
self,
|
|
389
|
+
type: int,
|
|
390
|
+
frame: int,
|
|
391
|
+
data: collections.abc.Sequence[float],
|
|
392
|
+
animated: bool,
|
|
393
|
+
) -> None:
|
|
394
|
+
"""Writes animation data to a sequence."""
|
|
395
|
+
|
|
396
|
+
class SequenceEntry:
|
|
397
|
+
"""SequenceEntry objects represent an entry of a sequenced sound."""
|
|
398
|
+
|
|
399
|
+
attenuation: object
|
|
400
|
+
"""This factor is used for distance based attenuation of the source.
|
|
401
|
+
|
|
402
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
403
|
+
|
|
404
|
+
cone_angle_inner: object
|
|
405
|
+
"""The opening angle of the inner cone of the source. If the cone values of a source are set there are two (audible) cones with the apex at the :attr:`location` of the source and with infinite height, heading in the direction of the source's :attr:`orientation`.
|
|
406
|
+
In the inner cone the volume is normal. Outside the outer cone the volume will be :attr:`cone_volume_outer` and in the area between the volume will be interpolated linearly."""
|
|
407
|
+
|
|
408
|
+
cone_angle_outer: object
|
|
409
|
+
"""The opening angle of the outer cone of the source.
|
|
410
|
+
|
|
411
|
+
.. seealso:: :attr:`cone_angle_inner`"""
|
|
412
|
+
|
|
413
|
+
cone_volume_outer: object
|
|
414
|
+
"""The volume outside the outer cone of the source.
|
|
415
|
+
|
|
416
|
+
.. seealso:: :attr:`cone_angle_inner`"""
|
|
417
|
+
|
|
418
|
+
distance_maximum: object
|
|
419
|
+
"""The maximum distance of the source.
|
|
420
|
+
If the listener is further away the source volume will be 0.
|
|
421
|
+
|
|
422
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
423
|
+
|
|
424
|
+
distance_reference: object
|
|
425
|
+
"""The reference distance of the source.
|
|
426
|
+
At this distance the volume will be exactly :attr:`volume`.
|
|
427
|
+
|
|
428
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
429
|
+
|
|
430
|
+
muted: object
|
|
431
|
+
"""Whether the entry is muted."""
|
|
432
|
+
|
|
433
|
+
relative: object
|
|
434
|
+
"""Whether the source's location, velocity and orientation is relative or absolute to the listener."""
|
|
435
|
+
|
|
436
|
+
sound: object
|
|
437
|
+
"""The sound the entry is representing and will be played in the sequence."""
|
|
438
|
+
|
|
439
|
+
volume_maximum: object
|
|
440
|
+
"""The maximum volume of the source.
|
|
441
|
+
|
|
442
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
443
|
+
|
|
444
|
+
volume_minimum: object
|
|
445
|
+
"""The minimum volume of the source.
|
|
446
|
+
|
|
447
|
+
.. seealso:: :attr:`Device.distance_model`"""
|
|
448
|
+
|
|
449
|
+
def move(self, begin: float, end: float, skip: float) -> None:
|
|
450
|
+
"""Moves the entry."""
|
|
451
|
+
|
|
452
|
+
def setAnimationData(
|
|
453
|
+
self,
|
|
454
|
+
type: int,
|
|
455
|
+
frame: int,
|
|
456
|
+
data: collections.abc.Sequence[float],
|
|
457
|
+
animated: bool,
|
|
458
|
+
) -> None:
|
|
459
|
+
"""Writes animation data to a sequenced entry."""
|
|
460
|
+
|
|
461
|
+
class Sound:
|
|
462
|
+
"""Sound objects are immutable and represent a sound that can be played simultaneously multiple times. They are called factories because they create reader objects internally that are used for playback."""
|
|
463
|
+
|
|
464
|
+
length: object
|
|
465
|
+
"""The length attribute returns the duration of the sound in seconds."""
|
|
466
|
+
|
|
467
|
+
specs: object
|
|
468
|
+
"""The sample specification of the sound as a tuple with rate and channel count."""
|
|
469
|
+
|
|
470
|
+
def ADSR(
|
|
471
|
+
self, attack: float, decay: float, sustain: float, release: float
|
|
472
|
+
) -> Sound:
|
|
473
|
+
"""Attack-Decay-Sustain-Release envelopes the volume of a sound.
|
|
474
|
+
Note: there is currently no way to trigger the release with this API.
|
|
475
|
+
"""
|
|
476
|
+
|
|
477
|
+
def accumulate(self, additive: bool = False) -> Sound:
|
|
478
|
+
"""Accumulates a sound by summing over positive input
|
|
479
|
+
differences thus generating a monotonic sigal.
|
|
480
|
+
If additivity is set to true negative input differences get added too,
|
|
481
|
+
but positive ones with a factor of two.
|
|
482
|
+
|
|
483
|
+
Note that with additivity the signal is not monotonic anymore.
|
|
484
|
+
"""
|
|
485
|
+
|
|
486
|
+
def addSound(self, sound: Sound) -> None:
|
|
487
|
+
"""Adds a new sound to a sound list."""
|
|
488
|
+
|
|
489
|
+
def binaural(self, hrtf: HRTF, source: Source, threadPool: ThreadPool) -> Sound:
|
|
490
|
+
"""Creates a binaural sound using another sound as source. The original sound must be mono"""
|
|
491
|
+
|
|
492
|
+
@classmethod
|
|
493
|
+
def buffer(cls, data: object, rate: float) -> Sound:
|
|
494
|
+
"""Creates a sound from a data buffer."""
|
|
495
|
+
|
|
496
|
+
def cache(self) -> Sound:
|
|
497
|
+
"""Caches a sound into RAM.
|
|
498
|
+
|
|
499
|
+
This saves CPU usage needed for decoding and file access if the
|
|
500
|
+
underlying sound reads from a file on the harddisk,
|
|
501
|
+
but it consumes a lot of memory.
|
|
502
|
+
"""
|
|
503
|
+
|
|
504
|
+
def convolver(
|
|
505
|
+
self, impulseResponse: ImpulseResponse, threadPool: ThreadPool
|
|
506
|
+
) -> Sound:
|
|
507
|
+
"""Creates a sound that will apply convolution to another sound."""
|
|
508
|
+
|
|
509
|
+
def data(self) -> object:
|
|
510
|
+
"""Retrieves the data of the sound as numpy array."""
|
|
511
|
+
|
|
512
|
+
def delay(self, time: float) -> Sound:
|
|
513
|
+
"""Delays by playing adding silence in front of the other sound's data."""
|
|
514
|
+
|
|
515
|
+
def envelope(
|
|
516
|
+
self, attack: float, release: float, threshold: float, arthreshold: float
|
|
517
|
+
) -> Sound:
|
|
518
|
+
"""Delays by playing adding silence in front of the other sound's data."""
|
|
519
|
+
|
|
520
|
+
def fadein(self, start: float, length: float) -> Sound:
|
|
521
|
+
"""Fades a sound in by raising the volume linearly in the given
|
|
522
|
+
time interval.
|
|
523
|
+
"""
|
|
524
|
+
|
|
525
|
+
def fadeout(self, start: float, length: float) -> Sound:
|
|
526
|
+
"""Fades a sound in by lowering the volume linearly in the given
|
|
527
|
+
time interval.
|
|
528
|
+
"""
|
|
529
|
+
|
|
530
|
+
@classmethod
|
|
531
|
+
def file(cls, filename: str) -> Sound:
|
|
532
|
+
"""Creates a sound object of a sound file."""
|
|
533
|
+
|
|
534
|
+
def filter(
|
|
535
|
+
self,
|
|
536
|
+
b: collections.abc.Sequence[float],
|
|
537
|
+
a: collections.abc.Sequence[float] = (1,),
|
|
538
|
+
) -> Sound:
|
|
539
|
+
"""Filters a sound with the supplied IIR filter coefficients.
|
|
540
|
+
Without the second parameter you'll get a FIR filter.
|
|
541
|
+
|
|
542
|
+
If the first value of the a sequence is 0,
|
|
543
|
+
it will be set to 1 automatically.
|
|
544
|
+
If the first value of the a sequence is neither 0 nor 1, all
|
|
545
|
+
filter coefficients will be scaled by this value so that it is 1
|
|
546
|
+
in the end, you don't have to scale yourself.
|
|
547
|
+
"""
|
|
548
|
+
|
|
549
|
+
def highpass(self, frequency: float, Q: float = 0.5) -> Sound:
|
|
550
|
+
"""Creates a second order highpass filter based on the transfer
|
|
551
|
+
function :math:`H(s) = s^2 / (s^2 + s/Q + 1)`
|
|
552
|
+
"""
|
|
553
|
+
|
|
554
|
+
def join(self, sound: Sound) -> Sound:
|
|
555
|
+
"""Plays two factories in sequence."""
|
|
556
|
+
|
|
557
|
+
def limit(self, start: float, end: float) -> Sound:
|
|
558
|
+
"""Limits a sound within a specific start and end time."""
|
|
559
|
+
|
|
560
|
+
@classmethod
|
|
561
|
+
def list(cls, random: int) -> Sound:
|
|
562
|
+
"""Creates an empty sound list that can contain several sounds."""
|
|
563
|
+
|
|
564
|
+
def loop(self, count: int) -> Sound:
|
|
565
|
+
"""Loops a sound."""
|
|
566
|
+
|
|
567
|
+
def lowpass(self, frequency: float, Q: float = 0.5) -> Sound:
|
|
568
|
+
"""Creates a second order lowpass filter based on the transfer function :math:`H(s) = 1 / (s^2 + s/Q + 1)`"""
|
|
569
|
+
|
|
570
|
+
def mix(self, sound: Sound) -> Sound:
|
|
571
|
+
"""Mixes two factories."""
|
|
572
|
+
|
|
573
|
+
def modulate(self, sound: Sound) -> Sound:
|
|
574
|
+
"""Modulates two factories."""
|
|
575
|
+
|
|
576
|
+
def mutable(self) -> Sound:
|
|
577
|
+
"""Creates a sound that will be restarted when sought backwards.
|
|
578
|
+
If the original sound is a sound list, the playing sound can change.
|
|
579
|
+
"""
|
|
580
|
+
|
|
581
|
+
def pingpong(self) -> Sound:
|
|
582
|
+
"""Plays a sound forward and then backward.
|
|
583
|
+
This is like joining a sound with its reverse.
|
|
584
|
+
"""
|
|
585
|
+
|
|
586
|
+
def pitch(self, factor: float) -> Sound:
|
|
587
|
+
"""Changes the pitch of a sound with a specific factor."""
|
|
588
|
+
|
|
589
|
+
def rechannel(self, channels: int) -> Sound:
|
|
590
|
+
"""Rechannels the sound."""
|
|
591
|
+
|
|
592
|
+
def resample(self, rate: float, quality: int) -> Sound:
|
|
593
|
+
"""Resamples the sound."""
|
|
594
|
+
|
|
595
|
+
def reverse(self) -> Sound:
|
|
596
|
+
"""Plays a sound reversed."""
|
|
597
|
+
|
|
598
|
+
@classmethod
|
|
599
|
+
def sawtooth(cls, frequency: float, rate: int) -> Sound:
|
|
600
|
+
"""Creates a sawtooth sound which plays a sawtooth wave."""
|
|
601
|
+
|
|
602
|
+
@classmethod
|
|
603
|
+
def silence(cls, rate: int) -> Sound:
|
|
604
|
+
"""Creates a silence sound which plays simple silence."""
|
|
605
|
+
|
|
606
|
+
@classmethod
|
|
607
|
+
def sine(cls, frequency: float, rate: int) -> Sound:
|
|
608
|
+
"""Creates a sine sound which plays a sine wave."""
|
|
609
|
+
|
|
610
|
+
@classmethod
|
|
611
|
+
def square(cls, frequency: float, rate: int) -> Sound:
|
|
612
|
+
"""Creates a square sound which plays a square wave."""
|
|
613
|
+
|
|
614
|
+
def sum(self) -> Sound:
|
|
615
|
+
"""Sums the samples of a sound."""
|
|
616
|
+
|
|
617
|
+
def threshold(self, threshold: float = 0) -> Sound:
|
|
618
|
+
"""Makes a threshold wave out of an audio wave by setting all samples
|
|
619
|
+
with a amplitude >= threshold to 1, all <= -threshold to -1 and
|
|
620
|
+
all between to 0.
|
|
621
|
+
"""
|
|
622
|
+
|
|
623
|
+
@classmethod
|
|
624
|
+
def triangle(cls, frequency: float, rate: int) -> Sound:
|
|
625
|
+
"""Creates a triangle sound which plays a triangle wave."""
|
|
626
|
+
|
|
627
|
+
def volume(self, volume: float) -> Sound:
|
|
628
|
+
"""Changes the volume of a sound."""
|
|
629
|
+
|
|
630
|
+
def write(
|
|
631
|
+
self,
|
|
632
|
+
filename: str,
|
|
633
|
+
rate: int,
|
|
634
|
+
channels: int,
|
|
635
|
+
format: int,
|
|
636
|
+
container: int,
|
|
637
|
+
codec: int,
|
|
638
|
+
bitrate: int,
|
|
639
|
+
buffersize: int,
|
|
640
|
+
) -> None:
|
|
641
|
+
"""Writes the sound to a file."""
|
|
642
|
+
|
|
643
|
+
class Source:
|
|
644
|
+
"""The source object represents the source position of a binaural sound."""
|
|
645
|
+
|
|
646
|
+
azimuth: object
|
|
647
|
+
"""The azimuth angle."""
|
|
648
|
+
|
|
649
|
+
distance: object
|
|
650
|
+
"""The distance value. 0 is min, 1 is max."""
|
|
651
|
+
|
|
652
|
+
elevation: object
|
|
653
|
+
"""The elevation angle."""
|
|
654
|
+
|
|
655
|
+
class ThreadPool:
|
|
656
|
+
"""A ThreadPool is used to parallelize convolution efficiently."""
|
|
657
|
+
|
|
658
|
+
class error:
|
|
659
|
+
"""Common base class for all non-exit exceptions."""
|
aud/py.typed
ADDED
|
File without changes
|
bl_math/__init__.pyi
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Miscellaneous math utilities module"""
|
|
2
|
+
|
|
3
|
+
def clamp(value: float, min: float = 0, max: float = 1) -> float:
|
|
4
|
+
"""Clamps the float value between minimum and maximum. To avoid
|
|
5
|
+
confusion, any call must use either one or all three arguments.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
def lerp(from_value: float, to_value: float, factor: float) -> float:
|
|
9
|
+
"""Linearly interpolate between two float values based on factor."""
|
|
10
|
+
|
|
11
|
+
def smoothstep(from_value: float, to_value: float, value: object) -> float:
|
|
12
|
+
"""Performs smooth interpolation between 0 and 1 as value changes between from and to values.
|
|
13
|
+
Outside the range the function returns the same value as the nearest edge.
|
|
14
|
+
"""
|
bl_math/py.typed
ADDED
|
File without changes
|