fake-bpy-module 20240210__py3-none-any.whl → 20240326__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.
Potentially problematic release.
This version of fake-bpy-module might be problematic. Click here for more details.
- addon_utils/__init__.pyi +54 -11
- animsys_refactor/__init__.pyi +36 -7
- aud/__init__.pyi +307 -321
- bgl/__init__.pyi +2926 -865
- bl_app_override/__init__.pyi +14 -4
- bl_app_override/helpers/__init__.pyi +24 -3
- bl_app_template_utils/__init__.pyi +19 -5
- bl_console_utils/__init__.pyi +0 -1
- bl_console_utils/autocomplete/__init__.pyi +2 -3
- bl_console_utils/autocomplete/complete_calltip/__init__.pyi +24 -6
- bl_console_utils/autocomplete/complete_import/__init__.pyi +14 -4
- bl_console_utils/autocomplete/complete_namespace/__init__.pyi +24 -6
- bl_console_utils/autocomplete/intellisense/__init__.pyi +9 -3
- bl_i18n_utils/__init__.pyi +2 -3
- bl_i18n_utils/bl_extract_messages/__init__.pyi +74 -16
- bl_i18n_utils/merge_po/__init__.pyi +4 -2
- bl_i18n_utils/settings/__init__.pyi +53 -7
- bl_i18n_utils/utils/__init__.pyi +332 -45
- bl_i18n_utils/utils_cli/__init__.pyi +29 -7
- bl_i18n_utils/utils_languages_menu/__init__.pyi +4 -2
- bl_i18n_utils/utils_rtl/__init__.pyi +9 -3
- bl_keymap_utils/__init__.pyi +2 -3
- bl_keymap_utils/io/__init__.pyi +44 -10
- bl_keymap_utils/keymap_from_toolbar/__init__.pyi +4 -2
- bl_keymap_utils/keymap_hierarchy/__init__.pyi +4 -2
- bl_keymap_utils/platform_helpers/__init__.pyi +9 -3
- bl_keymap_utils/versioning/__init__.pyi +4 -2
- bl_math/__init__.pyi +21 -22
- bl_operators/__init__.pyi +30 -24
- bl_operators/add_mesh_torus/__init__.pyi +171 -38
- bl_operators/anim/__init__.pyi +1065 -227
- bl_operators/assets/__init__.pyi +427 -93
- bl_operators/bmesh/__init__.pyi +0 -1
- bl_operators/bmesh/find_adjacent/__init__.pyi +44 -10
- bl_operators/clip/__init__.pyi +1342 -288
- bl_operators/console/__init__.pyi +647 -141
- bl_operators/constraint/__init__.pyi +524 -113
- bl_operators/file/__init__.pyi +396 -85
- bl_operators/freestyle/__init__.pyi +532 -114
- bl_operators/geometry_nodes/__init__.pyi +2412 -597
- bl_operators/image/__init__.pyi +380 -83
- bl_operators/mesh/__init__.pyi +401 -86
- bl_operators/node/__init__.pyi +1756 -385
- bl_operators/object/__init__.pyi +2022 -553
- bl_operators/object_align/__init__.pyi +145 -32
- bl_operators/object_quick_effects/__init__.pyi +555 -125
- bl_operators/object_randomize_transform/__init__.pyi +136 -33
- bl_operators/presets/__init__.pyi +3516 -709
- bl_operators/rigidbody/__init__.pyi +401 -86
- bl_operators/screen_play_rendered_anim/__init__.pyi +129 -30
- bl_operators/sequencer/__init__.pyi +731 -150
- bl_operators/spreadsheet/__init__.pyi +145 -31
- bl_operators/userpref/__init__.pyi +3416 -825
- bl_operators/uvcalc_follow_active/__init__.pyi +149 -33
- bl_operators/uvcalc_lightmap/__init__.pyi +187 -35
- bl_operators/uvcalc_transform/__init__.pyi +344 -74
- bl_operators/vertexpaint_dirt/__init__.pyi +140 -31
- bl_operators/view3d/__init__.pyi +697 -147
- bl_operators/wm/__init__.pyi +6287 -1534
- bl_previews_utils/__init__.pyi +0 -1
- bl_previews_utils/bl_previews_render/__init__.pyi +34 -8
- bl_rna_utils/__init__.pyi +0 -1
- bl_rna_utils/data_path/__init__.pyi +12 -3
- bl_text_utils/__init__.pyi +0 -1
- bl_text_utils/external_editor/__init__.pyi +4 -2
- bl_ui/__init__.pyi +567 -170
- bl_ui/anim/__init__.pyi +164 -34
- bl_ui/asset_shelf/__init__.pyi +146 -32
- bl_ui/generic_ui_list/__init__.pyi +471 -100
- bl_ui/node_add_menu/__init__.pyi +196 -41
- bl_ui/node_add_menu_compositor/__init__.pyi +3017 -622
- bl_ui/node_add_menu_geometry/__init__.pyi +8075 -1592
- bl_ui/node_add_menu_shader/__init__.pyi +1709 -349
- bl_ui/node_add_menu_texture/__init__.pyi +1502 -306
- bl_ui/properties_animviz/__init__.pyi +32 -3
- bl_ui/properties_collection/__init__.pyi +787 -180
- bl_ui/properties_constraint/__init__.pyi +28635 -5524
- bl_ui/properties_data_armature/__init__.pyi +1905 -449
- bl_ui/properties_data_bone/__init__.pyi +1560 -337
- bl_ui/properties_data_camera/__init__.pyi +2269 -495
- bl_ui/properties_data_curve/__init__.pyi +2362 -535
- bl_ui/properties_data_curves/__init__.pyi +951 -204
- bl_ui/properties_data_empty/__init__.pyi +317 -70
- bl_ui/properties_data_gpencil/__init__.pyi +2924 -735
- bl_ui/properties_data_grease_pencil/__init__.pyi +1631 -189
- bl_ui/properties_data_lattice/__init__.pyi +472 -105
- bl_ui/properties_data_light/__init__.pyi +1570 -338
- bl_ui/properties_data_lightprobe/__init__.pyi +938 -209
- bl_ui/properties_data_mesh/__init__.pyi +3205 -768
- bl_ui/properties_data_metaball/__init__.pyi +774 -171
- bl_ui/properties_data_modifier/__init__.pyi +1554 -329
- bl_ui/properties_data_pointcloud/__init__.pyi +821 -195
- bl_ui/properties_data_shaderfx/__init__.pyi +154 -35
- bl_ui/properties_data_speaker/__init__.pyi +782 -169
- bl_ui/properties_data_volume/__init__.pyi +1243 -282
- bl_ui/properties_freestyle/__init__.pyi +4071 -1031
- bl_ui/properties_grease_pencil_common/__init__.pyi +2399 -484
- bl_ui/properties_mask_common/__init__.pyi +1256 -250
- bl_ui/properties_material/__init__.pyi +2351 -543
- bl_ui/properties_material_gpencil/__init__.pyi +1590 -366
- bl_ui/properties_object/__init__.pyi +2179 -513
- bl_ui/properties_output/__init__.pyi +2956 -706
- bl_ui/properties_paint_common/__init__.pyi +947 -141
- bl_ui/properties_particle/__init__.pyi +8322 -1971
- bl_ui/properties_physics_cloth/__init__.pyi +2254 -509
- bl_ui/properties_physics_common/__init__.pyi +200 -45
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +4454 -966
- bl_ui/properties_physics_field/__init__.pyi +1695 -365
- bl_ui/properties_physics_fluid/__init__.pyi +6127 -1281
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +157 -33
- bl_ui/properties_physics_rigidbody/__init__.pyi +1254 -279
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +2053 -484
- bl_ui/properties_physics_softbody/__init__.pyi +2394 -543
- bl_ui/properties_render/__init__.pyi +8312 -1934
- bl_ui/properties_scene/__init__.pyi +2211 -540
- bl_ui/properties_texture/__init__.pyi +4185 -1014
- bl_ui/properties_view_layer/__init__.pyi +2803 -665
- bl_ui/properties_workspace/__init__.pyi +626 -149
- bl_ui/properties_world/__init__.pyi +1092 -235
- bl_ui/space_clip/__init__.pyi +11475 -2806
- bl_ui/space_console/__init__.pyi +967 -203
- bl_ui/space_dopesheet/__init__.pyi +4260 -967
- bl_ui/space_filebrowser/__init__.pyi +4852 -1188
- bl_ui/space_graph/__init__.pyi +3251 -703
- bl_ui/space_image/__init__.pyi +12218 -2968
- bl_ui/space_info/__init__.pyi +964 -201
- bl_ui/space_nla/__init__.pyi +2756 -585
- bl_ui/space_node/__init__.pyi +5661 -1266
- bl_ui/space_outliner/__init__.pyi +2294 -479
- bl_ui/space_properties/__init__.pyi +417 -93
- bl_ui/space_sequencer/__init__.pyi +12436 -3010
- bl_ui/space_spreadsheet/__init__.pyi +184 -37
- bl_ui/space_statusbar/__init__.pyi +135 -31
- bl_ui/space_text/__init__.pyi +2556 -543
- bl_ui/space_time/__init__.pyi +1151 -244
- bl_ui/space_toolsystem_common/__init__.pyi +368 -67
- bl_ui/space_toolsystem_toolbar/__init__.pyi +1378 -229
- bl_ui/space_topbar/__init__.pyi +4214 -888
- bl_ui/space_userpref/__init__.pyi +13920 -3468
- bl_ui/space_view3d/__init__.pyi +42751 -9613
- bl_ui/space_view3d_toolbar/__init__.pyi +16379 -3860
- bl_ui/utils/__init__.pyi +42 -5
- bl_ui_utils/__init__.pyi +0 -1
- bl_ui_utils/bug_report_url/__init__.pyi +4 -2
- bl_ui_utils/layout/__init__.pyi +4 -2
- blend_render_info/__init__.pyi +13 -4
- blf/__init__.pyi +15 -18
- bmesh/__init__.pyi +18 -18
- bmesh/geometry/__init__.pyi +5 -6
- bmesh/ops/__init__.pyi +1337 -1158
- bmesh/types/__init__.pyi +464 -374
- bmesh/utils/__init__.pyi +64 -70
- bpy/__init__.pyi +6 -7
- bpy/app/__init__.pyi +36 -38
- bpy/app/handlers/__init__.pyi +37 -38
- bpy/app/icons/__init__.pyi +8 -11
- bpy/app/timers/__init__.pyi +18 -17
- bpy/app/translations/__init__.pyi +32 -30
- bpy/msgbus/__init__.pyi +25 -20
- bpy/ops/__init__.pyi +63 -64
- bpy/ops/action/__init__.pyi +408 -436
- bpy/ops/anim/__init__.pyi +459 -577
- bpy/ops/armature/__init__.pyi +396 -498
- bpy/ops/asset/__init__.pyi +187 -213
- bpy/ops/boid/__init__.pyi +50 -68
- bpy/ops/brush/__init__.pyi +72 -97
- bpy/ops/buttons/__init__.pyi +202 -193
- bpy/ops/cachefile/__init__.pyi +198 -188
- bpy/ops/camera/__init__.pyi +24 -31
- bpy/ops/clip/__init__.pyi +1021 -1082
- bpy/ops/cloth/__init__.pyi +11 -15
- bpy/ops/collection/__init__.pyi +36 -51
- bpy/ops/console/__init__.pyi +155 -209
- bpy/ops/constraint/__init__.pyi +286 -254
- bpy/ops/curve/__init__.pyi +597 -659
- bpy/ops/curves/__init__.pyi +191 -225
- bpy/ops/cycles/__init__.pyi +21 -30
- bpy/ops/dpaint/__init__.pyi +34 -47
- bpy/ops/ed/__init__.pyi +160 -176
- bpy/ops/export_anim/__init__.pyi +51 -34
- bpy/ops/export_mesh/__init__.pyi +47 -45
- bpy/ops/export_scene/__init__.pyi +659 -504
- bpy/ops/file/__init__.pyi +469 -474
- bpy/ops/fluid/__init__.pyi +89 -119
- bpy/ops/font/__init__.pyi +325 -361
- bpy/ops/geometry/__init__.pyi +86 -114
- bpy/ops/gizmogroup/__init__.pyi +22 -28
- bpy/ops/gpencil/__init__.pyi +1900 -1976
- bpy/ops/graph/__init__.pyi +875 -894
- bpy/ops/grease_pencil/__init__.pyi +572 -508
- bpy/ops/image/__init__.pyi +805 -855
- bpy/ops/import_anim/__init__.pyi +66 -46
- bpy/ops/import_curve/__init__.pyi +7 -11
- bpy/ops/import_mesh/__init__.pyi +19 -25
- bpy/ops/import_scene/__init__.pyi +164 -147
- bpy/ops/info/__init__.pyi +88 -85
- bpy/ops/lattice/__init__.pyi +86 -90
- bpy/ops/marker/__init__.pyi +135 -146
- bpy/ops/mask/__init__.pyi +372 -436
- bpy/ops/material/__init__.pyi +18 -25
- bpy/ops/mball/__init__.pyi +93 -99
- bpy/ops/mesh/__init__.pyi +2525 -2664
- bpy/ops/nla/__init__.pyi +398 -455
- bpy/ops/node/__init__.pyi +1015 -1207
- bpy/ops/object/__init__.pyi +3423 -3390
- bpy/ops/outliner/__init__.pyi +667 -685
- bpy/ops/paint/__init__.pyi +719 -672
- bpy/ops/paintcurve/__init__.pyi +64 -85
- bpy/ops/palette/__init__.pyi +48 -67
- bpy/ops/particle/__init__.pyi +323 -367
- bpy/ops/pose/__init__.pyi +569 -474
- bpy/ops/poselib/__init__.pyi +77 -100
- bpy/ops/preferences/__init__.pyi +460 -512
- bpy/ops/ptcache/__init__.pyi +46 -63
- bpy/ops/render/__init__.pyi +121 -155
- bpy/ops/rigidbody/__init__.pyi +148 -143
- bpy/ops/scene/__init__.pyi +336 -380
- bpy/ops/screen/__init__.pyi +454 -530
- bpy/ops/script/__init__.pyi +19 -28
- bpy/ops/sculpt/__init__.pyi +734 -587
- bpy/ops/sculpt_curves/__init__.pyi +51 -56
- bpy/ops/sequencer/__init__.pyi +1617 -1500
- bpy/ops/sound/__init__.pyi +392 -315
- bpy/ops/spreadsheet/__init__.pyi +31 -42
- bpy/ops/surface/__init__.pyi +198 -163
- bpy/ops/text/__init__.pyi +479 -545
- bpy/ops/text_editor/__init__.pyi +11 -15
- bpy/ops/texture/__init__.pyi +26 -36
- bpy/ops/transform/__init__.pyi +825 -941
- bpy/ops/ui/__init__.pyi +246 -295
- bpy/ops/uilist/__init__.pyi +34 -38
- bpy/ops/uv/__init__.pyi +912 -824
- bpy/ops/view2d/__init__.pyi +157 -197
- bpy/ops/view3d/__init__.pyi +777 -878
- bpy/ops/wm/__init__.pyi +4102 -3595
- bpy/ops/workspace/__init__.pyi +42 -58
- bpy/ops/world/__init__.pyi +6 -9
- bpy/path/__init__.pyi +166 -109
- bpy/props/__init__.pyi +478 -395
- bpy/types/__init__.pyi +87194 -81467
- bpy/utils/__init__.pyi +325 -169
- bpy/utils/previews/__init__.pyi +108 -21
- bpy/utils/units/__init__.pyi +37 -39
- bpy_extras/__init__.pyi +4 -9
- bpy_extras/anim_utils/__init__.pyi +25 -55
- bpy_extras/asset_utils/__init__.pyi +3 -13
- bpy_extras/id_map_utils/__init__.pyi +1 -4
- bpy_extras/image_utils/__init__.pyi +33 -23
- bpy_extras/io_utils/__init__.pyi +116 -66
- bpy_extras/keyconfig_utils/__init__.pyi +5 -3
- bpy_extras/mesh_utils/__init__.pyi +42 -34
- bpy_extras/node_utils/__init__.pyi +4 -4
- bpy_extras/object_utils/__init__.pyi +58 -43
- bpy_extras/view3d_utils/__init__.pyi +64 -63
- bpy_restrict_state/__init__.pyi +14 -2
- bpy_types/__init__.pyi +3873 -998
- console_python/__init__.pyi +41 -8
- console_shell/__init__.pyi +24 -6
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/METADATA +1 -1
- fake_bpy_module-20240326.dist-info/RECORD +343 -0
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/WHEEL +1 -1
- freestyle/__init__.pyi +4 -5
- freestyle/chainingiterators/__init__.pyi +229 -73
- freestyle/functions/__init__.pyi +624 -402
- freestyle/predicates/__init__.pyi +381 -169
- freestyle/shaders/__init__.pyi +424 -155
- freestyle/types/__init__.pyi +1572 -726
- freestyle/utils/ContextFunctions/__init__.pyi +54 -43
- freestyle/utils/__init__.pyi +67 -31
- gpu/__init__.pyi +3 -4
- gpu/capabilities/__init__.pyi +57 -37
- gpu/matrix/__init__.pyi +14 -17
- gpu/platform/__init__.pyi +5 -6
- gpu/select/__init__.pyi +2 -5
- gpu/shader/__init__.pyi +14 -12
- gpu/state/__init__.pyi +48 -62
- gpu/texture/__init__.pyi +7 -7
- gpu/types/__init__.pyi +670 -229
- gpu_extras/__init__.pyi +1 -2
- gpu_extras/batch/__init__.pyi +27 -6
- gpu_extras/presets/__init__.pyi +67 -27
- graphviz_export/__init__.pyi +9 -3
- idprop/__init__.pyi +0 -1
- idprop/types/__init__.pyi +42 -13
- imbuf/__init__.pyi +6 -10
- imbuf/types/__init__.pyi +8 -16
- keyingsets_builtins/__init__.pyi +3149 -702
- keyingsets_utils/__init__.pyi +69 -15
- mathutils/__init__.pyi +951 -876
- mathutils/bvhtree/__init__.pyi +47 -48
- mathutils/geometry/__init__.pyi +237 -242
- mathutils/interpolate/__init__.pyi +3 -6
- mathutils/kdtree/__init__.pyi +23 -26
- mathutils/noise/__init__.pyi +50 -51
- nodeitems_builtins/__init__.pyi +50 -11
- nodeitems_utils/__init__.pyi +58 -11
- rna_info/__init__.pyi +230 -27
- rna_keymap_ui/__init__.pyi +29 -7
- rna_prop_ui/__init__.pyi +69 -13
- rna_xml/__init__.pyi +29 -7
- sys_info/__init__.pyi +4 -2
- bpy_extras/bmesh_utils/__init__.pyi +0 -7
- bpy_extras/extensions/__init__.pyi +0 -5
- bpy_extras/extensions/junction_module/__init__.pyi +0 -13
- bpy_extras/node_shader_utils/__init__.pyi +0 -132
- bpy_extras/wm_utils/__init__.pyi +0 -5
- bpy_extras/wm_utils/progress_report/__init__.pyi +0 -30
- fake_bpy_module-20240210.dist-info/RECORD +0 -349
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/top_level.txt +0 -0
aud/__init__.pyi
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import sys
|
|
2
1
|
import typing
|
|
3
2
|
|
|
4
3
|
GenericType = typing.TypeVar("GenericType")
|
|
@@ -10,10 +9,11 @@ class Device:
|
|
|
10
9
|
""" The channel count of the device."""
|
|
11
10
|
|
|
12
11
|
distance_model: typing.Any
|
|
13
|
-
""" The distance model of the device."""
|
|
12
|
+
""" The distance model of the device.`OpenAL Documentation <https://www.openal.org/documentation/>`__"""
|
|
14
13
|
|
|
15
14
|
doppler_factor: typing.Any
|
|
16
|
-
""" The doppler factor of the device.
|
|
15
|
+
""" The doppler factor of the device.
|
|
16
|
+
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."""
|
|
17
17
|
|
|
18
18
|
format: typing.Any
|
|
19
19
|
""" The native sample format of the device."""
|
|
@@ -31,24 +31,31 @@ class Device:
|
|
|
31
31
|
""" The sampling rate of the device in Hz."""
|
|
32
32
|
|
|
33
33
|
speed_of_sound: typing.Any
|
|
34
|
-
""" The speed of sound of the device.
|
|
34
|
+
""" The speed of sound of the device.
|
|
35
|
+
The speed of sound in air is typically 343.3 m/s."""
|
|
35
36
|
|
|
36
37
|
volume: typing.Any
|
|
37
38
|
""" The overall volume of the device."""
|
|
38
39
|
|
|
39
40
|
def lock(self):
|
|
40
|
-
"""Locks the device so that it's guaranteed, that no samples are
|
|
41
|
+
"""Locks the device so that it's guaranteed, that no samples are
|
|
42
|
+
read from the streams until `unlock` is called.
|
|
43
|
+
This is useful if you want to do start/stop/pause/resume some
|
|
44
|
+
sounds at the same time.
|
|
45
|
+
|
|
46
|
+
"""
|
|
41
47
|
...
|
|
42
48
|
|
|
43
|
-
def play(self, sound:
|
|
49
|
+
def play(self, sound: Sound, keep: bool = False) -> bool:
|
|
44
50
|
"""Plays a sound.
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
:param sound: The sound to play.
|
|
53
|
+
:type sound: Sound
|
|
54
|
+
:param keep: See `Handle.keep`.
|
|
55
|
+
:type keep: bool
|
|
56
|
+
:return: The playback handle with which playback can be
|
|
57
|
+
controlled with.
|
|
58
|
+
:rtype: Handle
|
|
52
59
|
"""
|
|
53
60
|
...
|
|
54
61
|
|
|
@@ -57,11 +64,16 @@ class Device:
|
|
|
57
64
|
...
|
|
58
65
|
|
|
59
66
|
def unlock(self):
|
|
60
|
-
"""Unlocks the device after a lock call, see
|
|
67
|
+
"""Unlocks the device after a lock call, see `lock` for
|
|
68
|
+
details.
|
|
69
|
+
|
|
70
|
+
"""
|
|
61
71
|
...
|
|
62
72
|
|
|
63
73
|
class DynamicMusic:
|
|
64
|
-
"""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.
|
|
74
|
+
"""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.
|
|
75
|
+
The default transition is a crossfade effect, and the default scene is silent and has id 0
|
|
76
|
+
"""
|
|
65
77
|
|
|
66
78
|
fadeTime: typing.Any
|
|
67
79
|
""" The length in seconds of the crossfade transition"""
|
|
@@ -78,17 +90,17 @@ class DynamicMusic:
|
|
|
78
90
|
volume: typing.Any
|
|
79
91
|
""" The volume of the scene."""
|
|
80
92
|
|
|
81
|
-
def addScene(self, scene:
|
|
93
|
+
def addScene(self, scene: Sound) -> Sound:
|
|
82
94
|
"""Adds a new scene.
|
|
83
95
|
|
|
84
96
|
:param scene: The scene sound.
|
|
85
|
-
:type scene:
|
|
86
|
-
:rtype: int
|
|
97
|
+
:type scene: Sound
|
|
87
98
|
:return: The new scene id.
|
|
99
|
+
:rtype: int
|
|
88
100
|
"""
|
|
89
101
|
...
|
|
90
102
|
|
|
91
|
-
def addTransition(self, ini: int, end: int, transition:
|
|
103
|
+
def addTransition(self, ini: int, end: int, transition: Sound) -> Sound:
|
|
92
104
|
"""Adds a new scene.
|
|
93
105
|
|
|
94
106
|
:param ini: the initial scene foor the transition.
|
|
@@ -96,80 +108,74 @@ class DynamicMusic:
|
|
|
96
108
|
:param end: The final scene for the transition.
|
|
97
109
|
:type end: int
|
|
98
110
|
:param transition: The transition sound.
|
|
99
|
-
:type transition:
|
|
100
|
-
:rtype: bool
|
|
111
|
+
:type transition: Sound
|
|
101
112
|
:return: false if the ini or end scenes don't exist, true othrwise.
|
|
113
|
+
:rtype: bool
|
|
102
114
|
"""
|
|
103
115
|
...
|
|
104
116
|
|
|
105
117
|
def pause(self) -> bool:
|
|
106
118
|
"""Pauses playback of the scene.
|
|
107
119
|
|
|
108
|
-
:rtype: bool
|
|
109
120
|
:return: Whether the action succeeded.
|
|
121
|
+
:rtype: bool
|
|
110
122
|
"""
|
|
111
123
|
...
|
|
112
124
|
|
|
113
125
|
def resume(self) -> bool:
|
|
114
126
|
"""Resumes playback of the scene.
|
|
115
127
|
|
|
116
|
-
:rtype: bool
|
|
117
128
|
:return: Whether the action succeeded.
|
|
129
|
+
:rtype: bool
|
|
118
130
|
"""
|
|
119
131
|
...
|
|
120
132
|
|
|
121
133
|
def stop(self) -> bool:
|
|
122
134
|
"""Stops playback of the scene.
|
|
123
135
|
|
|
124
|
-
:rtype: bool
|
|
125
136
|
:return: Whether the action succeeded.
|
|
137
|
+
:rtype: bool
|
|
126
138
|
"""
|
|
127
139
|
...
|
|
128
140
|
|
|
129
141
|
class HRTF:
|
|
130
142
|
"""An HRTF object represents a set of head related transfer functions as impulse responses. It's used for binaural sound"""
|
|
131
143
|
|
|
132
|
-
def loadLeftHrtfSet(self, extension: str, directory
|
|
144
|
+
def loadLeftHrtfSet(self, extension: typing.Union[str, str], directory):
|
|
133
145
|
"""Loads all HRTFs from a directory.
|
|
134
146
|
|
|
135
147
|
:param extension: The file extension of the hrtfs.
|
|
136
|
-
:type extension: str
|
|
137
|
-
:param
|
|
138
|
-
:
|
|
139
|
-
:
|
|
140
|
-
:type directory: typing.Any
|
|
141
|
-
:rtype: 'HRTF'
|
|
142
|
-
:return: `HRTF` object.
|
|
148
|
+
:type extension: typing.Union[str, str]
|
|
149
|
+
:param directory: The path to where the HRTF files are located.
|
|
150
|
+
:return: The loaded `HRTF` object.
|
|
151
|
+
:rtype: HRTF
|
|
143
152
|
"""
|
|
144
153
|
...
|
|
145
154
|
|
|
146
|
-
def loadLeftHrtfSet(self, extension: str, directory
|
|
155
|
+
def loadLeftHrtfSet(self, extension: typing.Union[str, str], directory):
|
|
147
156
|
"""Loads all HRTFs from a directory.
|
|
148
157
|
|
|
149
158
|
:param extension: The file extension of the hrtfs.
|
|
150
|
-
:type extension: str
|
|
151
|
-
:param
|
|
152
|
-
:
|
|
153
|
-
:
|
|
154
|
-
:type directory: typing.Any
|
|
155
|
-
:rtype: 'HRTF'
|
|
156
|
-
:return: `HRTF` object.
|
|
159
|
+
:type extension: typing.Union[str, str]
|
|
160
|
+
:param directory: The path to where the HRTF files are located.
|
|
161
|
+
:return: The loaded `HRTF` object.
|
|
162
|
+
:rtype: HRTF
|
|
157
163
|
"""
|
|
158
164
|
...
|
|
159
165
|
|
|
160
166
|
def addImpulseResponseFromSound(
|
|
161
|
-
self, sound:
|
|
162
|
-
) ->
|
|
167
|
+
self, sound: Sound, azimuth: float, elevation: float
|
|
168
|
+
) -> float:
|
|
163
169
|
"""Adds a new hrtf to the HRTF object
|
|
164
170
|
|
|
165
171
|
:param sound: The sound that contains the hrtf.
|
|
166
|
-
:type sound:
|
|
172
|
+
:type sound: Sound
|
|
167
173
|
:param azimuth: The azimuth angle of the hrtf.
|
|
168
174
|
:type azimuth: float
|
|
169
175
|
:param elevation: The elevation angle of the hrtf.
|
|
170
176
|
:type elevation: float
|
|
171
|
-
:rtype: bool
|
|
172
177
|
:return: Whether the action succeeded.
|
|
178
|
+
:rtype: bool
|
|
173
179
|
"""
|
|
174
180
|
...
|
|
175
181
|
|
|
@@ -177,25 +183,29 @@ class Handle:
|
|
|
177
183
|
"""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."""
|
|
178
184
|
|
|
179
185
|
attenuation: typing.Any
|
|
180
|
-
""" This factor is used for distance based attenuation of the source."""
|
|
186
|
+
""" This factor is used for distance based attenuation of the source.:attr:`Device.distance_model`"""
|
|
181
187
|
|
|
182
188
|
cone_angle_inner: typing.Any
|
|
183
|
-
""" 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
|
|
189
|
+
""" 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 `location` of the source and with infinite height, heading in the direction of the source's `orientation`.
|
|
190
|
+
In the inner cone the volume is normal. Outside the outer cone the volume will be `cone_volume_outer` and in the area between the volume will be interpolated linearly."""
|
|
184
191
|
|
|
185
192
|
cone_angle_outer: typing.Any
|
|
186
|
-
""" The opening angle of the outer cone of the source
|
|
193
|
+
""" The opening angle of the outer cone of the source.:attr:`cone_angle_inner`"""
|
|
187
194
|
|
|
188
195
|
cone_volume_outer: typing.Any
|
|
189
|
-
""" The volume outside the outer cone of the source
|
|
196
|
+
""" The volume outside the outer cone of the source.:attr:`cone_angle_inner`"""
|
|
190
197
|
|
|
191
198
|
distance_maximum: typing.Any
|
|
192
|
-
""" The maximum distance of the source.
|
|
199
|
+
""" The maximum distance of the source.
|
|
200
|
+
If the listener is further away the source volume will be 0.:attr:`Device.distance_model`"""
|
|
193
201
|
|
|
194
202
|
distance_reference: typing.Any
|
|
195
|
-
""" The reference distance of the source.
|
|
203
|
+
""" The reference distance of the source.
|
|
204
|
+
At this distance the volume will be exactly `volume`.:attr:`Device.distance_model`"""
|
|
196
205
|
|
|
197
206
|
keep: typing.Any
|
|
198
|
-
""" Whether the sound should be kept paused in the device when its end is reached.
|
|
207
|
+
""" Whether the sound should be kept paused in the device when its end is reached.
|
|
208
|
+
This can be used to seek the sound to some position and start playback again."""
|
|
199
209
|
|
|
200
210
|
location: typing.Any
|
|
201
211
|
""" The source's location in 3D space, a 3D tuple of floats."""
|
|
@@ -225,32 +235,32 @@ class Handle:
|
|
|
225
235
|
""" The volume of the sound."""
|
|
226
236
|
|
|
227
237
|
volume_maximum: typing.Any
|
|
228
|
-
""" The maximum volume of the source."""
|
|
238
|
+
""" The maximum volume of the source.:attr:`Device.distance_model`"""
|
|
229
239
|
|
|
230
240
|
volume_minimum: typing.Any
|
|
231
|
-
""" The minimum volume of the source."""
|
|
241
|
+
""" The minimum volume of the source.:attr:`Device.distance_model`"""
|
|
232
242
|
|
|
233
|
-
def pause(self)
|
|
243
|
+
def pause(self):
|
|
234
244
|
"""Pauses playback.
|
|
235
245
|
|
|
236
|
-
:rtype: bool
|
|
237
246
|
:return: Whether the action succeeded.
|
|
247
|
+
:rtype: bool
|
|
238
248
|
"""
|
|
239
249
|
...
|
|
240
250
|
|
|
241
251
|
def resume(self) -> bool:
|
|
242
252
|
"""Resumes playback.
|
|
243
253
|
|
|
244
|
-
:rtype: bool
|
|
245
254
|
:return: Whether the action succeeded.
|
|
255
|
+
:rtype: bool
|
|
246
256
|
"""
|
|
247
257
|
...
|
|
248
258
|
|
|
249
259
|
def stop(self) -> bool:
|
|
250
260
|
"""Stops playback.
|
|
251
261
|
|
|
252
|
-
:rtype: bool
|
|
253
262
|
:return: Whether the action succeeded.
|
|
263
|
+
:rtype: bool
|
|
254
264
|
"""
|
|
255
265
|
...
|
|
256
266
|
|
|
@@ -262,13 +272,13 @@ class ImpulseResponse:
|
|
|
262
272
|
class PlaybackManager:
|
|
263
273
|
"""A PlabackManager object allows to easily control groups os sounds organized in categories."""
|
|
264
274
|
|
|
265
|
-
def addCategory(self, volume: float) ->
|
|
275
|
+
def addCategory(self, volume: float) -> float:
|
|
266
276
|
"""Adds a category with a custom volume.
|
|
267
277
|
|
|
268
278
|
:param volume: The volume for ther new category.
|
|
269
279
|
:type volume: float
|
|
270
|
-
:rtype: int
|
|
271
280
|
:return: The key of the new category.
|
|
281
|
+
:rtype: int
|
|
272
282
|
"""
|
|
273
283
|
...
|
|
274
284
|
|
|
@@ -276,45 +286,46 @@ class PlaybackManager:
|
|
|
276
286
|
"""Cleans all the invalid and finished sound from the playback manager."""
|
|
277
287
|
...
|
|
278
288
|
|
|
279
|
-
def getVolume(self, catKey: int) ->
|
|
289
|
+
def getVolume(self, catKey: int) -> int:
|
|
280
290
|
"""Retrieves the volume of a category.
|
|
281
291
|
|
|
282
292
|
:param catKey: the key of the category.
|
|
283
293
|
:type catKey: int
|
|
284
|
-
:rtype: float
|
|
285
294
|
:return: The volume of the cateogry.
|
|
295
|
+
:rtype: float
|
|
286
296
|
"""
|
|
287
297
|
...
|
|
288
298
|
|
|
289
|
-
def pause(self, catKey: int) ->
|
|
299
|
+
def pause(self, catKey: int) -> int:
|
|
290
300
|
"""Pauses playback of the category.
|
|
291
301
|
|
|
292
302
|
:param catKey: the key of the category.
|
|
293
303
|
:type catKey: int
|
|
294
|
-
:rtype: bool
|
|
295
304
|
:return: Whether the action succeeded.
|
|
305
|
+
:rtype: bool
|
|
296
306
|
"""
|
|
297
307
|
...
|
|
298
308
|
|
|
299
|
-
def play(self, sound:
|
|
309
|
+
def play(self, sound: Sound, catKey: int) -> int:
|
|
300
310
|
"""Plays a sound through the playback manager and assigns it to a category.
|
|
301
311
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
312
|
+
:param sound: The sound to play.
|
|
313
|
+
:type sound: Sound
|
|
314
|
+
:param catKey: the key of the category in which the sound will be added,
|
|
315
|
+
if it doesn't exist, a new one will be created.
|
|
316
|
+
:type catKey: int
|
|
317
|
+
:return: The playback handle with which playback can be controlled with.
|
|
318
|
+
:rtype: Handle
|
|
308
319
|
"""
|
|
309
320
|
...
|
|
310
321
|
|
|
311
|
-
def resume(self, catKey: int) ->
|
|
322
|
+
def resume(self, catKey: int) -> int:
|
|
312
323
|
"""Resumes playback of the catgory.
|
|
313
324
|
|
|
314
325
|
:param catKey: the key of the category.
|
|
315
326
|
:type catKey: int
|
|
316
|
-
:rtype: bool
|
|
317
327
|
:return: Whether the action succeeded.
|
|
328
|
+
:rtype: bool
|
|
318
329
|
"""
|
|
319
330
|
...
|
|
320
331
|
|
|
@@ -325,18 +336,18 @@ class PlaybackManager:
|
|
|
325
336
|
:type volume: float
|
|
326
337
|
:param catKey: the key of the category.
|
|
327
338
|
:type catKey: int
|
|
328
|
-
:rtype: int
|
|
329
339
|
:return: Whether the action succeeded.
|
|
340
|
+
:rtype: int
|
|
330
341
|
"""
|
|
331
342
|
...
|
|
332
343
|
|
|
333
|
-
def stop(self, catKey: int) ->
|
|
344
|
+
def stop(self, catKey: int) -> int:
|
|
334
345
|
"""Stops playback of the category.
|
|
335
346
|
|
|
336
347
|
:param catKey: the key of the category.
|
|
337
348
|
:type catKey: int
|
|
338
|
-
:rtype: bool
|
|
339
349
|
:return: Whether the action succeeded.
|
|
350
|
+
:rtype: bool
|
|
340
351
|
"""
|
|
341
352
|
...
|
|
342
353
|
|
|
@@ -347,10 +358,11 @@ class Sequence:
|
|
|
347
358
|
""" The channel count of the sequence."""
|
|
348
359
|
|
|
349
360
|
distance_model: typing.Any
|
|
350
|
-
""" The distance model of the sequence."""
|
|
361
|
+
""" The distance model of the sequence.`OpenAL Documentation <https://www.openal.org/documentation/>`__"""
|
|
351
362
|
|
|
352
363
|
doppler_factor: typing.Any
|
|
353
|
-
""" The doppler factor of the sequence.
|
|
364
|
+
""" The doppler factor of the sequence.
|
|
365
|
+
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."""
|
|
354
366
|
|
|
355
367
|
fps: typing.Any
|
|
356
368
|
""" The listeners's location in 3D space, a 3D tuple of floats."""
|
|
@@ -362,66 +374,48 @@ class Sequence:
|
|
|
362
374
|
""" The sampling rate of the sequence in Hz."""
|
|
363
375
|
|
|
364
376
|
speed_of_sound: typing.Any
|
|
365
|
-
""" The speed of sound of the sequence.
|
|
377
|
+
""" The speed of sound of the sequence.
|
|
378
|
+
The speed of sound in air is typically 343.3 m/s."""
|
|
366
379
|
|
|
367
|
-
def add(self)
|
|
380
|
+
def add(self):
|
|
368
381
|
"""Adds a new entry to the sequence.
|
|
369
382
|
|
|
370
|
-
:param sound: The sound this entry should play.
|
|
371
|
-
:type sound: 'Sound'
|
|
372
|
-
:param begin: The start time.
|
|
373
|
-
:type begin: float
|
|
374
|
-
:param end: The end time or a negative value if determined by the sound.
|
|
375
|
-
:type end: float
|
|
376
|
-
:param skip: How much seconds should be skipped at the beginning.
|
|
377
|
-
:type skip: float
|
|
378
|
-
:rtype: 'SequenceEntry'
|
|
379
383
|
:return: The entry added.
|
|
384
|
+
:rtype: SequenceEntry
|
|
380
385
|
"""
|
|
381
386
|
...
|
|
382
387
|
|
|
383
388
|
def remove(self):
|
|
384
|
-
"""Removes an entry from the sequence.
|
|
385
|
-
|
|
386
|
-
:param entry: The entry to remove.
|
|
387
|
-
:type entry: 'SequenceEntry'
|
|
388
|
-
"""
|
|
389
|
+
"""Removes an entry from the sequence."""
|
|
389
390
|
...
|
|
390
391
|
|
|
391
392
|
def setAnimationData(self):
|
|
392
|
-
"""Writes animation data to a sequence.
|
|
393
|
-
|
|
394
|
-
:param type: The type of animation data.
|
|
395
|
-
:type type: int
|
|
396
|
-
:param frame: The frame this data is for.
|
|
397
|
-
:type frame: int
|
|
398
|
-
:param data: The data to write.
|
|
399
|
-
:type data: typing.List[float]
|
|
400
|
-
:param animated: Whether the attribute is animated.
|
|
401
|
-
:type animated: bool
|
|
402
|
-
"""
|
|
393
|
+
"""Writes animation data to a sequence."""
|
|
403
394
|
...
|
|
404
395
|
|
|
405
396
|
class SequenceEntry:
|
|
406
397
|
"""SequenceEntry objects represent an entry of a sequenced sound."""
|
|
407
398
|
|
|
408
399
|
attenuation: typing.Any
|
|
409
|
-
""" This factor is used for distance based attenuation of the source."""
|
|
400
|
+
""" This factor is used for distance based attenuation of the source.:attr:`Device.distance_model`"""
|
|
410
401
|
|
|
411
402
|
cone_angle_inner: typing.Any
|
|
412
|
-
""" 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
|
|
403
|
+
""" 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 `location` of the source and with infinite height, heading in the direction of the source's `orientation`.
|
|
404
|
+
In the inner cone the volume is normal. Outside the outer cone the volume will be `cone_volume_outer` and in the area between the volume will be interpolated linearly."""
|
|
413
405
|
|
|
414
406
|
cone_angle_outer: typing.Any
|
|
415
|
-
""" The opening angle of the outer cone of the source
|
|
407
|
+
""" The opening angle of the outer cone of the source.:attr:`cone_angle_inner`"""
|
|
416
408
|
|
|
417
409
|
cone_volume_outer: typing.Any
|
|
418
|
-
""" The volume outside the outer cone of the source
|
|
410
|
+
""" The volume outside the outer cone of the source.:attr:`cone_angle_inner`"""
|
|
419
411
|
|
|
420
412
|
distance_maximum: typing.Any
|
|
421
|
-
""" The maximum distance of the source.
|
|
413
|
+
""" The maximum distance of the source.
|
|
414
|
+
If the listener is further away the source volume will be 0.:attr:`Device.distance_model`"""
|
|
422
415
|
|
|
423
416
|
distance_reference: typing.Any
|
|
424
|
-
""" The reference distance of the source.
|
|
417
|
+
""" The reference distance of the source.
|
|
418
|
+
At this distance the volume will be exactly `volume`.:attr:`Device.distance_model`"""
|
|
425
419
|
|
|
426
420
|
muted: typing.Any
|
|
427
421
|
""" Whether the entry is muted."""
|
|
@@ -433,35 +427,17 @@ class SequenceEntry:
|
|
|
433
427
|
""" The sound the entry is representing and will be played in the sequence."""
|
|
434
428
|
|
|
435
429
|
volume_maximum: typing.Any
|
|
436
|
-
""" The maximum volume of the source."""
|
|
430
|
+
""" The maximum volume of the source.:attr:`Device.distance_model`"""
|
|
437
431
|
|
|
438
432
|
volume_minimum: typing.Any
|
|
439
|
-
""" The minimum volume of the source."""
|
|
433
|
+
""" The minimum volume of the source.:attr:`Device.distance_model`"""
|
|
440
434
|
|
|
441
435
|
def move(self):
|
|
442
|
-
"""Moves the entry.
|
|
443
|
-
|
|
444
|
-
:param begin: The new start time.
|
|
445
|
-
:type begin: float
|
|
446
|
-
:param end: The new end time or a negative value if unknown.
|
|
447
|
-
:type end: float
|
|
448
|
-
:param skip: How many seconds to skip at the beginning.
|
|
449
|
-
:type skip: float
|
|
450
|
-
"""
|
|
436
|
+
"""Moves the entry."""
|
|
451
437
|
...
|
|
452
438
|
|
|
453
439
|
def setAnimationData(self):
|
|
454
|
-
"""Writes animation data to a sequenced entry.
|
|
455
|
-
|
|
456
|
-
:param type: The type of animation data.
|
|
457
|
-
:type type: int
|
|
458
|
-
:param frame: The frame this data is for.
|
|
459
|
-
:type frame: int
|
|
460
|
-
:param data: The data to write.
|
|
461
|
-
:type data: typing.List[float]
|
|
462
|
-
:param animated: Whether the attribute is animated.
|
|
463
|
-
:type animated: bool
|
|
464
|
-
"""
|
|
440
|
+
"""Writes animation data to a sequenced entry."""
|
|
465
441
|
...
|
|
466
442
|
|
|
467
443
|
class Sound:
|
|
@@ -474,198 +450,190 @@ class Sound:
|
|
|
474
450
|
""" The sample specification of the sound as a tuple with rate and channel count."""
|
|
475
451
|
|
|
476
452
|
@classmethod
|
|
477
|
-
def buffer(cls, data
|
|
453
|
+
def buffer(cls, data, rate: float) -> float:
|
|
478
454
|
"""Creates a sound from a data buffer.
|
|
479
455
|
|
|
480
456
|
:param data: The data as two dimensional numpy array.
|
|
481
|
-
:type data: typing.Any
|
|
482
457
|
:param rate: The sample rate.
|
|
483
458
|
:type rate: float
|
|
484
|
-
:
|
|
485
|
-
:
|
|
459
|
+
:return: The created `Sound` object.
|
|
460
|
+
:rtype: Sound
|
|
486
461
|
"""
|
|
487
462
|
...
|
|
488
463
|
|
|
489
464
|
@classmethod
|
|
490
|
-
def file(cls, filename: str) ->
|
|
465
|
+
def file(cls, filename: str) -> str:
|
|
491
466
|
"""Creates a sound object of a sound file.
|
|
492
467
|
|
|
493
468
|
:param filename: Path of the file.
|
|
494
469
|
:type filename: str
|
|
495
|
-
:
|
|
496
|
-
:
|
|
470
|
+
:return: The created `Sound` object.
|
|
471
|
+
:rtype: Sound
|
|
497
472
|
"""
|
|
498
473
|
...
|
|
499
474
|
|
|
500
475
|
@classmethod
|
|
501
|
-
def list(cls) ->
|
|
476
|
+
def list(cls) -> Sound:
|
|
502
477
|
"""Creates an empty sound list that can contain several sounds.
|
|
503
478
|
|
|
504
|
-
:
|
|
505
|
-
:
|
|
506
|
-
:rtype: 'Sound'
|
|
507
|
-
:return: `Sound` object.
|
|
479
|
+
:return: The created `Sound` object.
|
|
480
|
+
:rtype: Sound
|
|
508
481
|
"""
|
|
509
482
|
...
|
|
510
483
|
|
|
511
484
|
@classmethod
|
|
512
|
-
def sawtooth(cls, frequency: float, rate: int = 48000) ->
|
|
485
|
+
def sawtooth(cls, frequency: float, rate: int = 48000) -> int:
|
|
513
486
|
"""Creates a sawtooth sound which plays a sawtooth wave.
|
|
514
487
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
488
|
+
:param frequency: The frequency of the sawtooth wave in Hz.
|
|
489
|
+
:type frequency: float
|
|
490
|
+
:param rate: The sampling rate in Hz. It's recommended to set this
|
|
491
|
+
value to the playback device's samling rate to avoid resamping.
|
|
492
|
+
:type rate: int
|
|
493
|
+
:return: The created `Sound` object.
|
|
494
|
+
:rtype: Sound
|
|
521
495
|
"""
|
|
522
496
|
...
|
|
523
497
|
|
|
524
498
|
@classmethod
|
|
525
|
-
def silence(cls, rate: int = 48000) ->
|
|
499
|
+
def silence(cls, rate: int = 48000) -> int:
|
|
526
500
|
"""Creates a silence sound which plays simple silence.
|
|
527
501
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
502
|
+
:param rate: The sampling rate in Hz. It's recommended to set this
|
|
503
|
+
value to the playback device's samling rate to avoid resamping.
|
|
504
|
+
:type rate: int
|
|
505
|
+
:return: The created `Sound` object.
|
|
506
|
+
:rtype: Sound
|
|
532
507
|
"""
|
|
533
508
|
...
|
|
534
509
|
|
|
535
510
|
@classmethod
|
|
536
|
-
def sine(cls, frequency: float, rate: int = 48000) ->
|
|
511
|
+
def sine(cls, frequency: float, rate: int = 48000) -> int:
|
|
537
512
|
"""Creates a sine sound which plays a sine wave.
|
|
538
513
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
514
|
+
:param frequency: The frequency of the sine wave in Hz.
|
|
515
|
+
:type frequency: float
|
|
516
|
+
:param rate: The sampling rate in Hz. It's recommended to set this
|
|
517
|
+
value to the playback device's samling rate to avoid resamping.
|
|
518
|
+
:type rate: int
|
|
519
|
+
:return: The created `Sound` object.
|
|
520
|
+
:rtype: Sound
|
|
545
521
|
"""
|
|
546
522
|
...
|
|
547
523
|
|
|
548
524
|
@classmethod
|
|
549
|
-
def square(cls, frequency: float, rate: int = 48000) ->
|
|
525
|
+
def square(cls, frequency: float, rate: int = 48000) -> int:
|
|
550
526
|
"""Creates a square sound which plays a square wave.
|
|
551
527
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
528
|
+
:param frequency: The frequency of the square wave in Hz.
|
|
529
|
+
:type frequency: float
|
|
530
|
+
:param rate: The sampling rate in Hz. It's recommended to set this
|
|
531
|
+
value to the playback device's samling rate to avoid resamping.
|
|
532
|
+
:type rate: int
|
|
533
|
+
:return: The created `Sound` object.
|
|
534
|
+
:rtype: Sound
|
|
558
535
|
"""
|
|
559
536
|
...
|
|
560
537
|
|
|
561
538
|
@classmethod
|
|
562
|
-
def triangle(cls, frequency: float, rate: int = 48000) ->
|
|
539
|
+
def triangle(cls, frequency: float, rate: int = 48000) -> int:
|
|
563
540
|
"""Creates a triangle sound which plays a triangle wave.
|
|
564
541
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
542
|
+
:param frequency: The frequency of the triangle wave in Hz.
|
|
543
|
+
:type frequency: float
|
|
544
|
+
:param rate: The sampling rate in Hz. It's recommended to set this
|
|
545
|
+
value to the playback device's samling rate to avoid resamping.
|
|
546
|
+
:type rate: int
|
|
547
|
+
:return: The created `Sound` object.
|
|
548
|
+
:rtype: Sound
|
|
571
549
|
"""
|
|
572
550
|
...
|
|
573
551
|
|
|
574
552
|
def ADSR(
|
|
575
553
|
self, attack: float, decay: float, sustain: float, release: float
|
|
576
|
-
) ->
|
|
577
|
-
"""Attack-Decay-Sustain-Release envelopes the volume of a sound.
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
554
|
+
) -> float:
|
|
555
|
+
"""Attack-Decay-Sustain-Release envelopes the volume of a sound.
|
|
556
|
+
Note: there is currently no way to trigger the release with this API.
|
|
557
|
+
|
|
558
|
+
:param attack: The attack time in seconds.
|
|
559
|
+
:type attack: float
|
|
560
|
+
:param decay: The decay time in seconds.
|
|
561
|
+
:type decay: float
|
|
562
|
+
:param sustain: The sustain level.
|
|
563
|
+
:type sustain: float
|
|
564
|
+
:param release: The release level.
|
|
565
|
+
:type release: float
|
|
566
|
+
:return: The created `Sound` object.
|
|
567
|
+
:rtype: Sound
|
|
589
568
|
"""
|
|
590
569
|
...
|
|
591
570
|
|
|
592
|
-
def accumulate(self, additive
|
|
593
|
-
"""Accumulates a sound by summing over positive input
|
|
571
|
+
def accumulate(self, additive=False):
|
|
572
|
+
"""Accumulates a sound by summing over positive input
|
|
573
|
+
differences thus generating a monotonic sigal.
|
|
574
|
+
If additivity is set to true negative input differences get added too,
|
|
575
|
+
but positive ones with a factor of two.Note that with additivity the signal is not monotonic anymore.
|
|
594
576
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
:type additive: typing.Any
|
|
599
|
-
:rtype: 'Sound'
|
|
600
|
-
:return: `Sound` object.
|
|
577
|
+
:param additive: Whether the accumulation should be additive or not.
|
|
578
|
+
:return: The created `Sound` object.
|
|
579
|
+
:rtype: Sound
|
|
601
580
|
"""
|
|
602
581
|
...
|
|
603
582
|
|
|
604
|
-
def addSound(self, sound:
|
|
583
|
+
def addSound(self, sound: Sound):
|
|
605
584
|
"""Adds a new sound to a sound list.
|
|
606
585
|
|
|
607
586
|
:param sound: The sound that will be added to the list.
|
|
608
|
-
:type sound:
|
|
587
|
+
:type sound: Sound
|
|
609
588
|
"""
|
|
610
589
|
...
|
|
611
590
|
|
|
612
|
-
def binaural(self) ->
|
|
591
|
+
def binaural(self) -> Sound:
|
|
613
592
|
"""Creates a binaural sound using another sound as source. The original sound must be mono
|
|
614
593
|
|
|
615
|
-
:
|
|
616
|
-
:
|
|
617
|
-
:param source: An object representing the source position of the sound.
|
|
618
|
-
:type source: 'Source'
|
|
619
|
-
:param threadPool: A thread pool used to parallelize convolution.
|
|
620
|
-
:type threadPool: 'ThreadPool'
|
|
621
|
-
:param hrtfs: An HRTF set.
|
|
622
|
-
:type hrtfs: typing.Any
|
|
623
|
-
:rtype: 'Sound'
|
|
624
|
-
:return: `Sound` object.
|
|
594
|
+
:return: The created `Sound` object.
|
|
595
|
+
:rtype: Sound
|
|
625
596
|
"""
|
|
626
597
|
...
|
|
627
598
|
|
|
628
|
-
def cache(self) ->
|
|
629
|
-
"""Caches a sound into RAM.
|
|
599
|
+
def cache(self) -> Sound:
|
|
600
|
+
"""Caches a sound into RAM.This saves CPU usage needed for decoding and file access if the
|
|
601
|
+
underlying sound reads from a file on the harddisk,
|
|
602
|
+
but it consumes a lot of memory.
|
|
630
603
|
|
|
631
|
-
|
|
632
|
-
|
|
604
|
+
:return: The created `Sound` object.
|
|
605
|
+
:rtype: Sound
|
|
633
606
|
"""
|
|
634
607
|
...
|
|
635
608
|
|
|
636
|
-
def convolver(self) ->
|
|
609
|
+
def convolver(self) -> Sound:
|
|
637
610
|
"""Creates a sound that will apply convolution to another sound.
|
|
638
611
|
|
|
639
|
-
:
|
|
640
|
-
:
|
|
641
|
-
:param threadPool: A thread pool used to parallelize convolution.
|
|
642
|
-
:type threadPool: 'ThreadPool'
|
|
643
|
-
:rtype: 'Sound'
|
|
644
|
-
:return: `Sound` object.
|
|
612
|
+
:return: The created `Sound` object.
|
|
613
|
+
:rtype: Sound
|
|
645
614
|
"""
|
|
646
615
|
...
|
|
647
616
|
|
|
648
|
-
def data(self) ->
|
|
617
|
+
def data(self) -> Sound:
|
|
649
618
|
"""Retrieves the data of the sound as numpy array.
|
|
650
619
|
|
|
651
|
-
:rtype: typing.Any
|
|
652
620
|
:return: A two dimensional numpy float array.
|
|
653
621
|
"""
|
|
654
622
|
...
|
|
655
623
|
|
|
656
|
-
def delay(self, time: float) ->
|
|
624
|
+
def delay(self, time: float) -> float:
|
|
657
625
|
"""Delays by playing adding silence in front of the other sound's data.
|
|
658
626
|
|
|
659
627
|
:param time: How many seconds of silence should be added before the sound.
|
|
660
628
|
:type time: float
|
|
661
|
-
:
|
|
662
|
-
:
|
|
629
|
+
:return: The created `Sound` object.
|
|
630
|
+
:rtype: Sound
|
|
663
631
|
"""
|
|
664
632
|
...
|
|
665
633
|
|
|
666
634
|
def envelope(
|
|
667
635
|
self, attack: float, release: float, threshold: float, arthreshold: float
|
|
668
|
-
) ->
|
|
636
|
+
) -> float:
|
|
669
637
|
"""Delays by playing adding silence in front of the other sound's data.
|
|
670
638
|
|
|
671
639
|
:param attack: The attack factor.
|
|
@@ -676,204 +644,219 @@ class Sound:
|
|
|
676
644
|
:type threshold: float
|
|
677
645
|
:param arthreshold: The attack/release threshold value.
|
|
678
646
|
:type arthreshold: float
|
|
679
|
-
:
|
|
680
|
-
:
|
|
647
|
+
:return: The created `Sound` object.
|
|
648
|
+
:rtype: Sound
|
|
681
649
|
"""
|
|
682
650
|
...
|
|
683
651
|
|
|
684
|
-
def fadein(self, start: float, length: float) ->
|
|
685
|
-
"""Fades a sound in by raising the volume linearly in the given
|
|
652
|
+
def fadein(self, start: float, length: float) -> float:
|
|
653
|
+
"""Fades a sound in by raising the volume linearly in the given
|
|
654
|
+
time interval.
|
|
686
655
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
656
|
+
:param start: Time in seconds when the fading should start.
|
|
657
|
+
:type start: float
|
|
658
|
+
:param length: Time in seconds how long the fading should last.
|
|
659
|
+
:type length: float
|
|
660
|
+
:return: The created `Sound` object.
|
|
661
|
+
:rtype: Sound
|
|
693
662
|
"""
|
|
694
663
|
...
|
|
695
664
|
|
|
696
|
-
def fadeout(self, start: float, length: float) ->
|
|
697
|
-
"""Fades a sound in by lowering the volume linearly in the given
|
|
665
|
+
def fadeout(self, start: float, length: float) -> float:
|
|
666
|
+
"""Fades a sound in by lowering the volume linearly in the given
|
|
667
|
+
time interval.
|
|
698
668
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
669
|
+
:param start: Time in seconds when the fading should start.
|
|
670
|
+
:type start: float
|
|
671
|
+
:param length: Time in seconds how long the fading should last.
|
|
672
|
+
:type length: float
|
|
673
|
+
:return: The created `Sound` object.
|
|
674
|
+
:rtype: Sound
|
|
705
675
|
"""
|
|
706
676
|
...
|
|
707
677
|
|
|
708
|
-
def filter(
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
678
|
+
def filter(
|
|
679
|
+
self, b: typing.List[float], a: typing.List[float] = 1
|
|
680
|
+
) -> typing.List[float]:
|
|
681
|
+
"""Filters a sound with the supplied IIR filter coefficients.
|
|
682
|
+
Without the second parameter you'll get a FIR filter.If the first value of the a sequence is 0,
|
|
683
|
+
it will be set to 1 automatically.
|
|
684
|
+
If the first value of the a sequence is neither 0 nor 1, all
|
|
685
|
+
filter coefficients will be scaled by this value so that it is 1
|
|
686
|
+
in the end, you don't have to scale yourself.
|
|
687
|
+
|
|
688
|
+
:param b: The nominator filter coefficients.
|
|
689
|
+
:type b: typing.List[float]
|
|
690
|
+
:param a: The denominator filter coefficients.
|
|
691
|
+
:type a: typing.List[float]
|
|
692
|
+
:return: The created `Sound` object.
|
|
693
|
+
:rtype: Sound
|
|
717
694
|
"""
|
|
718
695
|
...
|
|
719
696
|
|
|
720
|
-
def highpass(self, frequency: float, Q: float = 0.5) ->
|
|
721
|
-
"""Creates a second order highpass filter based on the transfer
|
|
697
|
+
def highpass(self, frequency: float, Q: float = 0.5) -> float:
|
|
698
|
+
"""Creates a second order highpass filter based on the transfer
|
|
699
|
+
function H(s) = s^2 / (s^2 + s/Q + 1)
|
|
722
700
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
701
|
+
:param frequency: The cut off trequency of the highpass.
|
|
702
|
+
:type frequency: float
|
|
703
|
+
:param Q: Q factor of the lowpass.
|
|
704
|
+
:type Q: float
|
|
705
|
+
:return: The created `Sound` object.
|
|
706
|
+
:rtype: Sound
|
|
729
707
|
"""
|
|
730
708
|
...
|
|
731
709
|
|
|
732
|
-
def join(self, sound:
|
|
710
|
+
def join(self, sound: Sound) -> Sound:
|
|
733
711
|
"""Plays two factories in sequence.
|
|
734
712
|
|
|
735
713
|
:param sound: The sound to play second.
|
|
736
|
-
:type sound:
|
|
737
|
-
:
|
|
738
|
-
:
|
|
714
|
+
:type sound: Sound
|
|
715
|
+
:return: The created `Sound` object.
|
|
716
|
+
:rtype: Sound
|
|
739
717
|
"""
|
|
740
718
|
...
|
|
741
719
|
|
|
742
|
-
def limit(self, start: float, end: float) ->
|
|
720
|
+
def limit(self, start: float, end: float) -> float:
|
|
743
721
|
"""Limits a sound within a specific start and end time.
|
|
744
722
|
|
|
745
723
|
:param start: Start time in seconds.
|
|
746
724
|
:type start: float
|
|
747
725
|
:param end: End time in seconds.
|
|
748
726
|
:type end: float
|
|
749
|
-
:
|
|
750
|
-
:
|
|
727
|
+
:return: The created `Sound` object.
|
|
728
|
+
:rtype: Sound
|
|
751
729
|
"""
|
|
752
730
|
...
|
|
753
731
|
|
|
754
|
-
def loop(self, count
|
|
732
|
+
def loop(self, count):
|
|
755
733
|
"""Loops a sound.
|
|
756
734
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
735
|
+
:param count: How often the sound should be looped.
|
|
736
|
+
Negative values mean endlessly.
|
|
737
|
+
:return: The created `Sound` object.
|
|
738
|
+
:rtype: Sound
|
|
761
739
|
"""
|
|
762
740
|
...
|
|
763
741
|
|
|
764
|
-
def lowpass(self, frequency: float, Q: float = 0.5) ->
|
|
765
|
-
"""Creates a second order lowpass filter based on the transfer
|
|
742
|
+
def lowpass(self, frequency: float, Q: float = 0.5) -> float:
|
|
743
|
+
"""Creates a second order lowpass filter based on the transfer function H(s) = 1 / (s^2 + s/Q + 1)
|
|
766
744
|
|
|
767
745
|
:param frequency: The cut off trequency of the lowpass.
|
|
768
746
|
:type frequency: float
|
|
769
747
|
:param Q: Q factor of the lowpass.
|
|
770
748
|
:type Q: float
|
|
771
|
-
:
|
|
772
|
-
:
|
|
749
|
+
:return: The created `Sound` object.
|
|
750
|
+
:rtype: Sound
|
|
773
751
|
"""
|
|
774
752
|
...
|
|
775
753
|
|
|
776
|
-
def mix(self, sound:
|
|
754
|
+
def mix(self, sound: Sound) -> Sound:
|
|
777
755
|
"""Mixes two factories.
|
|
778
756
|
|
|
779
757
|
:param sound: The sound to mix over the other.
|
|
780
|
-
:type sound:
|
|
781
|
-
:
|
|
782
|
-
:
|
|
758
|
+
:type sound: Sound
|
|
759
|
+
:return: The created `Sound` object.
|
|
760
|
+
:rtype: Sound
|
|
783
761
|
"""
|
|
784
762
|
...
|
|
785
763
|
|
|
786
|
-
def modulate(self, sound:
|
|
764
|
+
def modulate(self, sound: Sound) -> Sound:
|
|
787
765
|
"""Modulates two factories.
|
|
788
766
|
|
|
789
767
|
:param sound: The sound to modulate over the other.
|
|
790
|
-
:type sound:
|
|
791
|
-
:
|
|
792
|
-
:
|
|
768
|
+
:type sound: Sound
|
|
769
|
+
:return: The created `Sound` object.
|
|
770
|
+
:rtype: Sound
|
|
793
771
|
"""
|
|
794
772
|
...
|
|
795
773
|
|
|
796
|
-
def mutable(self) ->
|
|
797
|
-
"""Creates a sound that will be restarted when sought backwards.
|
|
774
|
+
def mutable(self) -> Sound:
|
|
775
|
+
"""Creates a sound that will be restarted when sought backwards.
|
|
776
|
+
If the original sound is a sound list, the playing sound can change.
|
|
798
777
|
|
|
799
|
-
|
|
800
|
-
|
|
778
|
+
:return: The created `Sound` object.
|
|
779
|
+
:rtype: Sound
|
|
801
780
|
"""
|
|
802
781
|
...
|
|
803
782
|
|
|
804
|
-
def pingpong(self) ->
|
|
805
|
-
"""Plays a sound forward and then backward.
|
|
783
|
+
def pingpong(self) -> Sound:
|
|
784
|
+
"""Plays a sound forward and then backward.
|
|
785
|
+
This is like joining a sound with its reverse.
|
|
806
786
|
|
|
807
|
-
|
|
808
|
-
|
|
787
|
+
:return: The created `Sound` object.
|
|
788
|
+
:rtype: Sound
|
|
809
789
|
"""
|
|
810
790
|
...
|
|
811
791
|
|
|
812
|
-
def pitch(self, factor: float) ->
|
|
792
|
+
def pitch(self, factor: float) -> float:
|
|
813
793
|
"""Changes the pitch of a sound with a specific factor.
|
|
814
794
|
|
|
815
795
|
:param factor: The factor to change the pitch with.
|
|
816
796
|
:type factor: float
|
|
817
|
-
:
|
|
818
|
-
:
|
|
797
|
+
:return: The created `Sound` object.
|
|
798
|
+
:rtype: Sound
|
|
819
799
|
"""
|
|
820
800
|
...
|
|
821
801
|
|
|
822
|
-
def rechannel(self, channels: int) ->
|
|
802
|
+
def rechannel(self, channels: int) -> int:
|
|
823
803
|
"""Rechannels the sound.
|
|
824
804
|
|
|
825
805
|
:param channels: The new channel configuration.
|
|
826
806
|
:type channels: int
|
|
827
|
-
:
|
|
828
|
-
:
|
|
807
|
+
:return: The created `Sound` object.
|
|
808
|
+
:rtype: Sound
|
|
829
809
|
"""
|
|
830
810
|
...
|
|
831
811
|
|
|
832
|
-
def resample(self, rate: float,
|
|
812
|
+
def resample(self, rate: float, quality: int) -> int:
|
|
833
813
|
"""Resamples the sound.
|
|
834
814
|
|
|
835
815
|
:param rate: The new sample rate.
|
|
836
816
|
:type rate: float
|
|
837
|
-
:param
|
|
838
|
-
:type
|
|
839
|
-
:
|
|
840
|
-
:
|
|
817
|
+
:param quality: Resampler performance vs quality choice (0=fastest, 3=slowest).
|
|
818
|
+
:type quality: int
|
|
819
|
+
:return: The created `Sound` object.
|
|
820
|
+
:rtype: Sound
|
|
841
821
|
"""
|
|
842
822
|
...
|
|
843
823
|
|
|
844
|
-
def reverse(self) ->
|
|
824
|
+
def reverse(self) -> Sound:
|
|
845
825
|
"""Plays a sound reversed.
|
|
846
826
|
|
|
847
|
-
:
|
|
848
|
-
:
|
|
827
|
+
:return: The created `Sound` object.
|
|
828
|
+
:rtype: Sound
|
|
849
829
|
"""
|
|
850
830
|
...
|
|
851
831
|
|
|
852
|
-
def sum(self) ->
|
|
832
|
+
def sum(self) -> Sound:
|
|
853
833
|
"""Sums the samples of a sound.
|
|
854
834
|
|
|
855
|
-
:
|
|
856
|
-
:
|
|
835
|
+
:return: The created `Sound` object.
|
|
836
|
+
:rtype: Sound
|
|
857
837
|
"""
|
|
858
838
|
...
|
|
859
839
|
|
|
860
|
-
def threshold(self, threshold=
|
|
861
|
-
"""Makes a threshold wave out of an audio wave by setting all samples
|
|
840
|
+
def threshold(self, threshold: float = 0) -> float:
|
|
841
|
+
"""Makes a threshold wave out of an audio wave by setting all samples
|
|
842
|
+
with a amplitude >= threshold to 1, all <= -threshold to -1 and
|
|
843
|
+
all between to 0.
|
|
862
844
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
845
|
+
:param threshold: Threshold value over which an amplitude counts
|
|
846
|
+
non-zero.
|
|
847
|
+
:type threshold: float
|
|
848
|
+
:return: The created `Sound` object.
|
|
849
|
+
:rtype: Sound
|
|
867
850
|
"""
|
|
868
851
|
...
|
|
869
852
|
|
|
870
|
-
def volume(self, volume: float) ->
|
|
853
|
+
def volume(self, volume: float) -> float:
|
|
871
854
|
"""Changes the volume of a sound.
|
|
872
855
|
|
|
873
856
|
:param volume: The new volume..
|
|
874
857
|
:type volume: float
|
|
875
|
-
:
|
|
876
|
-
:
|
|
858
|
+
:return: The created `Sound` object.
|
|
859
|
+
:rtype: Sound
|
|
877
860
|
"""
|
|
878
861
|
...
|
|
879
862
|
|
|
@@ -926,7 +909,10 @@ class ThreadPool:
|
|
|
926
909
|
|
|
927
910
|
...
|
|
928
911
|
|
|
929
|
-
class error:
|
|
912
|
+
class error:
|
|
913
|
+
""" """
|
|
914
|
+
|
|
915
|
+
...
|
|
930
916
|
|
|
931
917
|
AP_LOCATION: typing.Any
|
|
932
918
|
""" Constant value 3
|