 |
 |
 |
| Class |
|
Sample |
 |
|
|
| Name |
|
play() |
 |
|
|
| Examples |
|
// Play a sample once.
// 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.play();
}
public void stop(){
Sonia.stop();
super.stop();
}
|
|
|
| Description |
|
Plays the sample one time. 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.play()
mySample.play(startFrame, endFrame)
|
 |
|
|
| Parameters |
|
| 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 |
|
repeat() repeatNum() stop() |