Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aab09e5

Browse filesBrowse files
committed
Update Sound lib AudioSample and SoundFile XML doc
1 parent eb468b3 commit aab09e5
Copy full SHA for aab09e5

File tree

Expand file treeCollapse file tree

7 files changed

+122
-53
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

7 files changed

+122
-53
lines changed
Open diff view settings
Collapse file
+37Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
4+
<name>cue()</name>
5+
6+
<category>Sound Files</category>
7+
8+
<subcategory></subcategory>
9+
10+
<usage>Web &amp; Application</usage>
11+
12+
<example>
13+
<image></image>
14+
<code><![CDATA[
15+
import processing.sound.*;
16+
AudioSample sample;
17+
18+
void setup() {
19+
size(640, 360);
20+
background(255);
21+
22+
// Create a new audiosample
23+
sample = new AudioSample(this, 100000, 22050);
24+
file.cue(3.5);
25+
file.play();
26+
}
27+
28+
void draw() {
29+
}
30+
]]></code>
31+
</example>
32+
33+
<description><![CDATA[
34+
Cues the playhead to a fixed position in the audiosample. Note that cue() only affects the playhead for future calls to play(), but not to loop().
35+
]]></description>
36+
37+
</root>
Collapse file
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
4+
<name>jump()</name>
5+
6+
<category>Sound Files</category>
7+
8+
<subcategory></subcategory>
9+
10+
<usage>Web &amp; Application</usage>
11+
12+
<example>
13+
<image></image>
14+
<code><![CDATA[
15+
import processing.sound.*;
16+
AudioSample sample;
17+
18+
void setup() {
19+
size(640, 360);
20+
background(255);
21+
22+
// Create a new audiosample
23+
sample = new AudioSample(this, 100000, 22050);
24+
sample.jump(3.5);
25+
}
26+
27+
void draw() {
28+
}
29+
]]></code>
30+
</example>
31+
32+
<description><![CDATA[
33+
Jump to a specific position in the audiosample while continuing to play (or starting to play if it wasn't playing already).
34+
]]></description>
35+
36+
</root>
Collapse file

‎content/api_en/LIB_sound/AudioSample_pause.xml‎

Copy file name to clipboardExpand all lines: content/api_en/LIB_sound/AudioSample_pause.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void setup() {
2828
2929
// Create the audiosample based on the data, set framerate to play 200 oscillations/second
3030
sample = new AudioSample(this, sinewave, 200 * resolution);
31-
sample.loop();
31+
sample.play();
3232
}
3333
3434
void draw() {
@@ -38,7 +38,7 @@ void mousePressed() {
3838
if (sample.isPlaying()) {
3939
sample.pause();
4040
} else {
41-
sample.loop();
41+
sample.play();
4242
}
4343
}
4444
]]></code>
Collapse file

‎content/api_en/LIB_sound/SoundFile_cue.xml‎

Copy file name to clipboardExpand all lines: content/api_en/LIB_sound/SoundFile_cue.xml
+1-17Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,11 @@ void setup() {
2727
2828
void draw() {
2929
}
30-
3130
]]></code>
3231
</example>
3332

3433
<description><![CDATA[
35-
Cues the playhead to a fixed position in the soundfile.
34+
Cues the playhead to a fixed position in the soundfile. Note that cue() only affects the playhead for future calls to play(), but not to loop().
3635
]]></description>
3736

38-
<syntax>
39-
<c>file</c>.cue(second)
40-
</syntax>
41-
42-
<returns></returns>
43-
44-
<related></related>
45-
46-
<availability>1.0</availability>
47-
48-
<type>Method</type>
49-
50-
<partof>Library</partof>
51-
52-
5337
</root>
Collapse file

‎content/api_en/LIB_sound/SoundFile_jump.xml‎

Copy file name to clipboardExpand all lines: content/api_en/LIB_sound/SoundFile_jump.xml
+1-17Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,11 @@ void setup() {
2626
2727
void draw() {
2828
}
29-
3029
]]></code>
3130
</example>
3231

3332
<description><![CDATA[
34-
Jump to a specific position in the soundfile while continuing to play.
33+
Jump to a specific position in the soundfile while continuing to play (or starting to play if it wasn't playing already).
3534
]]></description>
3635

37-
<syntax>
38-
<c>file</c>.jump(second)
39-
</syntax>
40-
41-
<returns></returns>
42-
43-
<related></related>
44-
45-
<availability>1.0</availability>
46-
47-
<type>Method</type>
48-
49-
<partof>Library</partof>
50-
51-
5236
</root>
Collapse file
+44Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
4+
<name>pause()</name>
5+
6+
<category>Sound Files</category>
7+
8+
<subcategory></subcategory>
9+
10+
<usage>Web &amp; Application</usage>
11+
12+
<example>
13+
<image></image>
14+
<code><![CDATA[
15+
import processing.sound.*;
16+
SoundFile file;
17+
18+
void setup() {
19+
size(640, 360);
20+
background(255);
21+
22+
// Load a soundfile from the /data folder of the sketch and play it back
23+
file = new SoundFile(this, "sample.mp3");
24+
file.play();
25+
}
26+
27+
void draw() {
28+
}
29+
30+
void mousePressed() {
31+
if (file.isPlaying()) {
32+
file.pause();
33+
} else {
34+
file.play();
35+
}
36+
}
37+
]]></code>
38+
</example>
39+
40+
<description><![CDATA[
41+
Stop the playback of the file, but cue it to the current position. The next call to play() will continue playing where it left off.
42+
]]></description>
43+
44+
</root>
Collapse file

‎content/api_en/LIB_sound/SoundFile_play.xml‎

Copy file name to clipboardExpand all lines: content/api_en/LIB_sound/SoundFile_play.xml
+1-17Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,11 @@ void setup() {
2626
2727
void draw() {
2828
}
29-
3029
]]></code>
3130
</example>
3231

3332
<description><![CDATA[
34-
Starts the playback of the soundfile. Only plays the soundfile once.
33+
Starts the playback of the soundfile. Only plays to the end of the soundfile once.
3534
]]></description>
3635

37-
<syntax>
38-
<c>file</c>.play()
39-
</syntax>
40-
41-
<returns></returns>
42-
43-
<related></related>
44-
45-
<availability>1.0</availability>
46-
47-
<type>Method</type>
48-
49-
<partof>Library</partof>
50-
51-
5236
</root>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.