Audaspace: Update From Upstream (For API Docs)
No functional changes: - Cleanup Spelling, Line Length - Use proper class method styling for py docs - Fix Broken Links Differential Revision: https://developer.blender.org/D7276 Fixes T75191
This commit is contained in:
128
extern/audaspace/bindings/doc/tutorials.rst
vendored
128
extern/audaspace/bindings/doc/tutorials.rst
vendored
@@ -4,35 +4,51 @@ Tutorials
|
|||||||
Introduction
|
Introduction
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The C and Python binding for audaspace were designed with simplicity in mind. This means however that to use the full capabilities of audaspace, there is no way around the C++ library.
|
The C and Python binding for audaspace were designed with simplicity in mind.
|
||||||
|
This means however that to use the full capabilities of audaspace,
|
||||||
|
there is no way around the C++ library.
|
||||||
|
|
||||||
Simple Demo
|
Simple Demo
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
The **simple.py** example program contains all the basic building blocks for an application using audaspace. These building blocks are basically the classes :class:`aud.Device`, :class:`aud.Sound` and :class:`aud.Handle`.
|
The **simple.py** example program contains all the basic
|
||||||
|
building blocks for an application using audaspace.
|
||||||
|
These building blocks are basically the classes :class:`aud.Device`,
|
||||||
|
:class:`aud.Sound` and :class:`aud.Handle`.
|
||||||
|
|
||||||
We start with importing :mod:`aud` and :mod:`time` as the modules we need for our simple example.
|
We start with importing :mod:`aud` and :mod:`time`
|
||||||
|
as the modules we need for our simple example.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import aud, time
|
import aud, time
|
||||||
|
|
||||||
The first step now is to open an output device and this can simply be done by allocating a :class:`aud.Device` object.
|
The first step now is to open an output device and this
|
||||||
|
can simply be done by allocating a :class:`aud.Device` object.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
device = aud.Device()
|
device = aud.Device()
|
||||||
|
|
||||||
To create a sound we can choose to load one from a :func:`aud.Sound.file`, or we use one of our signal generators. We decide to do the latter and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
|
To create a sound we can choose to load one from a :func:`aud.Sound.file`,
|
||||||
|
or we use one of our signal generators. We decide to do the latter
|
||||||
|
and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
sine = aud.Sound.sine(440)
|
sine = aud.Sound.sine(440)
|
||||||
|
|
||||||
.. note:: At this point nothing is playing back yet, :class:`aud.Sound` objects are just descriptions of sounds.
|
.. note:: At this point nothing is playing back yet,
|
||||||
|
:class:`aud.Sound` objects are just descriptions of sounds.
|
||||||
|
|
||||||
However instead of a sine wave, we would like to have a square wave to produce a more retro gaming sound. We could of course use the :func:`aud.Sound.square` generator instead of sine, but we want to show how to apply effects, so we apply a :func:`aud.Sound.threshold` which makes a square wave out of our sine too, even if less efficient than directly generating the square wave.
|
However instead of a sine wave, we would like to have a square wave
|
||||||
|
to produce a more retro gaming sound. We could of course use the
|
||||||
|
:func:`aud.Sound.square` generator instead of sine,
|
||||||
|
but we want to show how to apply effects,
|
||||||
|
so we apply a :func:`aud.Sound.threshold`
|
||||||
|
which makes a square wave out of our sine too,
|
||||||
|
even if less efficient than directly generating the square wave.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -40,13 +56,19 @@ However instead of a sine wave, we would like to have a square wave to produce a
|
|||||||
|
|
||||||
.. note:: The :class:`aud.Sound` class offers generator and effect functions.
|
.. note:: The :class:`aud.Sound` class offers generator and effect functions.
|
||||||
|
|
||||||
The we can play our sound by calling the :func:`aud.Device.play` method of our device. This method returns a :class:`aud.Handle` which is used to control the playback of the sound.
|
The we can play our sound by calling the
|
||||||
|
:func:`aud.Device.play` method of our device.
|
||||||
|
This method returns a :class:`aud.Handle`
|
||||||
|
which is used to control the playback of the sound.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
handle = device.play(square)
|
handle = device.play(square)
|
||||||
|
|
||||||
Now if we do nothing else anymore the application will quit immediately, so we won't hear much of our square wave, so we decide to wait for three seconds before quitting the application by calling :func:`time.sleep`.
|
Now if we do nothing else anymore the application will quit immediately,
|
||||||
|
so we won't hear much of our square wave,
|
||||||
|
so we decide to wait for three seconds before
|
||||||
|
quitting the application by calling :func:`time.sleep`.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -55,29 +77,47 @@ Now if we do nothing else anymore the application will quit immediately, so we w
|
|||||||
Audioplayer
|
Audioplayer
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Now that we know the basics of audaspace, we can build our own music player easily by just slightly changing the previous program. The **player.py** example does exactly that, let's have a short look at the differences:
|
Now that we know the basics of audaspace,
|
||||||
|
we can build our own music player easily
|
||||||
|
by just slightly changing the previous program.
|
||||||
|
The **player.py** example does exactly that,
|
||||||
|
let's have a short look at the differences:
|
||||||
|
|
||||||
Instead of creating a sine signal and thresholding it, we in fact use the :func:`aud.Sound.file` function to load a sound from a file. The filename we pass is the first command line argument our application got.
|
Instead of creating a sine signal and thresholding it,
|
||||||
|
we in fact use the :func:`aud.Sound.file` function to load a sound from a file.
|
||||||
|
The filename we pass is the first command line argument our application got.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
sound = aud.Sound.file(sys.argv[1])
|
sound = aud.Sound.file(sys.argv[1])
|
||||||
|
|
||||||
When the sound gets played back we now want to wait until the whole file has been played, so we use the :data:`aud.Handle.status` property to determine whether the sound finished playing.
|
When the sound gets played back we now want to wait until
|
||||||
|
the whole file has been played, so we use the :data:`aud.Handle.status`
|
||||||
|
property to determine whether the sound finished playing.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
while handle.status:
|
while handle.status:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
We don't make any error checks if the user actually added a command line argument. As an exercise you could extend this program to play any number of command line supplied files in sequence.
|
We don't make any error checks if the user actually added a command
|
||||||
|
line argument. As an exercise you could extend this program to play
|
||||||
|
any number of command line supplied files in sequence.
|
||||||
|
|
||||||
Siren
|
Siren
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Let's get a little bit more complex. The **siren.py** example plays a generated siren sound that circles around your head. Depending on how many speakers you have and if the output device used supports the speaker setup, you will hear this effect. With stereo speakers you should at least hear some left-right-panning.
|
Let's get a little bit more complex. The **siren.py** example
|
||||||
|
plays a generated siren sound that circles around your head.
|
||||||
|
Depending on how many speakers you have and if the output
|
||||||
|
device used supports the speaker setup, you will hear this effect.
|
||||||
|
With stereo speakers you should at least hear some left-right-panning.
|
||||||
|
|
||||||
We start off again with importing the modules we need and we also define some properties of our siren sound. We want it to consist of two sine sounds with different frequencies. We define a length for the sine sounds and how long a fade in/out should take. We also know already how to open a device.
|
We start off again with importing the modules we need and
|
||||||
|
we also define some properties of our siren sound.
|
||||||
|
We want it to consist of two sine sounds with different frequencies.
|
||||||
|
We define a length for the sine sounds and how long a fade in/out should take.
|
||||||
|
We also know already how to open a device.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -88,27 +128,35 @@ We start off again with importing the modules we need and we also define some pr
|
|||||||
|
|
||||||
device = aud.Device()
|
device = aud.Device()
|
||||||
|
|
||||||
The next thing to do is to define our sine waves and apply all the required effects. As each of the effect functions returns the corresponding sound, we can easily chain those calls together.
|
The next thing to do is to define our sine waves and apply all the required effects.
|
||||||
|
As each of the effect functions returns the corresponding sound,
|
||||||
|
we can easily chain those calls together.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
|
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
|
||||||
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
|
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
|
||||||
|
|
||||||
The next step is to connect the two sines, which we do using the :func:`aud.Sound.join` function.
|
The next step is to connect the two sines,
|
||||||
|
which we do using the :func:`aud.Sound.join` function.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
sound = high.join(low)
|
sound = high.join(low)
|
||||||
|
|
||||||
The generated siren sound can now be played back and what we also do is to loop it. Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
|
The generated siren sound can now be played back and what we also do is to loop it.
|
||||||
|
Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
handle = device.play(sound)
|
handle = device.play(sound)
|
||||||
handle.loop_count = -1
|
handle.loop_count = -1
|
||||||
|
|
||||||
Now we use some timing code to make sure our demo runs for 10 seconds, but we also use the time to update the location of our playing sound, with the :data:`aud.Handle.location` property, which is a three dimensional vector. The trigonometic calculation based on the running time of the program keeps the sound on the XZ plane letting it follow a circle around us.
|
Now we use some timing code to make sure our demo runs for 10 seconds,
|
||||||
|
but we also use the time to update the location of our playing sound,
|
||||||
|
with the :data:`aud.Handle.location` property, which is a three dimensional vector.
|
||||||
|
The trigonometic calculation based on the running time of the program keeps
|
||||||
|
the sound on the XZ plane letting it follow a circle around us.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -119,33 +167,54 @@ Now we use some timing code to make sure our demo runs for 10 seconds, but we al
|
|||||||
|
|
||||||
handle.location = [math.sin(angle), 0, -math.cos(angle)]
|
handle.location = [math.sin(angle), 0, -math.cos(angle)]
|
||||||
|
|
||||||
As an exercise you could try to let the sound come from the far left and go to the far right and a little bit in front of you within the 10 second runtime of the program. With this change you should be able to hear the volume of the sound change, depending on how far it is away from you. Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect. Compare your solution to the **siren2.py** demo.
|
As an exercise you could try to let the sound come from the far left
|
||||||
|
and go to the far right and a little bit in front of you within the
|
||||||
|
10 second runtime of the program. With this change you should be able
|
||||||
|
to hear the volume of the sound change, depending on how far it is away from you.
|
||||||
|
Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect.
|
||||||
|
Compare your solution to the **siren2.py** demo.
|
||||||
|
|
||||||
Tetris
|
Tetris
|
||||||
------
|
------
|
||||||
|
|
||||||
The **tetris.py** demo application shows an even more complex application which generates retro tetris music. Looking at the source code there should be nothing new here, again the functions used from audaspace are the same as in the previous examples. In the :func:`parseNote` function all single notes get joined which leads to a very long chain of sounds. If you think of :func:`aud.Sound.join` as a function that creates a binary tree with the two joined sounds as leaves then the :func:`parseNote` function creates a very unbalanced tree.
|
The **tetris.py** demo application shows an even more
|
||||||
|
complex application which generates retro tetris music.
|
||||||
|
Looking at the source code there should be nothing new here,
|
||||||
|
again the functions used from audaspace are the same as in the previous examples.
|
||||||
|
In the :func:`parseNote` function all single notes get joined which leads
|
||||||
|
to a very long chain of sounds. If you think of :func:`aud.Sound.join`
|
||||||
|
as a function that creates a binary tree with the two joined sounds as
|
||||||
|
leaves then the :func:`parseNote` function creates a very unbalanced tree.
|
||||||
|
|
||||||
Insted we could rewrite the code to use two other classes: :class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes. The **tetris2.py** application does exactly that. Before the while loop we add a variable that stores the current position in the score and create a new :class:`aud.Sequence` object.
|
Insted we could rewrite the code to use two other classes:
|
||||||
|
:class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes.
|
||||||
|
The **tetris2.py** application does exactly that.
|
||||||
|
Before the while loop we add a variable that stores the current position
|
||||||
|
in the score and create a new :class:`aud.Sequence` object.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
position = 0
|
position = 0
|
||||||
sequence = aud.Sequence()
|
sequence = aud.Sequence()
|
||||||
|
|
||||||
Then in the loop we can create the note simply by chaining the :func:`aud.Sound.square` generator and :func:`aud.Sound.fadein` and :func:`aud.Sound.fadeout` effects.
|
Then in the loop we can create the note simply by chaining the
|
||||||
|
:func:`aud.Sound.square` generator and :func:`aud.Sound.fadein`
|
||||||
|
and :func:`aud.Sound.fadeout` effects.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
note = aud.Sound.square(freq, rate).fadein(0, fadelength).fadeout(length - fadelength, fadelength)
|
note = aud.Sound.square(freq, rate).fadein(0, fadelength).fadeout(length - fadelength, fadelength)
|
||||||
|
|
||||||
Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join` we simply add the sound to the sequence.
|
Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join`
|
||||||
|
we simply add the sound to the sequence.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
entry = sequence.add(note, position, position + length, 0)
|
entry = sequence.add(note, position, position + length, 0)
|
||||||
|
|
||||||
The entry returned from the :func:`aud.Sequence.add` function is an object of the :class:`aud.SequenceEntry` class. We can use this entry to mute the note in case it's actually a pause.
|
The entry returned from the :func:`aud.Sequence.add`
|
||||||
|
function is an object of the :class:`aud.SequenceEntry` class.
|
||||||
|
We can use this entry to mute the note in case it's actually a pause.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -158,9 +227,14 @@ Lastly we have to update our position variable.
|
|||||||
|
|
||||||
position += length
|
position += length
|
||||||
|
|
||||||
Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted` property to show how the :class:`aud.SequenceEntry` class can be used, but it would actually be smarter to not even create a note for pauses and just skip them. You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
|
Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted`
|
||||||
|
property to show how the :class:`aud.SequenceEntry` class can be used,
|
||||||
|
but it would actually be smarter to not even create a note for pauses and just skip them.
|
||||||
|
You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
|
||||||
|
|
||||||
Conclusion
|
Conclusion
|
||||||
----------
|
----------
|
||||||
|
|
||||||
We introduced all five currently available classes in the audaspace Python API. Of course all classes offer a lot more functions than have been used in these demo applications, check out the specific class documentation for more details.
|
We introduced all five currently available classes in the audaspace Python API.
|
||||||
|
Of course all classes offer a lot more functions than have been used in these demo applications,
|
||||||
|
check out the specific class documentation for more details.
|
||||||
|
50
extern/audaspace/bindings/python/PyDevice.cpp
vendored
50
extern/audaspace/bindings/python/PyDevice.cpp
vendored
@@ -124,15 +124,17 @@ Device_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Device_lock_doc,
|
PyDoc_STRVAR(M_aud_Device_lock_doc,
|
||||||
"lock()\n\n"
|
".. classmethod:: lock()\n\n"
|
||||||
"Locks the device so that it's guaranteed, that no samples are "
|
" Locks the device so that it's guaranteed, that no samples are\n"
|
||||||
"read from the streams until :meth:`unlock` is called.\n"
|
" read from the streams until :meth:`unlock` is called.\n"
|
||||||
"This is useful if you want to do start/stop/pause/resume some "
|
" This is useful if you want to do start/stop/pause/resume some\n"
|
||||||
"sounds at the same time.\n\n"
|
" sounds at the same time.\n\n"
|
||||||
".. note:: The device has to be unlocked as often as locked to be "
|
" .. note::\n\n"
|
||||||
"able to continue playback.\n\n"
|
" The device has to be unlocked as often as locked to be\n"
|
||||||
".. warning:: Make sure the time between locking and unlocking is "
|
" able to continue playback.\n\n"
|
||||||
"as short as possible to avoid clicks.");
|
" .. warning::\n\n"
|
||||||
|
" Make sure the time between locking and unlocking is\n"
|
||||||
|
" as short as possible to avoid clicks.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_lock(Device* self)
|
Device_lock(Device* self)
|
||||||
@@ -150,15 +152,15 @@ Device_lock(Device* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Device_play_doc,
|
PyDoc_STRVAR(M_aud_Device_play_doc,
|
||||||
"play(sound, keep=False)\n\n"
|
".. classmethod:: play(sound, keep=False)\n\n"
|
||||||
"Plays a sound.\n\n"
|
" Plays a sound.\n\n"
|
||||||
":arg sound: The sound to play.\n"
|
" :arg sound: The sound to play.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":arg keep: See :attr:`Handle.keep`.\n"
|
" :arg keep: See :attr:`Handle.keep`.\n"
|
||||||
":type keep: bool\n"
|
" :type keep: bool\n"
|
||||||
":return: The playback handle with which playback can be "
|
" :return: The playback handle with which playback can be\n"
|
||||||
"controlled with.\n"
|
" controlled with.\n"
|
||||||
":rtype: :class:`Handle`");
|
" :rtype: :class:`Handle`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_play(Device* self, PyObject* args, PyObject* kwds)
|
Device_play(Device* self, PyObject* args, PyObject* kwds)
|
||||||
@@ -210,8 +212,8 @@ Device_play(Device* self, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Device_stopAll_doc,
|
PyDoc_STRVAR(M_aud_Device_stopAll_doc,
|
||||||
"stopAll()\n\n"
|
".. classmethod:: stopAll()\n\n"
|
||||||
"Stops all playing and paused sounds.");
|
" Stops all playing and paused sounds.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_stopAll(Device* self)
|
Device_stopAll(Device* self)
|
||||||
@@ -229,9 +231,9 @@ Device_stopAll(Device* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Device_unlock_doc,
|
PyDoc_STRVAR(M_aud_Device_unlock_doc,
|
||||||
"unlock()\n\n"
|
".. classmethod:: unlock()\n\n"
|
||||||
"Unlocks the device after a lock call, see :meth:`lock` for "
|
" Unlocks the device after a lock call, see :meth:`lock` for\n"
|
||||||
"details.");
|
" details.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_unlock(Device* self)
|
Device_unlock(Device* self)
|
||||||
@@ -284,7 +286,7 @@ Device_get_channels(Device* self, void* nothing)
|
|||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Device_distance_model_doc,
|
PyDoc_STRVAR(M_aud_Device_distance_model_doc,
|
||||||
"The distance model of the device.\n\n"
|
"The distance model of the device.\n\n"
|
||||||
".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
|
".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Device_get_distance_model(Device* self, void* nothing)
|
Device_get_distance_model(Device* self, void* nothing)
|
||||||
|
@@ -60,12 +60,12 @@ DynamicMusic_dealloc(DynamicMusicP* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_DynamicMusic_addScene_doc,
|
PyDoc_STRVAR(M_aud_DynamicMusic_addScene_doc,
|
||||||
"addScene(scene)\n\n"
|
".. classmethod:: addScene(scene)\n\n"
|
||||||
"Adds a new scene.\n\n"
|
" Adds a new scene.\n\n"
|
||||||
":arg scene: The scene sound.\n"
|
" :arg scene: The scene sound.\n"
|
||||||
":type scene: :class:`Sound`\n"
|
" :type scene: :class:`Sound`\n"
|
||||||
":return: The new scene id.\n"
|
" :return: The new scene id.\n"
|
||||||
":rtype: int");
|
" :rtype: int");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
|
DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
|
||||||
@@ -90,16 +90,16 @@ DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_DynamicMusic_addTransition_doc,
|
PyDoc_STRVAR(M_aud_DynamicMusic_addTransition_doc,
|
||||||
"addTransition(ini, end, transition)\n\n"
|
".. classmethod:: addTransition(ini, end, transition)\n\n"
|
||||||
"Adds a new scene.\n\n"
|
" Adds a new scene.\n\n"
|
||||||
":arg ini: the initial scene foor the transition.\n"
|
" :arg ini: the initial scene foor the transition.\n"
|
||||||
":type ini: int\n"
|
" :type ini: int\n"
|
||||||
":arg end: The final scene for the transition.\n"
|
" :arg end: The final scene for the transition.\n"
|
||||||
":type end: int\n"
|
" :type end: int\n"
|
||||||
":arg transition: The transition sound.\n"
|
" :arg transition: The transition sound.\n"
|
||||||
":type transition: :class:`Sound`\n"
|
" :type transition: :class:`Sound`\n"
|
||||||
":return: false if the ini or end scenes don't exist, true othrwise.\n"
|
" :return: false if the ini or end scenes don't exist, true othrwise.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
|
DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
|
||||||
@@ -125,10 +125,10 @@ DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_DynamicMusic_resume_doc,
|
PyDoc_STRVAR(M_aud_DynamicMusic_resume_doc,
|
||||||
"resume()\n\n"
|
".. classmethod:: resume()\n\n"
|
||||||
"Resumes playback of the scene.\n\n"
|
" Resumes playback of the scene.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
DynamicMusic_resume(DynamicMusicP* self)
|
DynamicMusic_resume(DynamicMusicP* self)
|
||||||
@@ -145,10 +145,10 @@ DynamicMusic_resume(DynamicMusicP* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_DynamicMusic_pause_doc,
|
PyDoc_STRVAR(M_aud_DynamicMusic_pause_doc,
|
||||||
"pause()\n\n"
|
".. classmethod:: pause()\n\n"
|
||||||
"Pauses playback of the scene.\n\n"
|
" Pauses playback of the scene.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
DynamicMusic_pause(DynamicMusicP* self)
|
DynamicMusic_pause(DynamicMusicP* self)
|
||||||
@@ -165,10 +165,10 @@ DynamicMusic_pause(DynamicMusicP* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_DynamicMusic_stop_doc,
|
PyDoc_STRVAR(M_aud_DynamicMusic_stop_doc,
|
||||||
"stop()\n\n"
|
".. classmethod:: stop()\n\n"
|
||||||
"Stops playback of the scene.\n\n"
|
" Stops playback of the scene.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool\n\n");
|
" :rtype: bool\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
DynamicMusic_stop(DynamicMusicP* self)
|
DynamicMusic_stop(DynamicMusicP* self)
|
||||||
@@ -464,4 +464,4 @@ void addDynamicMusicToModule(PyObject* module)
|
|||||||
{
|
{
|
||||||
Py_INCREF(&DynamicMusicType);
|
Py_INCREF(&DynamicMusicType);
|
||||||
PyModule_AddObject(module, "DynamicMusic", (PyObject *)&DynamicMusicType);
|
PyModule_AddObject(module, "DynamicMusic", (PyObject *)&DynamicMusicType);
|
||||||
}
|
}
|
||||||
|
52
extern/audaspace/bindings/python/PyHRTF.cpp
vendored
52
extern/audaspace/bindings/python/PyHRTF.cpp
vendored
@@ -54,16 +54,16 @@ HRTF_dealloc(HRTFP* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_HRTF_addImpulseResponse_doc,
|
PyDoc_STRVAR(M_aud_HRTF_addImpulseResponse_doc,
|
||||||
"addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
|
".. classmethod:: addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
|
||||||
"Adds a new hrtf to the HRTF object\n\n"
|
" Adds a new hrtf to the HRTF object\n\n"
|
||||||
":arg sound: The sound that contains the hrtf.\n"
|
" :arg sound: The sound that contains the hrtf.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":arg azimuth: The azimuth angle of the hrtf.\n"
|
" :arg azimuth: The azimuth angle of the hrtf.\n"
|
||||||
":type azimuth: float\n"
|
" :type azimuth: float\n"
|
||||||
":arg elevation: The elevation angle of the hrtf.\n"
|
" :arg elevation: The elevation angle of the hrtf.\n"
|
||||||
":type elevation: float\n"
|
" :type elevation: float\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
|
HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
|
||||||
@@ -90,14 +90,14 @@ HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_HRTF_loadLeftHrtfSet_doc,
|
PyDoc_STRVAR(M_aud_HRTF_loadLeftHrtfSet_doc,
|
||||||
"loadLeftHrtfSet(extension, directory)\n\n"
|
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
|
||||||
"Loads all HRTFs from a directory.\n\n"
|
" Loads all HRTFs from a directory.\n\n"
|
||||||
":arg extension: The file extension of the hrtfs.\n"
|
" :arg extension: The file extension of the hrtfs.\n"
|
||||||
":type extension: string\n"
|
" :type extension: string\n"
|
||||||
":arg directory: The path to where the HRTF files are located.\n"
|
" :arg directory: The path to where the HRTF files are located.\n"
|
||||||
":type extension: string\n"
|
" :type extension: string\n"
|
||||||
":return: The loaded :class:`HRTF` object.\n"
|
" :return: The loaded :class:`HRTF` object.\n"
|
||||||
":rtype: :class:`HRTF`\n\n");
|
" :rtype: :class:`HRTF`\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
|
HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
|
||||||
@@ -125,14 +125,14 @@ HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_HRTF_loadRightHrtfSet_doc,
|
PyDoc_STRVAR(M_aud_HRTF_loadRightHrtfSet_doc,
|
||||||
"loadLeftHrtfSet(extension, directory)\n\n"
|
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
|
||||||
"Loads all HRTFs from a directory.\n\n"
|
" Loads all HRTFs from a directory.\n\n"
|
||||||
":arg extension: The file extension of the hrtfs.\n"
|
" :arg extension: The file extension of the hrtfs.\n"
|
||||||
":type extension: string\n"
|
" :type extension: string\n"
|
||||||
":arg directory: The path to where the HRTF files are located.\n"
|
" :arg directory: The path to where the HRTF files are located.\n"
|
||||||
":type extension: string\n"
|
" :type extension: string\n"
|
||||||
":return: The loaded :class:`HRTF` object.\n"
|
" :return: The loaded :class:`HRTF` object.\n"
|
||||||
":rtype: :class:`HRTF`\n\n");
|
" :rtype: :class:`HRTF`\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
HRTF_loadRightHrtfSet(PyTypeObject* type, PyObject* args)
|
HRTF_loadRightHrtfSet(PyTypeObject* type, PyObject* args)
|
||||||
|
28
extern/audaspace/bindings/python/PyHandle.cpp
vendored
28
extern/audaspace/bindings/python/PyHandle.cpp
vendored
@@ -38,10 +38,10 @@ Handle_dealloc(Handle* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Handle_pause_doc,
|
PyDoc_STRVAR(M_aud_Handle_pause_doc,
|
||||||
"pause()\n\n"
|
".. classmethod:: pause()\n\n"
|
||||||
"Pauses playback.\n\n"
|
" Pauses playback.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Handle_pause(Handle* self)
|
Handle_pause(Handle* self)
|
||||||
@@ -58,10 +58,10 @@ Handle_pause(Handle* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Handle_resume_doc,
|
PyDoc_STRVAR(M_aud_Handle_resume_doc,
|
||||||
"resume()\n\n"
|
".. classmethod:: resume()\n\n"
|
||||||
"Resumes playback.\n\n"
|
" Resumes playback.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Handle_resume(Handle* self)
|
Handle_resume(Handle* self)
|
||||||
@@ -78,11 +78,11 @@ Handle_resume(Handle* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Handle_stop_doc,
|
PyDoc_STRVAR(M_aud_Handle_stop_doc,
|
||||||
"stop()\n\n"
|
".. classmethod:: stop()\n\n"
|
||||||
"Stops playback.\n\n"
|
" Stops playback.\n\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool\n\n"
|
" :rtype: bool\n\n"
|
||||||
".. note:: This makes the handle invalid.");
|
" .. note:: This makes the handle invalid.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Handle_stop(Handle* self)
|
Handle_stop(Handle* self)
|
||||||
@@ -1122,5 +1122,3 @@ void addHandleToModule(PyObject* module)
|
|||||||
Py_INCREF(&HandleType);
|
Py_INCREF(&HandleType);
|
||||||
PyModule_AddObject(module, "Handle", (PyObject *)&HandleType);
|
PyModule_AddObject(module, "Handle", (PyObject *)&HandleType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -60,14 +60,15 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
|
||||||
"setVolume(sound, catKey)\n\n"
|
".. classmethod:: setVolume(sound, catKey)\n\n"
|
||||||
"Plays a sound through the playback manager and assigns it to a category.\n\n"
|
" Plays a sound through the playback manager and assigns it to a category.\n\n"
|
||||||
":arg sound: The sound to play.\n"
|
" :arg sound: The sound to play.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":arg catKey: the key of the category in which the sound will be added, if it doesn't exist, a new one will be created.\n"
|
" :arg catKey: the key of the category in which the sound will be added,\n"
|
||||||
":type catKey: int\n"
|
" if it doesn't exist, a new one will be created.\n"
|
||||||
":return: The playback handle with which playback can be controlled with.\n"
|
" :type catKey: int\n"
|
||||||
":rtype: :class:`Handle`");
|
" :return: The playback handle with which playback can be controlled with.\n"
|
||||||
|
" :rtype: :class:`Handle`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -103,12 +104,12 @@ PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_resume_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_resume_doc,
|
||||||
"resume(catKey)\n\n"
|
".. classmethod:: resume(catKey)\n\n"
|
||||||
"Resumes playback of the catgory.\n\n"
|
" Resumes playback of the catgory.\n\n"
|
||||||
":arg catKey: the key of the category.\n"
|
" :arg catKey: the key of the category.\n"
|
||||||
":type catKey: int\n"
|
" :type catKey: int\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -130,12 +131,12 @@ PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_pause_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_pause_doc,
|
||||||
"pause(catKey)\n\n"
|
".. classmethod:: pause(catKey)\n\n"
|
||||||
"Pauses playback of the category.\n\n"
|
" Pauses playback of the category.\n\n"
|
||||||
":arg catKey: the key of the category.\n"
|
" :arg catKey: the key of the category.\n"
|
||||||
":type catKey: int\n"
|
" :type catKey: int\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool");
|
" :rtype: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -157,12 +158,12 @@ PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_add_category_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_add_category_doc,
|
||||||
"addCategory(volume)\n\n"
|
".. classmethod:: addCategory(volume)\n\n"
|
||||||
"Adds a category with a custom volume.\n\n"
|
" Adds a category with a custom volume.\n\n"
|
||||||
":arg volume: The volume for ther new category.\n"
|
" :arg volume: The volume for ther new category.\n"
|
||||||
":type volume: float\n"
|
" :type volume: float\n"
|
||||||
":return: The key of the new category.\n"
|
" :return: The key of the new category.\n"
|
||||||
":rtype: int\n\n");
|
" :rtype: int\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -184,12 +185,12 @@ PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_get_volume_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_get_volume_doc,
|
||||||
"getVolume(catKey)\n\n"
|
".. classmethod:: getVolume(catKey)\n\n"
|
||||||
"Retrieves the volume of a category.\n\n"
|
" Retrieves the volume of a category.\n\n"
|
||||||
":arg catKey: the key of the category.\n"
|
" :arg catKey: the key of the category.\n"
|
||||||
":type catKey: int\n"
|
" :type catKey: int\n"
|
||||||
":return: The volume of the cateogry.\n"
|
" :return: The volume of the cateogry.\n"
|
||||||
":rtype: float\n\n");
|
" :rtype: float\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -211,14 +212,14 @@ PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_set_volume_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_set_volume_doc,
|
||||||
"setVolume(volume, catKey)\n\n"
|
".. classmethod:: setVolume(volume, catKey)\n\n"
|
||||||
"Changes the volume of a category.\n\n"
|
" Changes the volume of a category.\n\n"
|
||||||
":arg volume: the new volume value.\n"
|
" :arg volume: the new volume value.\n"
|
||||||
":type volume: float\n"
|
" :type volume: float\n"
|
||||||
":arg catKey: the key of the category.\n"
|
" :arg catKey: the key of the category.\n"
|
||||||
":type catKey: int\n"
|
" :type catKey: int\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: int\n\n");
|
" :rtype: int\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -241,12 +242,12 @@ PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_stop_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_stop_doc,
|
||||||
"stop(catKey)\n\n"
|
".. classmethod:: stop(catKey)\n\n"
|
||||||
"Stops playback of the category.\n\n"
|
" Stops playback of the category.\n\n"
|
||||||
":arg catKey: the key of the category.\n"
|
" :arg catKey: the key of the category.\n"
|
||||||
":type catKey: int\n"
|
" :type catKey: int\n"
|
||||||
":return: Whether the action succeeded.\n"
|
" :return: Whether the action succeeded.\n"
|
||||||
":rtype: bool\n\n");
|
" :rtype: bool\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
|
PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
|
||||||
@@ -268,8 +269,8 @@ PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_PlaybackManager_clean_doc,
|
PyDoc_STRVAR(M_aud_PlaybackManager_clean_doc,
|
||||||
"clean()\n\n"
|
".. classmethod:: clean()\n\n"
|
||||||
"Cleans all the invalid and finished sound from the playback manager.\n\n");
|
" Cleans all the invalid and finished sound from the playback manager.\n\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
PlaybackManager_clean(PlaybackManagerP* self)
|
PlaybackManager_clean(PlaybackManagerP* self)
|
||||||
|
54
extern/audaspace/bindings/python/PySequence.cpp
vendored
54
extern/audaspace/bindings/python/PySequence.cpp
vendored
@@ -99,18 +99,18 @@ Sequence_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sequence_add_doc,
|
PyDoc_STRVAR(M_aud_Sequence_add_doc,
|
||||||
"add()\n\n"
|
".. classmethod:: add()\n\n"
|
||||||
"Adds a new entry to the sequence.\n\n"
|
" Adds a new entry to the sequence.\n\n"
|
||||||
":arg sound: The sound this entry should play.\n"
|
" :arg sound: The sound this entry should play.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":arg begin: The start time.\n"
|
" :arg begin: The start time.\n"
|
||||||
":type begin: float\n"
|
" :type begin: float\n"
|
||||||
":arg end: The end time or a negative value if determined by the sound.\n"
|
" :arg end: The end time or a negative value if determined by the sound.\n"
|
||||||
":type end: float\n"
|
" :type end: float\n"
|
||||||
":arg skip: How much seconds should be skipped at the beginning.\n"
|
" :arg skip: How much seconds should be skipped at the beginning.\n"
|
||||||
":type skip: float\n"
|
" :type skip: float\n"
|
||||||
":return: The entry added.\n"
|
" :return: The entry added.\n"
|
||||||
":rtype: :class:`SequenceEntry`");
|
" :rtype: :class:`SequenceEntry`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
|
Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
|
||||||
@@ -151,10 +151,10 @@ Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sequence_remove_doc,
|
PyDoc_STRVAR(M_aud_Sequence_remove_doc,
|
||||||
"remove()\n\n"
|
".. classmethod:: remove()\n\n"
|
||||||
"Removes an entry from the sequence.\n\n"
|
" Removes an entry from the sequence.\n\n"
|
||||||
":arg entry: The entry to remove.\n"
|
" :arg entry: The entry to remove.\n"
|
||||||
":type entry: :class:`SequenceEntry`\n");
|
" :type entry: :class:`SequenceEntry`\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sequence_remove(Sequence* self, PyObject* args)
|
Sequence_remove(Sequence* self, PyObject* args)
|
||||||
@@ -183,16 +183,16 @@ Sequence_remove(Sequence* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sequence_setAnimationData_doc,
|
PyDoc_STRVAR(M_aud_Sequence_setAnimationData_doc,
|
||||||
"setAnimationData()\n\n"
|
".. classmethod:: setAnimationData()\n\n"
|
||||||
"Writes animation data to a sequence.\n\n"
|
" Writes animation data to a sequence.\n\n"
|
||||||
":arg type: The type of animation data.\n"
|
" :arg type: The type of animation data.\n"
|
||||||
":type type: int\n"
|
" :type type: int\n"
|
||||||
":arg frame: The frame this data is for.\n"
|
" :arg frame: The frame this data is for.\n"
|
||||||
":type frame: int\n"
|
" :type frame: int\n"
|
||||||
":arg data: The data to write.\n"
|
" :arg data: The data to write.\n"
|
||||||
":type data: sequence of float\n"
|
" :type data: sequence of float\n"
|
||||||
":arg animated: Whether the attribute is animated.\n"
|
" :arg animated: Whether the attribute is animated.\n"
|
||||||
":type animated: bool");
|
" :type animated: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sequence_setAnimationData(Sequence* self, PyObject* args)
|
Sequence_setAnimationData(Sequence* self, PyObject* args)
|
||||||
@@ -325,7 +325,7 @@ Sequence_set_channels(Sequence* self, PyObject* args, void* nothing)
|
|||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sequence_distance_model_doc,
|
PyDoc_STRVAR(M_aud_Sequence_distance_model_doc,
|
||||||
"The distance model of the sequence.\n\n"
|
"The distance model of the sequence.\n\n"
|
||||||
".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
|
".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sequence_get_distance_model(Sequence* self, void* nothing)
|
Sequence_get_distance_model(Sequence* self, void* nothing)
|
||||||
|
@@ -43,14 +43,14 @@ SequenceEntry_dealloc(SequenceEntry* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
|
PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
|
||||||
"move()\n\n"
|
".. classmethod:: move()\n\n"
|
||||||
"Moves the entry.\n\n"
|
" Moves the entry.\n\n"
|
||||||
":arg begin: The new start time.\n"
|
" :arg begin: The new start time.\n"
|
||||||
":type begin: float\n"
|
" :type begin: float\n"
|
||||||
":arg end: The new end time or a negative value if unknown.\n"
|
" :arg end: The new end time or a negative value if unknown.\n"
|
||||||
":type end: float\n"
|
" :type end: float\n"
|
||||||
":arg skip: How many seconds to skip at the beginning.\n"
|
" :arg skip: How many seconds to skip at the beginning.\n"
|
||||||
":type skip: float\n");
|
" :type skip: float\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
SequenceEntry_move(SequenceEntry* self, PyObject* args)
|
SequenceEntry_move(SequenceEntry* self, PyObject* args)
|
||||||
@@ -73,16 +73,16 @@ SequenceEntry_move(SequenceEntry* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_SequenceEntry_setAnimationData_doc,
|
PyDoc_STRVAR(M_aud_SequenceEntry_setAnimationData_doc,
|
||||||
"setAnimationData()\n\n"
|
".. classmethod:: setAnimationData()\n\n"
|
||||||
"Writes animation data to a sequenced entry.\n\n"
|
" Writes animation data to a sequenced entry.\n\n"
|
||||||
":arg type: The type of animation data.\n"
|
" :arg type: The type of animation data.\n"
|
||||||
":type type: int\n"
|
" :type type: int\n"
|
||||||
":arg frame: The frame this data is for.\n"
|
" :arg frame: The frame this data is for.\n"
|
||||||
":type frame: int\n"
|
" :type frame: int\n"
|
||||||
":arg data: The data to write.\n"
|
" :arg data: The data to write.\n"
|
||||||
":type data: sequence of float\n"
|
" :type data: sequence of float\n"
|
||||||
":arg animated: Whether the attribute is animated.\n"
|
" :arg animated: Whether the attribute is animated.\n"
|
||||||
":type animated: bool");
|
" :type animated: bool");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
SequenceEntry_setAnimationData(SequenceEntry* self, PyObject* args)
|
SequenceEntry_setAnimationData(SequenceEntry* self, PyObject* args)
|
||||||
|
659
extern/audaspace/bindings/python/PySound.cpp
vendored
659
extern/audaspace/bindings/python/PySound.cpp
vendored
@@ -114,11 +114,11 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_data_doc,
|
PyDoc_STRVAR(M_aud_Sound_data_doc,
|
||||||
"data()\n\n"
|
".. classmethod:: data()\n\n"
|
||||||
"Retrieves the data of the sound as numpy array.\n\n"
|
" Retrieves the data of the sound as numpy array.\n\n"
|
||||||
":return: A two dimensional numpy float array.\n"
|
" :return: A two dimensional numpy float array.\n"
|
||||||
":rtype: :class:`numpy.ndarray`\n\n"
|
" :rtype: :class:`numpy.ndarray`\n\n"
|
||||||
".. note:: Best efficiency with cached sounds.");
|
" .. note:: Best efficiency with cached sounds.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_data(Sound* self)
|
Sound_data(Sound* self)
|
||||||
@@ -145,24 +145,24 @@ Sound_data(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_write_doc,
|
PyDoc_STRVAR(M_aud_Sound_write_doc,
|
||||||
"write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
|
".. classmethod:: write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
|
||||||
"Writes the sound to a file.\n\n"
|
" Writes the sound to a file.\n\n"
|
||||||
":arg filename: The path to write to.\n"
|
" :arg filename: The path to write to.\n"
|
||||||
":type filename: string\n"
|
" :type filename: string\n"
|
||||||
":arg rate: The sample rate to write with.\n"
|
" :arg rate: The sample rate to write with.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":arg channels: The number of channels to write with.\n"
|
" :arg channels: The number of channels to write with.\n"
|
||||||
":type channels: int\n"
|
" :type channels: int\n"
|
||||||
":arg format: The sample format to write with.\n"
|
" :arg format: The sample format to write with.\n"
|
||||||
":type format: int\n"
|
" :type format: int\n"
|
||||||
":arg container: The container format for the file.\n"
|
" :arg container: The container format for the file.\n"
|
||||||
":type container: int\n"
|
" :type container: int\n"
|
||||||
":arg codec: The codec to use in the file.\n"
|
" :arg codec: The codec to use in the file.\n"
|
||||||
":type codec: int\n"
|
" :type codec: int\n"
|
||||||
":arg bitrate: The bitrate to write with.\n"
|
" :arg bitrate: The bitrate to write with.\n"
|
||||||
":type bitrate: int\n"
|
" :type bitrate: int\n"
|
||||||
":arg buffersize: The size of the writing buffer.\n"
|
" :arg buffersize: The size of the writing buffer.\n"
|
||||||
":type buffersize: int\n");
|
" :type buffersize: int");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_write(Sound* self, PyObject* args, PyObject* kwds)
|
Sound_write(Sound* self, PyObject* args, PyObject* kwds)
|
||||||
@@ -286,14 +286,14 @@ Sound_write(Sound* self, PyObject* args, PyObject* kwds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_buffer_doc,
|
PyDoc_STRVAR(M_aud_Sound_buffer_doc,
|
||||||
"buffer(data, rate)\n\n"
|
".. classmethod:: buffer(data, rate)\n\n"
|
||||||
"Creates a sound from a data buffer.\n\n"
|
" Creates a sound from a data buffer.\n\n"
|
||||||
":arg data: The data as two dimensional numpy array.\n"
|
" :arg data: The data as two dimensional numpy array.\n"
|
||||||
":type data: numpy.ndarray\n"
|
" :type data: numpy.ndarray\n"
|
||||||
":arg rate: The sample rate.\n"
|
" :arg rate: The sample rate.\n"
|
||||||
":type rate: double\n"
|
" :type rate: double\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_buffer(PyTypeObject* type, PyObject* args)
|
Sound_buffer(PyTypeObject* type, PyObject* args)
|
||||||
@@ -356,16 +356,17 @@ Sound_buffer(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_cache_doc,
|
PyDoc_STRVAR(M_aud_Sound_cache_doc,
|
||||||
"cache()\n\n"
|
".. classmethod:: cache()\n\n"
|
||||||
"Caches a sound into RAM.\n"
|
" Caches a sound into RAM.\n\n"
|
||||||
"This saves CPU usage needed for decoding and file access if the "
|
" This saves CPU usage needed for decoding and file access if the\n"
|
||||||
"underlying sound reads from a file on the harddisk, but it "
|
" underlying sound reads from a file on the harddisk,\n"
|
||||||
"consumes a lot of memory.\n\n"
|
" but it consumes a lot of memory.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: Only known-length factories can be buffered.\n\n"
|
" .. note:: Only known-length factories can be buffered.\n\n"
|
||||||
".. warning:: Raw PCM data needs a lot of space, only buffer "
|
" .. warning::\n\n"
|
||||||
"short factories.");
|
" Raw PCM data needs a lot of space, only buffer\n"
|
||||||
|
" short factories.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_cache(Sound* self)
|
Sound_cache(Sound* self)
|
||||||
@@ -391,15 +392,16 @@ Sound_cache(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_file_doc,
|
PyDoc_STRVAR(M_aud_Sound_file_doc,
|
||||||
"file(filename)\n\n"
|
".. classmethod:: file(filename)\n\n"
|
||||||
"Creates a sound object of a sound file.\n\n"
|
" Creates a sound object of a sound file.\n\n"
|
||||||
":arg filename: Path of the file.\n"
|
" :arg filename: Path of the file.\n"
|
||||||
":type filename: string\n"
|
" :type filename: string\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. warning:: If the file doesn't exist or can't be read you will "
|
" .. warning::\n\n"
|
||||||
"not get an exception immediately, but when you try to start "
|
" If the file doesn't exist or can't be read you will\n"
|
||||||
"playback of that sound.");
|
" not get an exception immediately, but when you try to start\n"
|
||||||
|
" playback of that sound.\n");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_file(PyTypeObject* type, PyObject* args)
|
Sound_file(PyTypeObject* type, PyObject* args)
|
||||||
@@ -430,15 +432,15 @@ Sound_file(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_sawtooth_doc,
|
PyDoc_STRVAR(M_aud_Sound_sawtooth_doc,
|
||||||
"sawtooth(frequency, rate=48000)\n\n"
|
".. classmethod:: sawtooth(frequency, rate=48000)\n\n"
|
||||||
"Creates a sawtooth sound which plays a sawtooth wave.\n\n"
|
" Creates a sawtooth sound which plays a sawtooth wave.\n\n"
|
||||||
":arg frequency: The frequency of the sawtooth wave in Hz.\n"
|
" :arg frequency: The frequency of the sawtooth wave in Hz.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg rate: The sampling rate in Hz. It's recommended to set this "
|
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
|
||||||
"value to the playback device's samling rate to avoid resamping.\n"
|
" value to the playback device's samling rate to avoid resamping.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_sawtooth(PyTypeObject* type, PyObject* args)
|
Sound_sawtooth(PyTypeObject* type, PyObject* args)
|
||||||
@@ -470,13 +472,13 @@ Sound_sawtooth(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_silence_doc,
|
PyDoc_STRVAR(M_aud_Sound_silence_doc,
|
||||||
"silence(rate=48000)\n\n"
|
".. classmethod:: silence(rate=48000)\n\n"
|
||||||
"Creates a silence sound which plays simple silence.\n\n"
|
" Creates a silence sound which plays simple silence.\n\n"
|
||||||
":arg rate: The sampling rate in Hz. It's recommended to set this "
|
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
|
||||||
"value to the playback device's samling rate to avoid resamping.\n"
|
" value to the playback device's samling rate to avoid resamping.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_silence(PyTypeObject* type, PyObject* args)
|
Sound_silence(PyTypeObject* type, PyObject* args)
|
||||||
@@ -507,15 +509,15 @@ Sound_silence(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_sine_doc,
|
PyDoc_STRVAR(M_aud_Sound_sine_doc,
|
||||||
"sine(frequency, rate=48000)\n\n"
|
".. classmethod:: sine(frequency, rate=48000)\n\n"
|
||||||
"Creates a sine sound which plays a sine wave.\n\n"
|
" Creates a sine sound which plays a sine wave.\n\n"
|
||||||
":arg frequency: The frequency of the sine wave in Hz.\n"
|
" :arg frequency: The frequency of the sine wave in Hz.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg rate: The sampling rate in Hz. It's recommended to set this "
|
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
|
||||||
"value to the playback device's samling rate to avoid resamping.\n"
|
" value to the playback device's samling rate to avoid resamping.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_sine(PyTypeObject* type, PyObject* args)
|
Sound_sine(PyTypeObject* type, PyObject* args)
|
||||||
@@ -547,15 +549,15 @@ Sound_sine(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_square_doc,
|
PyDoc_STRVAR(M_aud_Sound_square_doc,
|
||||||
"square(frequency, rate=48000)\n\n"
|
".. classmethod:: square(frequency, rate=48000)\n\n"
|
||||||
"Creates a square sound which plays a square wave.\n\n"
|
" Creates a square sound which plays a square wave.\n\n"
|
||||||
":arg frequency: The frequency of the square wave in Hz.\n"
|
" :arg frequency: The frequency of the square wave in Hz.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg rate: The sampling rate in Hz. It's recommended to set this "
|
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
|
||||||
"value to the playback device's samling rate to avoid resamping.\n"
|
" value to the playback device's samling rate to avoid resamping.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_square(PyTypeObject* type, PyObject* args)
|
Sound_square(PyTypeObject* type, PyObject* args)
|
||||||
@@ -587,15 +589,15 @@ Sound_square(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_triangle_doc,
|
PyDoc_STRVAR(M_aud_Sound_triangle_doc,
|
||||||
"triangle(frequency, rate=48000)\n\n"
|
".. classmethod:: triangle(frequency, rate=48000)\n\n"
|
||||||
"Creates a triangle sound which plays a triangle wave.\n\n"
|
" Creates a triangle sound which plays a triangle wave.\n\n"
|
||||||
":arg frequency: The frequency of the triangle wave in Hz.\n"
|
" :arg frequency: The frequency of the triangle wave in Hz.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg rate: The sampling rate in Hz. It's recommended to set this "
|
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
|
||||||
"value to the playback device's samling rate to avoid resamping.\n"
|
" value to the playback device's samling rate to avoid resamping.\n"
|
||||||
":type rate: int\n"
|
" :type rate: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_triangle(PyTypeObject* type, PyObject* args)
|
Sound_triangle(PyTypeObject* type, PyObject* args)
|
||||||
@@ -627,14 +629,16 @@ Sound_triangle(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
|
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
|
||||||
"accumulate(additive=False)\n\n"
|
".. classmethod:: accumulate(additive=False)\n\n"
|
||||||
"Accumulates a sound by summing over positive input differences thus generating a monotonic sigal. "
|
" Accumulates a sound by summing over positive input\n"
|
||||||
"If additivity is set to true negative input differences get added too, but positive ones with a factor of two. "
|
" differences thus generating a monotonic sigal.\n"
|
||||||
"Note that with additivity the signal is not monotonic anymore.\n\n"
|
" If additivity is set to true negative input differences get added too,\n"
|
||||||
":arg additive: Whether the accumulation should be additive or not.\n"
|
" but positive ones with a factor of two.\n\n"
|
||||||
":type time: bool\n"
|
" Note that with additivity the signal is not monotonic anymore.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :arg additive: Whether the accumulation should be additive or not.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :type time: bool\n"
|
||||||
|
" :return: The created :class:`Sound` object.\n"
|
||||||
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_accumulate(Sound* self, PyObject* args)
|
Sound_accumulate(Sound* self, PyObject* args)
|
||||||
@@ -677,19 +681,19 @@ Sound_accumulate(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
|
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
|
||||||
"ADSR(attack,decay,sustain,release)\n\n"
|
".. classmethod:: ADSR(attack, decay, sustain, release)\n\n"
|
||||||
"Attack-Decay-Sustain-Release envelopes the volume of a sound. "
|
" Attack-Decay-Sustain-Release envelopes the volume of a sound.\n"
|
||||||
"Note: there is currently no way to trigger the release with this API.\n\n"
|
" Note: there is currently no way to trigger the release with this API.\n\n"
|
||||||
":arg attack: The attack time in seconds.\n"
|
" :arg attack: The attack time in seconds.\n"
|
||||||
":type attack: float\n"
|
" :type attack: float\n"
|
||||||
":arg decay: The decay time in seconds.\n"
|
" :arg decay: The decay time in seconds.\n"
|
||||||
":type decay: float\n"
|
" :type decay: float\n"
|
||||||
":arg sustain: The sustain level.\n"
|
" :arg sustain: The sustain level.\n"
|
||||||
":type sustain: float\n"
|
" :type sustain: float\n"
|
||||||
":arg release: The release level.\n"
|
" :arg release: The release level.\n"
|
||||||
":type release: float\n"
|
" :type release: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_ADSR(Sound* self, PyObject* args)
|
Sound_ADSR(Sound* self, PyObject* args)
|
||||||
@@ -720,14 +724,12 @@ Sound_ADSR(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_delay_doc,
|
PyDoc_STRVAR(M_aud_Sound_delay_doc,
|
||||||
"delay(time)\n\n"
|
".. classmethod:: delay(time)\n\n"
|
||||||
"Delays by playing adding silence in front of the other sound's "
|
" Delays by playing adding silence in front of the other sound's data.\n\n"
|
||||||
"data.\n\n"
|
" :arg time: How many seconds of silence should be added before the sound.\n"
|
||||||
":arg time: How many seconds of silence should be added before "
|
" :type time: float\n"
|
||||||
"the sound.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":type time: float\n"
|
" :rtype: :class:`Sound`");
|
||||||
":return: The created :class:`Sound` object.\n"
|
|
||||||
":rtype: :class:`Sound`");
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_delay(Sound* self, PyObject* args)
|
Sound_delay(Sound* self, PyObject* args)
|
||||||
@@ -758,19 +760,18 @@ Sound_delay(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
|
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
|
||||||
"envelope(attack, release, threshold, arthreshold)\n\n"
|
".. classmethod:: envelope(attack, release, threshold, arthreshold)\n\n"
|
||||||
"Delays by playing adding silence in front of the other sound's "
|
" Delays by playing adding silence in front of the other sound's data.\n\n"
|
||||||
"data.\n\n"
|
" :arg attack: The attack factor.\n"
|
||||||
":arg attack: The attack factor.\n"
|
" :type attack: float\n"
|
||||||
":type attack: float\n"
|
" :arg release: The release factor.\n"
|
||||||
":arg release: The release factor.\n"
|
" :type release: float\n"
|
||||||
":type release: float\n"
|
" :arg threshold: The general threshold value.\n"
|
||||||
":arg threshold: The general threshold value.\n"
|
" :type threshold: float\n"
|
||||||
":type threshold: float\n"
|
" :arg arthreshold: The attack/release threshold value.\n"
|
||||||
":arg arthreshold: The attack/release threshold value.\n"
|
" :type arthreshold: float\n"
|
||||||
":type arthreshold: float\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :rtype: :class:`Sound`");
|
||||||
":rtype: :class:`Sound`");
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_envelope(Sound* self, PyObject* args)
|
Sound_envelope(Sound* self, PyObject* args)
|
||||||
@@ -801,16 +802,16 @@ Sound_envelope(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
|
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
|
||||||
"fadein(start, length)\n\n"
|
".. classmethod:: fadein(start, length)\n\n"
|
||||||
"Fades a sound in by raising the volume linearly in the given "
|
" Fades a sound in by raising the volume linearly in the given\n"
|
||||||
"time interval.\n\n"
|
" time interval.\n\n"
|
||||||
":arg start: Time in seconds when the fading should start.\n"
|
" :arg start: Time in seconds when the fading should start.\n"
|
||||||
":type start: float\n"
|
" :type start: float\n"
|
||||||
":arg length: Time in seconds how long the fading should last.\n"
|
" :arg length: Time in seconds how long the fading should last.\n"
|
||||||
":type length: float\n"
|
" :type length: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: Before the fade starts it plays silence.");
|
" .. note:: Before the fade starts it plays silence.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_fadein(Sound* self, PyObject* args)
|
Sound_fadein(Sound* self, PyObject* args)
|
||||||
@@ -841,17 +842,18 @@ Sound_fadein(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
|
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
|
||||||
"fadeout(start, length)\n\n"
|
".. classmethod:: fadeout(start, length)\n\n"
|
||||||
"Fades a sound in by lowering the volume linearly in the given "
|
" Fades a sound in by lowering the volume linearly in the given\n"
|
||||||
"time interval.\n\n"
|
" time interval.\n\n"
|
||||||
":arg start: Time in seconds when the fading should start.\n"
|
" :arg start: Time in seconds when the fading should start.\n"
|
||||||
":type start: float\n"
|
" :type start: float\n"
|
||||||
":arg length: Time in seconds how long the fading should last.\n"
|
" :arg length: Time in seconds how long the fading should last.\n"
|
||||||
":type length: float\n"
|
" :type length: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: After the fade this sound plays silence, so that "
|
" .. note::\n\n"
|
||||||
"the length of the sound is not altered.");
|
" After the fade this sound plays silence, so that\n"
|
||||||
|
" the length of the sound is not altered.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_fadeout(Sound* self, PyObject* args)
|
Sound_fadeout(Sound* self, PyObject* args)
|
||||||
@@ -882,20 +884,20 @@ Sound_fadeout(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_filter_doc,
|
PyDoc_STRVAR(M_aud_Sound_filter_doc,
|
||||||
"filter(b, a = (1))\n\n"
|
".. classmethod:: filter(b, a = (1))\n\n"
|
||||||
"Filters a sound with the supplied IIR filter coefficients.\n"
|
" Filters a sound with the supplied IIR filter coefficients.\n"
|
||||||
"Without the second parameter you'll get a FIR filter.\n"
|
" Without the second parameter you'll get a FIR filter.\n\n"
|
||||||
"If the first value of the a sequence is 0 it will be set to 1 "
|
" If the first value of the a sequence is 0,\n"
|
||||||
"automatically.\n"
|
" it will be set to 1 automatically.\n"
|
||||||
"If the first value of the a sequence is neither 0 nor 1, all "
|
" If the first value of the a sequence is neither 0 nor 1, all\n"
|
||||||
"filter coefficients will be scaled by this value so that it is 1 "
|
" filter coefficients will be scaled by this value so that it is 1\n"
|
||||||
"in the end, you don't have to scale yourself.\n\n"
|
" in the end, you don't have to scale yourself.\n\n"
|
||||||
":arg b: The nominator filter coefficients.\n"
|
" :arg b: The nominator filter coefficients.\n"
|
||||||
":type b: sequence of float\n"
|
" :type b: sequence of float\n"
|
||||||
":arg a: The denominator filter coefficients.\n"
|
" :arg a: The denominator filter coefficients.\n"
|
||||||
":type a: sequence of float\n"
|
" :type a: sequence of float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_filter(Sound* self, PyObject* args)
|
Sound_filter(Sound* self, PyObject* args)
|
||||||
@@ -982,15 +984,15 @@ Sound_filter(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
|
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
|
||||||
"highpass(frequency, Q=0.5)\n\n"
|
".. classmethod:: highpass(frequency, Q=0.5)\n\n"
|
||||||
"Creates a second order highpass filter based on the transfer "
|
" Creates a second order highpass filter based on the transfer\n"
|
||||||
"function H(s) = s^2 / (s^2 + s/Q + 1)\n\n"
|
" function :math:`H(s) = s^2 / (s^2 + s/Q + 1)`\n\n"
|
||||||
":arg frequency: The cut off trequency of the highpass.\n"
|
" :arg frequency: The cut off trequency of the highpass.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg Q: Q factor of the lowpass.\n"
|
" :arg Q: Q factor of the lowpass.\n"
|
||||||
":type Q: float\n"
|
" :type Q: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_highpass(Sound* self, PyObject* args)
|
Sound_highpass(Sound* self, PyObject* args)
|
||||||
@@ -1022,14 +1024,14 @@ Sound_highpass(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_limit_doc,
|
PyDoc_STRVAR(M_aud_Sound_limit_doc,
|
||||||
"limit(start, end)\n\n"
|
".. classmethod:: limit(start, end)\n\n"
|
||||||
"Limits a sound within a specific start and end time.\n\n"
|
" Limits a sound within a specific start and end time.\n\n"
|
||||||
":arg start: Start time in seconds.\n"
|
" :arg start: Start time in seconds.\n"
|
||||||
":type start: float\n"
|
" :type start: float\n"
|
||||||
":arg end: End time in seconds.\n"
|
" :arg end: End time in seconds.\n"
|
||||||
":type end: float\n"
|
" :type end: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_limit(Sound* self, PyObject* args)
|
Sound_limit(Sound* self, PyObject* args)
|
||||||
@@ -1060,15 +1062,16 @@ Sound_limit(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_loop_doc,
|
PyDoc_STRVAR(M_aud_Sound_loop_doc,
|
||||||
"loop(count)\n\n"
|
".. classmethod:: loop(count)\n\n"
|
||||||
"Loops a sound.\n\n"
|
" Loops a sound.\n\n"
|
||||||
":arg count: How often the sound should be looped. "
|
" :arg count: How often the sound should be looped.\n"
|
||||||
"Negative values mean endlessly.\n"
|
" Negative values mean endlessly.\n"
|
||||||
":type count: integer\n"
|
" :type count: integer\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: This is a filter function, you might consider using "
|
" .. note::\n\n"
|
||||||
":attr:`Handle.loop_count` instead.");
|
" This is a filter function, you might consider using\n"
|
||||||
|
" :attr:`Handle.loop_count` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_loop(Sound* self, PyObject* args)
|
Sound_loop(Sound* self, PyObject* args)
|
||||||
@@ -1099,15 +1102,15 @@ Sound_loop(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
|
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
|
||||||
"lowpass(frequency, Q=0.5)\n\n"
|
".. classmethod:: lowpass(frequency, Q=0.5)\n\n"
|
||||||
"Creates a second order lowpass filter based on the transfer "
|
" Creates a second order lowpass filter based on the transfer "
|
||||||
"function H(s) = 1 / (s^2 + s/Q + 1)\n\n"
|
" function :math:`H(s) = 1 / (s^2 + s/Q + 1)`\n\n"
|
||||||
":arg frequency: The cut off trequency of the lowpass.\n"
|
" :arg frequency: The cut off trequency of the lowpass.\n"
|
||||||
":type frequency: float\n"
|
" :type frequency: float\n"
|
||||||
":arg Q: Q factor of the lowpass.\n"
|
" :arg Q: Q factor of the lowpass.\n"
|
||||||
":type Q: float\n"
|
" :type Q: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_lowpass(Sound* self, PyObject* args)
|
Sound_lowpass(Sound* self, PyObject* args)
|
||||||
@@ -1139,14 +1142,15 @@ Sound_lowpass(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
|
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
|
||||||
"modulate(sound)\n\n"
|
".. classmethod:: modulate(sound)\n\n"
|
||||||
"Modulates two factories.\n\n"
|
" Modulates two factories.\n\n"
|
||||||
":arg sound: The sound to modulate over the other.\n"
|
" :arg sound: The sound to modulate over the other.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: The two factories have to have the same specifications "
|
" .. note::\n\n"
|
||||||
"(channels and samplerate).");
|
" The two factories have to have the same specifications\n"
|
||||||
|
" (channels and samplerate).");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_modulate(Sound* self, PyObject* object)
|
Sound_modulate(Sound* self, PyObject* object)
|
||||||
@@ -1180,17 +1184,19 @@ Sound_modulate(Sound* self, PyObject* object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
|
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
|
||||||
"pitch(factor)\n\n"
|
".. classmethod:: pitch(factor)\n\n"
|
||||||
"Changes the pitch of a sound with a specific factor.\n\n"
|
" Changes the pitch of a sound with a specific factor.\n\n"
|
||||||
":arg factor: The factor to change the pitch with.\n"
|
" :arg factor: The factor to change the pitch with.\n"
|
||||||
":type factor: float\n"
|
" :type factor: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: This is done by changing the sample rate of the "
|
" .. note::\n\n"
|
||||||
"underlying sound, which has to be an integer, so the factor "
|
" This is done by changing the sample rate of the\n"
|
||||||
"value rounded and the factor may not be 100 % accurate.\n\n"
|
" underlying sound, which has to be an integer, so the factor\n"
|
||||||
".. note:: This is a filter function, you might consider using "
|
" value rounded and the factor may not be 100 % accurate.\n\n"
|
||||||
":attr:`Handle.pitch` instead.");
|
" .. note::\n\n"
|
||||||
|
" This is a filter function, you might consider using\n"
|
||||||
|
" :attr:`Handle.pitch` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_pitch(Sound* self, PyObject* args)
|
Sound_pitch(Sound* self, PyObject* args)
|
||||||
@@ -1221,12 +1227,12 @@ Sound_pitch(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
|
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
|
||||||
"rechannel(channels)\n\n"
|
".. classmethod:: rechannel(channels)\n\n"
|
||||||
"Rechannels the sound.\n\n"
|
" Rechannels the sound.\n\n"
|
||||||
":arg channels: The new channel configuration.\n"
|
" :arg channels: The new channel configuration.\n"
|
||||||
":type channels: int\n"
|
" :type channels: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_rechannel(Sound* self, PyObject* args)
|
Sound_rechannel(Sound* self, PyObject* args)
|
||||||
@@ -1261,14 +1267,14 @@ Sound_rechannel(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_resample_doc,
|
PyDoc_STRVAR(M_aud_Sound_resample_doc,
|
||||||
"resample(rate, high_quality)\n\n"
|
".. classmethod:: resample(rate, high_quality)\n\n"
|
||||||
"Resamples the sound.\n\n"
|
" Resamples the sound.\n\n"
|
||||||
":arg rate: The new sample rate.\n"
|
" :arg rate: The new sample rate.\n"
|
||||||
":type rate: double\n"
|
" :type rate: double\n"
|
||||||
":arg high_quality: When true use a higher quality but slower resampler.\n"
|
" :arg high_quality: When true use a higher quality but slower resampler.\n"
|
||||||
":type high_quality: bool\n"
|
" :type high_quality: bool\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_resample(Sound* self, PyObject* args)
|
Sound_resample(Sound* self, PyObject* args)
|
||||||
@@ -1316,17 +1322,19 @@ Sound_resample(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
|
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
|
||||||
"reverse()\n\n"
|
".. classmethod:: reverse()\n\n"
|
||||||
"Plays a sound reversed.\n\n"
|
" Plays a sound reversed.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: The sound has to have a finite length and has to be "
|
" .. note::\n\n"
|
||||||
"seekable. It's recommended to use this only with factories with "
|
" The sound has to have a finite length and has to be seekable.\n"
|
||||||
"fast and accurate seeking, which is not true for encoded audio "
|
" It's recommended to use this only with factories with\n"
|
||||||
"files, such ones should be buffered using :meth:`cache` before "
|
" fast and accurate seeking, which is not true for encoded audio\n"
|
||||||
"being played reversed.\n\n"
|
" files, such ones should be buffered using :meth:`cache` before\n"
|
||||||
".. warning:: If seeking is not accurate in the underlying sound "
|
" being played reversed.\n\n"
|
||||||
"you'll likely hear skips/jumps/cracks.");
|
" .. warning::\n\n"
|
||||||
|
" If seeking is not accurate in the underlying sound\n"
|
||||||
|
" you'll likely hear skips/jumps/cracks.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_reverse(Sound* self)
|
Sound_reverse(Sound* self)
|
||||||
@@ -1352,10 +1360,10 @@ Sound_reverse(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_sum_doc,
|
PyDoc_STRVAR(M_aud_Sound_sum_doc,
|
||||||
"sum()\n\n"
|
".. classmethod:: sum()\n\n"
|
||||||
"Sums the samples of a sound.\n\n"
|
" Sums the samples of a sound.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_sum(Sound* self)
|
Sound_sum(Sound* self)
|
||||||
@@ -1381,12 +1389,12 @@ Sound_sum(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
|
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
|
||||||
"threshold(threshold = 0)\n\n"
|
".. classmethod:: threshold(threshold = 0)\n\n"
|
||||||
"Makes a threshold wave out of an audio wave by setting all samples "
|
" Makes a threshold wave out of an audio wave by setting all samples\n"
|
||||||
"with a amplitude >= threshold to 1, all <= -threshold to -1 and "
|
" with a amplitude >= threshold to 1, all <= -threshold to -1 and\n"
|
||||||
"all between to 0.\n\n"
|
" all between to 0.\n\n"
|
||||||
":arg threshold: Threshold value over which an amplitude counts "
|
" :arg threshold: Threshold value over which an amplitude counts\n"
|
||||||
"non-zero.\n"
|
" non-zero.\n"
|
||||||
":type threshold: float\n"
|
":type threshold: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
":return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
":rtype: :class:`Sound`");
|
||||||
@@ -1420,15 +1428,16 @@ Sound_threshold(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_volume_doc,
|
PyDoc_STRVAR(M_aud_Sound_volume_doc,
|
||||||
"volume(volume)\n\n"
|
".. classmethod:: volume(volume)\n\n"
|
||||||
"Changes the volume of a sound.\n\n"
|
" Changes the volume of a sound.\n\n"
|
||||||
":arg volume: The new volume..\n"
|
" :arg volume: The new volume..\n"
|
||||||
":type volume: float\n"
|
" :type volume: float\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: Should be in the range [0, 1] to avoid clipping.\n\n"
|
" .. note:: Should be in the range [0, 1] to avoid clipping.\n\n"
|
||||||
".. note:: This is a filter function, you might consider using "
|
" .. note::\n\n"
|
||||||
":attr:`Handle.volume` instead.");
|
" This is a filter function, you might consider using\n"
|
||||||
|
" :attr:`Handle.volume` instead.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_volume(Sound* self, PyObject* args)
|
Sound_volume(Sound* self, PyObject* args)
|
||||||
@@ -1459,14 +1468,15 @@ Sound_volume(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_join_doc,
|
PyDoc_STRVAR(M_aud_Sound_join_doc,
|
||||||
"join(sound)\n\n"
|
".. classmethod:: join(sound)\n\n"
|
||||||
"Plays two factories in sequence.\n\n"
|
" Plays two factories in sequence.\n\n"
|
||||||
":arg sound: The sound to play second.\n"
|
" :arg sound: The sound to play second.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: The two factories have to have the same specifications "
|
" .. note::\n\n"
|
||||||
"(channels and samplerate).");
|
" The two factories have to have the same specifications\n"
|
||||||
|
" (channels and samplerate).");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_join(Sound* self, PyObject* object)
|
Sound_join(Sound* self, PyObject* object)
|
||||||
@@ -1501,14 +1511,15 @@ Sound_join(Sound* self, PyObject* object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_mix_doc,
|
PyDoc_STRVAR(M_aud_Sound_mix_doc,
|
||||||
"mix(sound)\n\n"
|
".. classmethod:: mix(sound)\n\n"
|
||||||
"Mixes two factories.\n\n"
|
" Mixes two factories.\n\n"
|
||||||
":arg sound: The sound to mix over the other.\n"
|
" :arg sound: The sound to mix over the other.\n"
|
||||||
":type sound: :class:`Sound`\n"
|
" :type sound: :class:`Sound`\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`\n\n"
|
" :rtype: :class:`Sound`\n\n"
|
||||||
".. note:: The two factories have to have the same specifications "
|
" .. note::\n\n"
|
||||||
"(channels and samplerate).");
|
" The two factories have to have the same specifications\n"
|
||||||
|
" (channels and samplerate).");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_mix(Sound* self, PyObject* object)
|
Sound_mix(Sound* self, PyObject* object)
|
||||||
@@ -1542,11 +1553,11 @@ Sound_mix(Sound* self, PyObject* object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
|
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
|
||||||
"pingpong()\n\n"
|
".. classmethod:: pingpong()\n\n"
|
||||||
"Plays a sound forward and then backward.\n"
|
" Plays a sound forward and then backward.\n"
|
||||||
"This is like joining a sound with its reverse.\n\n"
|
" This is like joining a sound with its reverse.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_pingpong(Sound* self)
|
Sound_pingpong(Sound* self)
|
||||||
@@ -1572,12 +1583,12 @@ Sound_pingpong(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_list_doc,
|
PyDoc_STRVAR(M_aud_Sound_list_doc,
|
||||||
"list()\n\n"
|
".. classmethod:: list()\n\n"
|
||||||
"Creates an empty sound list that can contain several sounds.\n\n"
|
" Creates an empty sound list that can contain several sounds.\n\n"
|
||||||
":arg random: wether the playback will be random or not.\n"
|
" :arg random: whether the playback will be random or not.\n"
|
||||||
":type random: int\n"
|
" :type random: int\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_list(PyTypeObject* type, PyObject* args)
|
Sound_list(PyTypeObject* type, PyObject* args)
|
||||||
@@ -1608,11 +1619,11 @@ Sound_list(PyTypeObject* type, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
|
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
|
||||||
"mutable()\n\n"
|
".. classmethod:: mutable()\n\n"
|
||||||
"Creates a sound that will be restarted when sought backwards.\n"
|
" Creates a sound that will be restarted when sought backwards.\n"
|
||||||
"If the original sound is a sound list, the playing sound can change.\n\n"
|
" If the original sound is a sound list, the playing sound can change.\n\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_mutable(Sound* self)
|
Sound_mutable(Sound* self)
|
||||||
@@ -1638,12 +1649,12 @@ Sound_mutable(Sound* self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
|
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
|
||||||
"addSound(sound)\n\n"
|
".. classmethod:: addSound(sound)\n\n"
|
||||||
"Adds a new sound to a sound list.\n\n"
|
" Adds a new sound to a sound list.\n\n"
|
||||||
":arg sound: The sound that will be added to the list.\n"
|
" :arg sound: The sound that will be added to the list.\n"
|
||||||
":type sound: :class:`Sound`\n\n"
|
" :type sound: :class:`Sound`\n\n"
|
||||||
".. note:: You can only add a sound to a sound list.");
|
" .. note:: You can only add a sound to a sound list.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_list_addSound(Sound* self, PyObject* object)
|
Sound_list_addSound(Sound* self, PyObject* object)
|
||||||
{
|
{
|
||||||
@@ -1671,14 +1682,14 @@ Sound_list_addSound(Sound* self, PyObject* object)
|
|||||||
#ifdef WITH_CONVOLUTION
|
#ifdef WITH_CONVOLUTION
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
|
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
|
||||||
"convolver()\n\n"
|
".. classmethod:: convolver()\n\n"
|
||||||
"Creates a sound that will apply convolution to another sound.\n\n"
|
" Creates a sound that will apply convolution to another sound.\n\n"
|
||||||
":arg impulseResponse: The filter with which convolve the sound.\n"
|
" :arg impulseResponse: The filter with which convolve the sound.\n"
|
||||||
":type impulseResponse: :class:`ImpulseResponse`\n"
|
" :type impulseResponse: :class:`ImpulseResponse`\n"
|
||||||
":arg threadPool: A thread pool used to parallelize convolution.\n"
|
" :arg threadPool: A thread pool used to parallelize convolution.\n"
|
||||||
":type threadPool: :class:`ThreadPool`\n"
|
" :type threadPool: :class:`ThreadPool`\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_convolver(Sound* self, PyObject* args)
|
Sound_convolver(Sound* self, PyObject* args)
|
||||||
@@ -1720,16 +1731,16 @@ Sound_convolver(Sound* self, PyObject* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
|
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
|
||||||
"convolver()\n\n"
|
".. classmethod:: convolver()\n\n"
|
||||||
"Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
|
" Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
|
||||||
":arg hrtfs: An HRTF set.\n"
|
" :arg hrtfs: An HRTF set.\n"
|
||||||
":type hrtf: :class:`HRTF`\n"
|
" :type hrtf: :class:`HRTF`\n"
|
||||||
":arg source: An object representing the source position of the sound.\n"
|
" :arg source: An object representing the source position of the sound.\n"
|
||||||
":type source: :class:`Source`\n"
|
" :type source: :class:`Source`\n"
|
||||||
":arg threadPool: A thread pool used to parallelize convolution.\n"
|
" :arg threadPool: A thread pool used to parallelize convolution.\n"
|
||||||
":type threadPool: :class:`ThreadPool`\n"
|
" :type threadPool: :class:`ThreadPool`\n"
|
||||||
":return: The created :class:`Sound` object.\n"
|
" :return: The created :class:`Sound` object.\n"
|
||||||
":rtype: :class:`Sound`");
|
" :rtype: :class:`Sound`");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
Sound_binaural(Sound* self, PyObject* args)
|
Sound_binaural(Sound* self, PyObject* args)
|
||||||
|
Reference in New Issue
Block a user