 |
 |
 |
| Class |
|
Sample |
 |
|
|
| Name |
|
repeatNum() |
 |
|
|
| Examples |
|
// Loop a sample a 4 number of times.
// Notes: Make sure to include the specified audio file in your project's 'data' folder.
Sample mySample;
void setup() {
size(100,100);
Sonia.start(this);
mySample = new Sample("sine.aiff");
mySample.repeatNum(4);
}
public void stop(){
Sonia.stop();
super.stop();
}
|
|
|
| Description |
|
Loops the sample a specified number of times. If a range is specified the sample will play from the start frame to the end frame. A 44.1 kHz sample has 44100 frames per second. For example, frame 88200 would mark the two-second point in the sample. |
 |
|
|
| Syntax |
|
mySample.repeatNum(loopNum)
mySample.repeat(loopNum, startFrame, endFrame)
|
 |
|
|
| Parameters |
|
| loopNum |
|
int
|
| startFrame |
|
int: from 0 to the number of frames in the sample
|
| endFrame |
|
int: from 0 to the number of frames in the sample
|
|
 |
|
|
| Returns |
|
None |
 |
|
|
| Usage |
|
Web & Application |
 |
|
|
| Related |
|
play() repeat() stop() |