Processing, 类Waveform
用法介绍。
构造函数
Waveform(parent, nsamples)
参数
parent
通常使用"this"nsamples
您希望一次能够读取的波形样本数(正整数)。
说明
这是一个波形分析仪。它在使用analyze()
方法查询音频流时返回其波形。
例子
import processing.sound.*;
SoundFile sample;
Waveform waveform;
int samples = 100;
public void setup()
{
size(640, 360);
background(255);
sample = new SoundFile(this, "beat.aiff");
sample.loop();
waveform = new Waveform(this, samples);
waveform.input(sample);
}
public void draw()
{
background(0);
stroke(255);
strokeWeight(2);
noFill();
waveform.analyze();
beginShape();
for(int i = 0; i < samples; i++)
{
vertex(
map(i, 0, samples, 0, width),
map(waveform.data[i], -1, 1, 0, height)
);
}
endShape();
}
相关用法
- Processing WhiteNoise.add()用法及代码示例
- Processing WhiteNoise用法及代码示例
- Processing WhiteNoise.set()用法及代码示例
- Processing WhiteNoise.amp()用法及代码示例
- Processing WhiteNoise.pan()用法及代码示例
- Processing WhiteNoise.stop()用法及代码示例
- Processing WhiteNoise.play()用法及代码示例
- Processing FFT用法及代码示例
- Processing SawOsc.pan()用法及代码示例
- Processing FloatDict用法及代码示例
- Processing FFT.stop()用法及代码示例
- Processing join()用法及代码示例
- Processing () (parentheses)用法及代码示例
- Processing Pulse用法及代码示例
- Processing PShader用法及代码示例
- Processing PVector.set()用法及代码示例
- Processing FloatDict.sortKeysReverse()用法及代码示例
- Processing texture()用法及代码示例
- Processing IntDict.add()用法及代码示例
- Processing PShape.enableStyle()用法及代码示例
- Processing FloatDict.sub()用法及代码示例
- Processing String用法及代码示例
- Processing PImage.pixels[]用法及代码示例
- Processing vertex()用法及代码示例
- Processing PVector.mag()用法及代码示例
注:本文由纯净天空筛选整理自processing.org大神的英文原创作品 Waveform。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。