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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/audaspace/bindings/python/PySound.cpp')
-rw-r--r--extern/audaspace/bindings/python/PySound.cpp659
1 files changed, 335 insertions, 324 deletions
diff --git a/extern/audaspace/bindings/python/PySound.cpp b/extern/audaspace/bindings/python/PySound.cpp
index c589e7110cb..c37e3f7fa52 100644
--- a/extern/audaspace/bindings/python/PySound.cpp
+++ b/extern/audaspace/bindings/python/PySound.cpp
@@ -114,11 +114,11 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_data_doc,
- "data()\n\n"
- "Retrieves the data of the sound as numpy array.\n\n"
- ":return: A two dimensional numpy float array.\n"
- ":rtype: :class:`numpy.ndarray`\n\n"
- ".. note:: Best efficiency with cached sounds.");
+ ".. classmethod:: data()\n\n"
+ " Retrieves the data of the sound as numpy array.\n\n"
+ " :return: A two dimensional numpy float array.\n"
+ " :rtype: :class:`numpy.ndarray`\n\n"
+ " .. note:: Best efficiency with cached sounds.");
static PyObject *
Sound_data(Sound* self)
@@ -145,24 +145,24 @@ Sound_data(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_write_doc,
- "write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
- "Writes the sound to a file.\n\n"
- ":arg filename: The path to write to.\n"
- ":type filename: string\n"
- ":arg rate: The sample rate to write with.\n"
- ":type rate: int\n"
- ":arg channels: The number of channels to write with.\n"
- ":type channels: int\n"
- ":arg format: The sample format to write with.\n"
- ":type format: int\n"
- ":arg container: The container format for the file.\n"
- ":type container: int\n"
- ":arg codec: The codec to use in the file.\n"
- ":type codec: int\n"
- ":arg bitrate: The bitrate to write with.\n"
- ":type bitrate: int\n"
- ":arg buffersize: The size of the writing buffer.\n"
- ":type buffersize: int\n");
+ ".. classmethod:: write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
+ " Writes the sound to a file.\n\n"
+ " :arg filename: The path to write to.\n"
+ " :type filename: string\n"
+ " :arg rate: The sample rate to write with.\n"
+ " :type rate: int\n"
+ " :arg channels: The number of channels to write with.\n"
+ " :type channels: int\n"
+ " :arg format: The sample format to write with.\n"
+ " :type format: int\n"
+ " :arg container: The container format for the file.\n"
+ " :type container: int\n"
+ " :arg codec: The codec to use in the file.\n"
+ " :type codec: int\n"
+ " :arg bitrate: The bitrate to write with.\n"
+ " :type bitrate: int\n"
+ " :arg buffersize: The size of the writing buffer.\n"
+ " :type buffersize: int");
static PyObject *
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,
- "buffer(data, rate)\n\n"
- "Creates a sound from a data buffer.\n\n"
- ":arg data: The data as two dimensional numpy array.\n"
- ":type data: numpy.ndarray\n"
- ":arg rate: The sample rate.\n"
- ":type rate: double\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: buffer(data, rate)\n\n"
+ " Creates a sound from a data buffer.\n\n"
+ " :arg data: The data as two dimensional numpy array.\n"
+ " :type data: numpy.ndarray\n"
+ " :arg rate: The sample rate.\n"
+ " :type rate: double\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_buffer(PyTypeObject* type, PyObject* args)
@@ -356,16 +356,17 @@ Sound_buffer(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_cache_doc,
- "cache()\n\n"
- "Caches a sound into RAM.\n"
- "This saves CPU usage needed for decoding and file access if the "
- "underlying sound reads from a file on the harddisk, but it "
- "consumes a lot of memory.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: Only known-length factories can be buffered.\n\n"
- ".. warning:: Raw PCM data needs a lot of space, only buffer "
- "short factories.");
+ ".. classmethod:: cache()\n\n"
+ " Caches a sound into RAM.\n\n"
+ " This saves CPU usage needed for decoding and file access if the\n"
+ " underlying sound reads from a file on the harddisk,\n"
+ " but it consumes a lot of memory.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note:: Only known-length factories can be buffered.\n\n"
+ " .. warning::\n\n"
+ " Raw PCM data needs a lot of space, only buffer\n"
+ " short factories.");
static PyObject *
Sound_cache(Sound* self)
@@ -391,15 +392,16 @@ Sound_cache(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_file_doc,
- "file(filename)\n\n"
- "Creates a sound object of a sound file.\n\n"
- ":arg filename: Path of the file.\n"
- ":type filename: string\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. warning:: If the file doesn't exist or can't be read you will "
- "not get an exception immediately, but when you try to start "
- "playback of that sound.");
+ ".. classmethod:: file(filename)\n\n"
+ " Creates a sound object of a sound file.\n\n"
+ " :arg filename: Path of the file.\n"
+ " :type filename: string\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. warning::\n\n"
+ " If the file doesn't exist or can't be read you will\n"
+ " not get an exception immediately, but when you try to start\n"
+ " playback of that sound.\n");
static PyObject *
Sound_file(PyTypeObject* type, PyObject* args)
@@ -430,15 +432,15 @@ Sound_file(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sawtooth_doc,
- "sawtooth(frequency, rate=48000)\n\n"
- "Creates a sawtooth sound which plays a sawtooth wave.\n\n"
- ":arg frequency: The frequency of the sawtooth wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sawtooth(frequency, rate=48000)\n\n"
+ " Creates a sawtooth sound which plays a sawtooth wave.\n\n"
+ " :arg frequency: The frequency of the sawtooth wave in Hz.\n"
+ " :type frequency: float\n"
+ " :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"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sawtooth(PyTypeObject* type, PyObject* args)
@@ -470,13 +472,13 @@ Sound_sawtooth(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_silence_doc,
- "silence(rate=48000)\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 "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: silence(rate=48000)\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\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_silence(PyTypeObject* type, PyObject* args)
@@ -507,15 +509,15 @@ Sound_silence(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sine_doc,
- "sine(frequency, rate=48000)\n\n"
- "Creates a sine sound which plays a sine wave.\n\n"
- ":arg frequency: The frequency of the sine wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sine(frequency, rate=48000)\n\n"
+ " Creates a sine sound which plays a sine wave.\n\n"
+ " :arg frequency: The frequency of the sine wave in Hz.\n"
+ " :type frequency: float\n"
+ " :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"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sine(PyTypeObject* type, PyObject* args)
@@ -547,15 +549,15 @@ Sound_sine(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_square_doc,
- "square(frequency, rate=48000)\n\n"
- "Creates a square sound which plays a square wave.\n\n"
- ":arg frequency: The frequency of the square wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: square(frequency, rate=48000)\n\n"
+ " Creates a square sound which plays a square wave.\n\n"
+ " :arg frequency: The frequency of the square wave in Hz.\n"
+ " :type frequency: float\n"
+ " :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"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_square(PyTypeObject* type, PyObject* args)
@@ -587,15 +589,15 @@ Sound_square(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_triangle_doc,
- "triangle(frequency, rate=48000)\n\n"
- "Creates a triangle sound which plays a triangle wave.\n\n"
- ":arg frequency: The frequency of the triangle wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: triangle(frequency, rate=48000)\n\n"
+ " Creates a triangle sound which plays a triangle wave.\n\n"
+ " :arg frequency: The frequency of the triangle wave in Hz.\n"
+ " :type frequency: float\n"
+ " :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"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_triangle(PyTypeObject* type, PyObject* args)
@@ -627,14 +629,16 @@ Sound_triangle(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
- "accumulate(additive=False)\n\n"
- "Accumulates a sound by summing over positive input differences thus generating a monotonic sigal. "
- "If additivity is set to true negative input differences get added too, but positive ones with a factor of two. "
- "Note that with additivity the signal is not monotonic anymore.\n\n"
- ":arg additive: Whether the accumulation should be additive or not.\n"
- ":type time: bool\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: accumulate(additive=False)\n\n"
+ " Accumulates a sound by summing over positive input\n"
+ " differences thus generating a monotonic sigal.\n"
+ " If additivity is set to true negative input differences get added too,\n"
+ " but positive ones with a factor of two.\n\n"
+ " Note that with additivity the signal is not monotonic anymore.\n\n"
+ " :arg additive: Whether the accumulation should be additive or not.\n"
+ " :type time: bool\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_accumulate(Sound* self, PyObject* args)
@@ -677,19 +681,19 @@ Sound_accumulate(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
- "ADSR(attack,decay,sustain,release)\n\n"
- "Attack-Decay-Sustain-Release envelopes the volume of a sound. "
- "Note: there is currently no way to trigger the release with this API.\n\n"
- ":arg attack: The attack time in seconds.\n"
- ":type attack: float\n"
- ":arg decay: The decay time in seconds.\n"
- ":type decay: float\n"
- ":arg sustain: The sustain level.\n"
- ":type sustain: float\n"
- ":arg release: The release level.\n"
- ":type release: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: ADSR(attack, decay, sustain, release)\n\n"
+ " 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"
+ " :arg attack: The attack time in seconds.\n"
+ " :type attack: float\n"
+ " :arg decay: The decay time in seconds.\n"
+ " :type decay: float\n"
+ " :arg sustain: The sustain level.\n"
+ " :type sustain: float\n"
+ " :arg release: The release level.\n"
+ " :type release: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_ADSR(Sound* self, PyObject* args)
@@ -720,14 +724,12 @@ Sound_ADSR(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_delay_doc,
- "delay(time)\n\n"
- "Delays by playing adding silence in front of the other sound's "
- "data.\n\n"
- ":arg time: How many seconds of silence should be added before "
- "the sound.\n"
- ":type time: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: delay(time)\n\n"
+ " Delays by playing adding silence in front of the other sound's data.\n\n"
+ " :arg time: How many seconds of silence should be added before the sound.\n"
+ " :type time: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_delay(Sound* self, PyObject* args)
@@ -758,19 +760,18 @@ Sound_delay(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
- "envelope(attack, release, threshold, arthreshold)\n\n"
- "Delays by playing adding silence in front of the other sound's "
- "data.\n\n"
- ":arg attack: The attack factor.\n"
- ":type attack: float\n"
- ":arg release: The release factor.\n"
- ":type release: float\n"
- ":arg threshold: The general threshold value.\n"
- ":type threshold: float\n"
- ":arg arthreshold: The attack/release threshold value.\n"
- ":type arthreshold: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: envelope(attack, release, threshold, arthreshold)\n\n"
+ " Delays by playing adding silence in front of the other sound's data.\n\n"
+ " :arg attack: The attack factor.\n"
+ " :type attack: float\n"
+ " :arg release: The release factor.\n"
+ " :type release: float\n"
+ " :arg threshold: The general threshold value.\n"
+ " :type threshold: float\n"
+ " :arg arthreshold: The attack/release threshold value.\n"
+ " :type arthreshold: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_envelope(Sound* self, PyObject* args)
@@ -801,16 +802,16 @@ Sound_envelope(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
- "fadein(start, length)\n\n"
- "Fades a sound in by raising the volume linearly in the given "
- "time interval.\n\n"
- ":arg start: Time in seconds when the fading should start.\n"
- ":type start: float\n"
- ":arg length: Time in seconds how long the fading should last.\n"
- ":type length: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: Before the fade starts it plays silence.");
+ ".. classmethod:: fadein(start, length)\n\n"
+ " Fades a sound in by raising the volume linearly in the given\n"
+ " time interval.\n\n"
+ " :arg start: Time in seconds when the fading should start.\n"
+ " :type start: float\n"
+ " :arg length: Time in seconds how long the fading should last.\n"
+ " :type length: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note:: Before the fade starts it plays silence.");
static PyObject *
Sound_fadein(Sound* self, PyObject* args)
@@ -841,17 +842,18 @@ Sound_fadein(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
- "fadeout(start, length)\n\n"
- "Fades a sound in by lowering the volume linearly in the given "
- "time interval.\n\n"
- ":arg start: Time in seconds when the fading should start.\n"
- ":type start: float\n"
- ":arg length: Time in seconds how long the fading should last.\n"
- ":type length: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: After the fade this sound plays silence, so that "
- "the length of the sound is not altered.");
+ ".. classmethod:: fadeout(start, length)\n\n"
+ " Fades a sound in by lowering the volume linearly in the given\n"
+ " time interval.\n\n"
+ " :arg start: Time in seconds when the fading should start.\n"
+ " :type start: float\n"
+ " :arg length: Time in seconds how long the fading should last.\n"
+ " :type length: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " After the fade this sound plays silence, so that\n"
+ " the length of the sound is not altered.");
static PyObject *
Sound_fadeout(Sound* self, PyObject* args)
@@ -882,20 +884,20 @@ Sound_fadeout(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_filter_doc,
- "filter(b, a = (1))\n\n"
- "Filters a sound with the supplied IIR filter coefficients.\n"
- "Without the second parameter you'll get a FIR filter.\n"
- "If the first value of the a sequence is 0 it will be set to 1 "
- "automatically.\n"
- "If the first value of the a sequence is neither 0 nor 1, all "
- "filter coefficients will be scaled by this value so that it is 1 "
- "in the end, you don't have to scale yourself.\n\n"
- ":arg b: The nominator filter coefficients.\n"
- ":type b: sequence of float\n"
- ":arg a: The denominator filter coefficients.\n"
- ":type a: sequence of float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: filter(b, a = (1))\n\n"
+ " Filters a sound with the supplied IIR filter coefficients.\n"
+ " Without the second parameter you'll get a FIR filter.\n\n"
+ " If the first value of the a sequence is 0,\n"
+ " it will be set to 1 automatically.\n"
+ " 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\n"
+ " in the end, you don't have to scale yourself.\n\n"
+ " :arg b: The nominator filter coefficients.\n"
+ " :type b: sequence of float\n"
+ " :arg a: The denominator filter coefficients.\n"
+ " :type a: sequence of float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_filter(Sound* self, PyObject* args)
@@ -982,15 +984,15 @@ Sound_filter(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
- "highpass(frequency, Q=0.5)\n\n"
- "Creates a second order highpass filter based on the transfer "
- "function H(s) = s^2 / (s^2 + s/Q + 1)\n\n"
- ":arg frequency: The cut off trequency of the highpass.\n"
- ":type frequency: float\n"
- ":arg Q: Q factor of the lowpass.\n"
- ":type Q: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: highpass(frequency, Q=0.5)\n\n"
+ " Creates a second order highpass filter based on the transfer\n"
+ " function :math:`H(s) = s^2 / (s^2 + s/Q + 1)`\n\n"
+ " :arg frequency: The cut off trequency of the highpass.\n"
+ " :type frequency: float\n"
+ " :arg Q: Q factor of the lowpass.\n"
+ " :type Q: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_highpass(Sound* self, PyObject* args)
@@ -1022,14 +1024,14 @@ Sound_highpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_limit_doc,
- "limit(start, end)\n\n"
- "Limits a sound within a specific start and end time.\n\n"
- ":arg start: Start time in seconds.\n"
- ":type start: float\n"
- ":arg end: End time in seconds.\n"
- ":type end: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: limit(start, end)\n\n"
+ " Limits a sound within a specific start and end time.\n\n"
+ " :arg start: Start time in seconds.\n"
+ " :type start: float\n"
+ " :arg end: End time in seconds.\n"
+ " :type end: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_limit(Sound* self, PyObject* args)
@@ -1060,15 +1062,16 @@ Sound_limit(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_loop_doc,
- "loop(count)\n\n"
- "Loops a sound.\n\n"
- ":arg count: How often the sound should be looped. "
- "Negative values mean endlessly.\n"
- ":type count: integer\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: This is a filter function, you might consider using "
- ":attr:`Handle.loop_count` instead.");
+ ".. classmethod:: loop(count)\n\n"
+ " Loops a sound.\n\n"
+ " :arg count: How often the sound should be looped.\n"
+ " Negative values mean endlessly.\n"
+ " :type count: integer\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " This is a filter function, you might consider using\n"
+ " :attr:`Handle.loop_count` instead.");
static PyObject *
Sound_loop(Sound* self, PyObject* args)
@@ -1099,15 +1102,15 @@ Sound_loop(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
- "lowpass(frequency, Q=0.5)\n\n"
- "Creates a second order lowpass filter based on the transfer "
- "function H(s) = 1 / (s^2 + s/Q + 1)\n\n"
- ":arg frequency: The cut off trequency of the lowpass.\n"
- ":type frequency: float\n"
- ":arg Q: Q factor of the lowpass.\n"
- ":type Q: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: lowpass(frequency, Q=0.5)\n\n"
+ " Creates a second order lowpass filter based on the transfer "
+ " function :math:`H(s) = 1 / (s^2 + s/Q + 1)`\n\n"
+ " :arg frequency: The cut off trequency of the lowpass.\n"
+ " :type frequency: float\n"
+ " :arg Q: Q factor of the lowpass.\n"
+ " :type Q: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_lowpass(Sound* self, PyObject* args)
@@ -1139,14 +1142,15 @@ Sound_lowpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
- "modulate(sound)\n\n"
- "Modulates two factories.\n\n"
- ":arg sound: The sound to modulate over the other.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: modulate(sound)\n\n"
+ " Modulates two factories.\n\n"
+ " :arg sound: The sound to modulate over the other.\n"
+ " :type sound: :class:`Sound`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " The two factories have to have the same specifications\n"
+ " (channels and samplerate).");
static PyObject *
Sound_modulate(Sound* self, PyObject* object)
@@ -1180,17 +1184,19 @@ Sound_modulate(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
- "pitch(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"
- ":type factor: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: This is done by changing the sample rate of the "
- "underlying sound, which has to be an integer, so the factor "
- "value rounded and the factor may not be 100 % accurate.\n\n"
- ".. note:: This is a filter function, you might consider using "
- ":attr:`Handle.pitch` instead.");
+ ".. classmethod:: pitch(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"
+ " :type factor: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " This is done by changing the sample rate of the\n"
+ " underlying sound, which has to be an integer, so the factor\n"
+ " value rounded and the factor may not be 100 % accurate.\n\n"
+ " .. note::\n\n"
+ " This is a filter function, you might consider using\n"
+ " :attr:`Handle.pitch` instead.");
static PyObject *
Sound_pitch(Sound* self, PyObject* args)
@@ -1221,12 +1227,12 @@ Sound_pitch(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
- "rechannel(channels)\n\n"
- "Rechannels the sound.\n\n"
- ":arg channels: The new channel configuration.\n"
- ":type channels: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: rechannel(channels)\n\n"
+ " Rechannels the sound.\n\n"
+ " :arg channels: The new channel configuration.\n"
+ " :type channels: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_rechannel(Sound* self, PyObject* args)
@@ -1261,14 +1267,14 @@ Sound_rechannel(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_resample_doc,
- "resample(rate, high_quality)\n\n"
- "Resamples the sound.\n\n"
- ":arg rate: The new sample rate.\n"
- ":type rate: double\n"
- ":arg high_quality: When true use a higher quality but slower resampler.\n"
- ":type high_quality: bool\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: resample(rate, high_quality)\n\n"
+ " Resamples the sound.\n\n"
+ " :arg rate: The new sample rate.\n"
+ " :type rate: double\n"
+ " :arg high_quality: When true use a higher quality but slower resampler.\n"
+ " :type high_quality: bool\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_resample(Sound* self, PyObject* args)
@@ -1316,17 +1322,19 @@ Sound_resample(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
- "reverse()\n\n"
- "Plays a sound reversed.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The sound has to have a finite length and has to be "
- "seekable. It's recommended to use this only with factories with "
- "fast and accurate seeking, which is not true for encoded audio "
- "files, such ones should be buffered using :meth:`cache` before "
- "being played reversed.\n\n"
- ".. warning:: If seeking is not accurate in the underlying sound "
- "you'll likely hear skips/jumps/cracks.");
+ ".. classmethod:: reverse()\n\n"
+ " Plays a sound reversed.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " The sound has to have a finite length and has to be seekable.\n"
+ " It's recommended to use this only with factories with\n"
+ " fast and accurate seeking, which is not true for encoded audio\n"
+ " files, such ones should be buffered using :meth:`cache` before\n"
+ " being played reversed.\n\n"
+ " .. warning::\n\n"
+ " If seeking is not accurate in the underlying sound\n"
+ " you'll likely hear skips/jumps/cracks.");
static PyObject *
Sound_reverse(Sound* self)
@@ -1352,10 +1360,10 @@ Sound_reverse(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_sum_doc,
- "sum()\n\n"
- "Sums the samples of a sound.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sum()\n\n"
+ " Sums the samples of a sound.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sum(Sound* self)
@@ -1381,12 +1389,12 @@ Sound_sum(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
- "threshold(threshold = 0)\n\n"
- "Makes a threshold wave out of an audio wave by setting all samples "
- "with a amplitude >= threshold to 1, all <= -threshold to -1 and "
- "all between to 0.\n\n"
- ":arg threshold: Threshold value over which an amplitude counts "
- "non-zero.\n"
+ ".. classmethod:: threshold(threshold = 0)\n\n"
+ " 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\n"
+ " all between to 0.\n\n"
+ " :arg threshold: Threshold value over which an amplitude counts\n"
+ " non-zero.\n"
":type threshold: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
@@ -1420,15 +1428,16 @@ Sound_threshold(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_volume_doc,
- "volume(volume)\n\n"
- "Changes the volume of a sound.\n\n"
- ":arg volume: The new volume..\n"
- ":type volume: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\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 "
- ":attr:`Handle.volume` instead.");
+ ".. classmethod:: volume(volume)\n\n"
+ " Changes the volume of a sound.\n\n"
+ " :arg volume: The new volume..\n"
+ " :type volume: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note:: Should be in the range [0, 1] to avoid clipping.\n\n"
+ " .. note::\n\n"
+ " This is a filter function, you might consider using\n"
+ " :attr:`Handle.volume` instead.");
static PyObject *
Sound_volume(Sound* self, PyObject* args)
@@ -1459,14 +1468,15 @@ Sound_volume(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_join_doc,
- "join(sound)\n\n"
- "Plays two factories in sequence.\n\n"
- ":arg sound: The sound to play second.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: join(sound)\n\n"
+ " Plays two factories in sequence.\n\n"
+ " :arg sound: The sound to play second.\n"
+ " :type sound: :class:`Sound`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " The two factories have to have the same specifications\n"
+ " (channels and samplerate).");
static PyObject *
Sound_join(Sound* self, PyObject* object)
@@ -1501,14 +1511,15 @@ Sound_join(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_mix_doc,
- "mix(sound)\n\n"
- "Mixes two factories.\n\n"
- ":arg sound: The sound to mix over the other.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: mix(sound)\n\n"
+ " Mixes two factories.\n\n"
+ " :arg sound: The sound to mix over the other.\n"
+ " :type sound: :class:`Sound`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " The two factories have to have the same specifications\n"
+ " (channels and samplerate).");
static PyObject *
Sound_mix(Sound* self, PyObject* object)
@@ -1542,11 +1553,11 @@ Sound_mix(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
- "pingpong()\n\n"
- "Plays a sound forward and then backward.\n"
- "This is like joining a sound with its reverse.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: pingpong()\n\n"
+ " Plays a sound forward and then backward.\n"
+ " This is like joining a sound with its reverse.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_pingpong(Sound* self)
@@ -1572,12 +1583,12 @@ Sound_pingpong(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_doc,
- "list()\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"
- ":type random: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: list()\n\n"
+ " Creates an empty sound list that can contain several sounds.\n\n"
+ " :arg random: whether the playback will be random or not.\n"
+ " :type random: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_list(PyTypeObject* type, PyObject* args)
@@ -1608,11 +1619,11 @@ Sound_list(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
- "mutable()\n\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"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: mutable()\n\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"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_mutable(Sound* self)
@@ -1638,12 +1649,12 @@ Sound_mutable(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
- "addSound(sound)\n\n"
- "Adds a new sound to a sound list.\n\n"
- ":arg sound: The sound that will be added to the list.\n"
- ":type sound: :class:`Sound`\n\n"
- ".. note:: You can only add a sound to a sound list.");
-
+ ".. classmethod:: addSound(sound)\n\n"
+ " Adds a new sound to a sound list.\n\n"
+ " :arg sound: The sound that will be added to the list.\n"
+ " :type sound: :class:`Sound`\n\n"
+ " .. note:: You can only add a sound to a sound list.");
+
static PyObject *
Sound_list_addSound(Sound* self, PyObject* object)
{
@@ -1671,14 +1682,14 @@ Sound_list_addSound(Sound* self, PyObject* object)
#ifdef WITH_CONVOLUTION
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
- "convolver()\n\n"
- "Creates a sound that will apply convolution to another sound.\n\n"
- ":arg impulseResponse: The filter with which convolve the sound.\n"
- ":type impulseResponse: :class:`ImpulseResponse`\n"
- ":arg threadPool: A thread pool used to parallelize convolution.\n"
- ":type threadPool: :class:`ThreadPool`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: convolver()\n\n"
+ " Creates a sound that will apply convolution to another sound.\n\n"
+ " :arg impulseResponse: The filter with which convolve the sound.\n"
+ " :type impulseResponse: :class:`ImpulseResponse`\n"
+ " :arg threadPool: A thread pool used to parallelize convolution.\n"
+ " :type threadPool: :class:`ThreadPool`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_convolver(Sound* self, PyObject* args)
@@ -1720,16 +1731,16 @@ Sound_convolver(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
- "convolver()\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"
- ":type hrtf: :class:`HRTF`\n"
- ":arg source: An object representing the source position of the sound.\n"
- ":type source: :class:`Source`\n"
- ":arg threadPool: A thread pool used to parallelize convolution.\n"
- ":type threadPool: :class:`ThreadPool`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: convolver()\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"
+ " :type hrtf: :class:`HRTF`\n"
+ " :arg source: An object representing the source position of the sound.\n"
+ " :type source: :class:`Source`\n"
+ " :arg threadPool: A thread pool used to parallelize convolution.\n"
+ " :type threadPool: :class:`ThreadPool`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_binaural(Sound* self, PyObject* args)