Audaspace: porting changes from upstream.

This commit is contained in:
Jörg Müller 2023-05-25 23:00:22 +02:00
parent 72309be398
commit e98c26dece
9 changed files with 58 additions and 57 deletions

View File

@ -24,3 +24,4 @@ Several people provided fixes:
- Aaron Carlisle
- Sebastian Parborg
- Leon Zandman
- Richard Antalik

View File

@ -124,7 +124,7 @@ Device_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_lock_doc,
".. classmethod:: lock()\n\n"
".. method:: lock()\n\n"
" Locks the device so that it's guaranteed, that no samples are\n"
" read from the streams until :meth:`unlock` is called.\n"
" This is useful if you want to do start/stop/pause/resume some\n"
@ -152,7 +152,7 @@ Device_lock(Device* self)
}
PyDoc_STRVAR(M_aud_Device_play_doc,
".. classmethod:: play(sound, keep=False)\n\n"
".. method:: play(sound, keep=False)\n\n"
" Plays a sound.\n\n"
" :arg sound: The sound to play.\n"
" :type sound: :class:`Sound`\n"
@ -212,7 +212,7 @@ Device_play(Device* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_stopAll_doc,
".. classmethod:: stopAll()\n\n"
".. method:: stopAll()\n\n"
" Stops all playing and paused sounds.");
static PyObject *
@ -231,7 +231,7 @@ Device_stopAll(Device* self)
}
PyDoc_STRVAR(M_aud_Device_unlock_doc,
".. classmethod:: unlock()\n\n"
".. method:: unlock()\n\n"
" Unlocks the device after a lock call, see :meth:`lock` for\n"
" details.");

View File

