Skip to content

Commit 6184e8d

Browse files
committed
Mention typical range of sample values in documentation (closes #75)
1 parent 3526a52 commit 6184e8d

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/processing/sound/AudioSample.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ public AudioSample(PApplet parent, int frames, boolean stereo) {
5151
* typically use "this"
5252
* @param frames
5353
* the desired number of frames for this audiosample
54-
* @param frameRate
55-
* the underlying frame rate of the sample (default: 44100)
54+
* @param data
55+
* an array of float values to be used as this audiosample's sound
56+
* data. The audiosample will consequently have as many frames as the
57+
* length of the given array. To match the default amplitude of
58+
* other sound generators, the sample values should be in the range
59+
* <code>[-0.5, 0.5]</code>
5660
* @param stereo
5761
* whether to treat the audiosample as 2-channel (stereo) or not
58-
* (default: false)
62+
* (default: <code>false</code>)
63+
* @param frameRate
64+
* the underlying frame rate of the sample (default: 44100)
5965
* @webref Sampling:AudioSample
6066
* @webBrief Allocate a new audiosample buffer with the given number of frames.
6167
*/
@@ -74,12 +80,6 @@ public AudioSample(PApplet parent, int frames, int frameRate) {
7480
// duration)?
7581
// risk of accidental overloading through int/float, but could be interesting..
7682

77-
/**
78-
* @param data
79-
* an array of float values to be used as this audiosample's sound
80-
* data. The audiosample will consequently have as many frames as the
81-
* length of the given array.
82-
*/
8383
public AudioSample(PApplet parent, float[] data) {
8484
this(parent, data, false);
8585
}

src/processing/sound/Waveform.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
/**
1010
* This is a Waveform analyzer. It returns the waveform of an
1111
* audio stream the moment it is queried with the <b>analyze()</b>
12-
* method.
12+
* method.<br/>
13+
* Note that by default all sound generators (including microphone capture from
14+
* <code>AudioIn</code>) have an amplitude of 1, which means that the values of
15+
* their waveform will be numbers in the range <code>[-0.5, 0.5]</code>.
1316
*
1417
* @author icalvin102
1518
*
1619
* @webref Analysis:Waveform
17-
* @webBrief This is a Waveform analyzer.
20+
* @webBrief Inspects the underlying soundwave of an audio signal.
1821
**/
1922
public class Waveform extends Analyzer {
2023

0 commit comments

Comments
 (0)