[Bf-blender-cvs] [899bfdc412e] master: Audaspace: Update From Upstream (For API Docs)

Aaron Carlisle noreply at git.blender.org
Mon Mar 30 23:47:48 CEST 2020


Commit: 899bfdc412e413e6ab6121d822753bb3ea2df849
Author: Aaron Carlisle
Date:   Mon Mar 30 17:44:55 2020 -0400
Branches: master
https://developer.blender.org/rB899bfdc412e413e6ab6121d822753bb3ea2df849

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

===================================================================

M	extern/audaspace/bindings/doc/tutorials.rst
M	extern/audaspace/bindings/python/PyDevice.cpp
M	extern/audaspace/bindings/python/PyDynamicMusic.cpp
M	extern/audaspace/bindings/python/PyHRTF.cpp
M	extern/audaspace/bindings/python/PyHandle.cpp
M	extern/audaspace/bindings/python/PyPlaybackManager.cpp
M	extern/audaspace/bindings/python/PySequence.cpp
M	extern/audaspace/bindings/python/PySequenceEntry.cpp
M	extern/audaspace/bindings/python/PySound.cpp

===================================================================

diff --git a/extern/audaspace/bindings/doc/tutorials.rst b/extern/audaspace/bindings/doc/tutorials.rst
index 55f51d9ee2f..2a0e7541861 100644
--- a/extern/audaspace/bindings/doc/tutorials.rst
+++ b/extern/audaspace/bindings/doc/tutorials.rst
@@ -4,35 +4,51 @@ Tutorials
 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
 -----------
 
-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
 
    #!/usr/bin/python
    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
 
    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
 
    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
 
@@ -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.
 
-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
 
    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
 
@@ -55,29 +77,47 @@ Now if we do nothing else anymore the application will quit immediately, so we w
 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
 
    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
 
    while handle.status:
    	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
 -----
 
-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
 
@@ -88,27 +128,35 @@ We start off again with importing the modules we need and we also define some pr
 
    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
 
    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)
 
-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
 
    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
 
    handle = device.play(sound)
    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
 
@@ -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)]
 
-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 th

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list