@ -60,7 +60,7 @@ DynamicMusic_dealloc(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addScene_doc,
".. classmethod:: addScene(scene)\n\n"
".. method:: addScene(scene)\n\n"
" Adds a new scene.\n\n"
" :arg scene: The scene sound.\n"
" :type scene: :class:`Sound`\n"
@ -90,7 +90,7 @@ DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addTransition_doc,
".. classmethod:: addTransition(ini, end, transition)\n\n"
".. method:: addTransition(ini, end, transition)\n\n"
" Adds a new scene.\n\n"
" :arg ini: the initial scene foor the transition.\n"
" :type ini: int\n"
@ -125,7 +125,7 @@ DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_resume_doc,
".. classmethod:: resume()\n\n"
".. method:: resume()\n\n"
" Resumes playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
@ -145,7 +145,7 @@ DynamicMusic_resume(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_pause_doc,
".. classmethod:: pause()\n\n"
".. method:: pause()\n\n"
" Pauses playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
@ -165,7 +165,7 @@ DynamicMusic_pause(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_stop_doc,
".. classmethod:: stop()\n\n"
".. method:: stop()\n\n"
" Stops playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool\n\n");

View File

@ -54,7 +54,7 @@ HRTF_dealloc(HRTFP* self)
}
PyDoc_STRVAR(M_aud_HRTF_addImpulseResponse_doc,
".. classmethod:: addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
".. method:: addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
" Adds a new hrtf to the HRTF object\n\n"
" :arg sound: The sound that contains the hrtf.\n"
" :type sound: :class:`Sound`\n"
@ -90,7 +90,7 @@ HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadLeftHrtfSet_doc,
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
".. method:: loadLeftHrtfSet(extension, directory)\n\n"
" Loads all HRTFs from a directory.\n\n"
" :arg extension: The file extension of the hrtfs.\n"
" :type extension: string\n"
@ -125,7 +125,7 @@ HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadRightHrtfSet_doc,
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
".. method:: loadLeftHrtfSet(extension, directory)\n\n"
" Loads all HRTFs from a directory.\n\n"
" :arg extension: The file extension of the hrtfs.\n"
" :type extension: string\n"

View File

@ -38,7 +38,7 @@ Handle_dealloc(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_pause_doc,
".. classmethod:: pause()\n\n"
".. method:: pause()\n\n"
" Pauses playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
@ -58,7 +58,7 @@ Handle_pause(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_resume_doc,
".. classmethod:: resume()\n\n"
".. method:: resume()\n\n"
" Resumes playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
@ -78,7 +78,7 @@ Handle_resume(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_stop_doc,
".. classmethod:: stop()\n\n"
".. method:: stop()\n\n"
" Stops playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool\n\n"

View File

@ -60,7 +60,7 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
}
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
".. classmethod:: play(sound, catKey)\n\n"
".. method:: play(sound, catKey)\n\n"
" Plays a sound through the playback manager and assigns it to a category.\n\n"
" :arg sound: The sound to play.\n"
" :type sound: :class:`Sound`\n"
@ -104,7 +104,7 @@ PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_resume_doc,
".. classmethod:: resume(catKey)\n\n"
".. method:: resume(catKey)\n\n"
" Resumes playback of the catgory.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
@ -131,7 +131,7 @@ PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_pause_doc,
".. classmethod:: pause(catKey)\n\n"
".. method:: pause(catKey)\n\n"
" Pauses playback of the category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
@ -158,7 +158,7 @@ PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_add_category_doc,
".. classmethod:: addCategory(volume)\n\n"
".. method:: addCategory(volume)\n\n"
" Adds a category with a custom volume.\n\n"
" :arg volume: The volume for ther new category.\n"
" :type volume: float\n"
@ -185,7 +185,7 @@ PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_get_volume_doc,
".. classmethod:: getVolume(catKey)\n\n"
".. method:: getVolume(catKey)\n\n"
" Retrieves the volume of a category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
@ -212,7 +212,7 @@ PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_set_volume_doc,
".. classmethod:: setVolume(volume, catKey)\n\n"
".. method:: setVolume(volume, catKey)\n\n"
" Changes the volume of a category.\n\n"
" :arg volume: the new volume value.\n"
" :type volume: float\n"
@ -242,7 +242,7 @@ PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_stop_doc,
".. classmethod:: stop(catKey)\n\n"
".. method:: stop(catKey)\n\n"
" Stops playback of the category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
@ -269,7 +269,7 @@ PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_clean_doc,
".. classmethod:: clean()\n\n"
".. method:: clean()\n\n"
" Cleans all the invalid and finished sound from the playback manager.\n\n");
static PyObject *

View File

@ -99,7 +99,7 @@ Sequence_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_add_doc,
".. classmethod:: add()\n\n"
".. method:: add()\n\n"
" Adds a new entry to the sequence.\n\n"
" :arg sound: The sound this entry should play.\n"
" :type sound: :class:`Sound`\n"
@ -151,7 +151,7 @@ Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_remove_doc,
".. classmethod:: remove()\n\n"
".. method:: remove()\n\n"
" Removes an entry from the sequence.\n\n"
" :arg entry: The entry to remove.\n"
" :type entry: :class:`SequenceEntry`\n");
@ -183,7 +183,7 @@ Sequence_remove(Sequence* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sequence_setAnimationData_doc,
".. classmethod:: setAnimationData()\n\n"
".. method:: setAnimationData()\n\n"
" Writes animation data to a sequence.\n\n"
" :arg type: The type of animation data.\n"
" :type type: int\n"

View File

@ -43,7 +43,7 @@ SequenceEntry_dealloc(SequenceEntry* self)
}
PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
".. classmethod:: move()\n\n"
".. method:: move()\n\n"
" Moves the entry.\n\n"
" :arg begin: The new start time.\n"
" :type begin: double\n"
@ -73,7 +73,7 @@ SequenceEntry_move(SequenceEntry* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_SequenceEntry_setAnimationData_doc,
".. classmethod:: setAnimationData()\n\n"
".. method:: setAnimationData()\n\n"
" Writes animation data to a sequenced entry.\n\n"
" :arg type: The type of animation data.\n"
" :type type: int\n"

View File

@ -115,7 +115,7 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_data_doc,
".. classmethod:: data()\n\n"
".. method:: 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"
@ -146,7 +146,7 @@ Sound_data(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_write_doc,
".. classmethod:: write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
".. method:: 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"
@ -357,7 +357,7 @@ Sound_buffer(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_cache_doc,
".. classmethod:: cache()\n\n"
".. method:: 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"
@ -631,7 +631,7 @@ Sound_triangle(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
".. classmethod:: accumulate(additive=False)\n\n"
".. method:: 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"
@ -683,7 +683,7 @@ Sound_accumulate(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
".. classmethod:: ADSR(attack, decay, sustain, release)\n\n"
".. method:: 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"
@ -726,7 +726,7 @@ Sound_ADSR(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_delay_doc,
".. classmethod:: delay(time)\n\n"
".. method:: 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"
@ -762,7 +762,7 @@ Sound_delay(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
".. classmethod:: envelope(attack, release, threshold, arthreshold)\n\n"
".. method:: 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"
@ -804,7 +804,7 @@ Sound_envelope(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
".. classmethod:: fadein(start, length)\n\n"
".. method:: 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"
@ -844,7 +844,7 @@ Sound_fadein(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
".. classmethod:: fadeout(start, length)\n\n"
".. method:: 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"
@ -886,7 +886,7 @@ Sound_fadeout(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_filter_doc,
".. classmethod:: filter(b, a = (1))\n\n"
".. method:: 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"
@ -986,7 +986,7 @@ Sound_filter(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
".. classmethod:: highpass(frequency, Q=0.5)\n\n"
".. method:: 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"
@ -1026,7 +1026,7 @@ Sound_highpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_limit_doc,
".. classmethod:: limit(start, end)\n\n"
".. method:: 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"
@ -1064,7 +1064,7 @@ Sound_limit(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_loop_doc,
".. classmethod:: loop(count)\n\n"
".. method:: loop(count)\n\n"
" Loops a sound.\n\n"
" :arg count: How often the sound should be looped.\n"
" Negative values mean endlessly.\n"
@ -1104,7 +1104,7 @@ Sound_loop(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
".. classmethod:: lowpass(frequency, Q=0.5)\n\n"
".. method:: 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"
@ -1144,7 +1144,7 @@ Sound_lowpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
".. classmethod:: modulate(sound)\n\n"
".. method:: modulate(sound)\n\n"
" Modulates two factories.\n\n"
" :arg sound: The sound to modulate over the other.\n"
" :type sound: :class:`Sound`\n"
@ -1186,7 +1186,7 @@ Sound_modulate(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
".. classmethod:: pitch(factor)\n\n"
".. method:: 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"
@ -1229,7 +1229,7 @@ Sound_pitch(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
".. classmethod:: rechannel(channels)\n\n"
".. method:: rechannel(channels)\n\n"
" Rechannels the sound.\n\n"
" :arg channels: The new channel configuration.\n"
" :type channels: int\n"
@ -1269,7 +1269,7 @@ Sound_rechannel(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_resample_doc,
".. classmethod:: resample(rate, high_quality)\n\n"
".. method:: resample(rate, high_quality)\n\n"
" Resamples the sound.\n\n"
" :arg rate: The new sample rate.\n"
" :type rate: double\n"
@ -1324,7 +1324,7 @@ Sound_resample(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
".. classmethod:: reverse()\n\n"
".. method:: reverse()\n\n"
" Plays a sound reversed.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
@ -1362,7 +1362,7 @@ Sound_reverse(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_sum_doc,
".. classmethod:: sum()\n\n"
".. method:: sum()\n\n"
" Sums the samples of a sound.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
@ -1391,7 +1391,7 @@ Sound_sum(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
".. classmethod:: threshold(threshold = 0)\n\n"
".. method:: 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"
@ -1430,7 +1430,7 @@ Sound_threshold(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_volume_doc,
".. classmethod:: volume(volume)\n\n"
".. method:: volume(volume)\n\n"
" Changes the volume of a sound.\n\n"
" :arg volume: The new volume..\n"
" :type volume: float\n"
@ -1471,7 +1471,7 @@ Sound_volume(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_join_doc,
".. classmethod:: join(sound)\n\n"
".. method:: join(sound)\n\n"
" Plays two factories in sequence.\n\n"
" :arg sound: The sound to play second.\n"
" :type sound: :class:`Sound`\n"
@ -1514,7 +1514,7 @@ Sound_join(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_mix_doc,
".. classmethod:: mix(sound)\n\n"
".. method:: mix(sound)\n\n"
" Mixes two factories.\n\n"
" :arg sound: The sound to mix over the other.\n"
" :type sound: :class:`Sound`\n"
@ -1556,7 +1556,7 @@ Sound_mix(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
".. classmethod:: pingpong()\n\n"
".. method:: 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"
@ -1622,7 +1622,7 @@ Sound_list(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
".. classmethod:: mutable()\n\n"
".. method:: 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"
@ -1652,7 +1652,7 @@ Sound_mutable(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
".. classmethod:: addSound(sound)\n\n"
".. method:: 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"
@ -1685,7 +1685,7 @@ Sound_list_addSound(Sound* self, PyObject* object)
#ifdef WITH_CONVOLUTION
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
".. classmethod:: convolver()\n\n"
".. method:: 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"
@ -1734,7 +1734,7 @@ Sound_convolver(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
".. classmethod:: convolver()\n\n"
".. method:: binaural()\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"