AudioOutput 是神马?
AudioOutput
是与计算机声卡输出的连接。
通常,我们连接的设备是计算机的扬声器。你可使用AudioOutput
,通过将UGens
添加到输出对象来实时声音合成。
倘若要从 Minim 获取AudioOutput
,你可以调用以下五种方法之一:
AudioOutput getLineOut()
// type 指定为 Minim.MONO 或 Minim.STEREO
AudioOutput getLineOut(int type)
// bufferSize 是你获得输出的左、右和混合缓冲区的大小
AudioOutput getLineOut(int type, int bufferSize)
// sampleRate 是对某采样率输出的请求
AudioOutput getLineOut(int type, int bufferSize, float sampleRate)
// bitDepth 是对某位深度输出的请求
AudioInput getLineOut(int type, int bufferSize, float sampleRate, int bitDepth)
如果请求的参数不存在,Minim 则会报错并返回null
。 故我们常用上面列出的前两种方法。
除直接将UGens
添加到输出外,你还可以在将来的某时间安排输出播放“notes”。在编写算法音乐和声音时,这可能非常强大。有关更多信息,请参阅playNote
方法。
Related:
Example:
AudioOutput 旗下:Fields
我是一文不值,狗屁不如。你呢,就有如狗屁,值得一闻!——金庸 《鹿鼎记》
接下来,好吧,我们详细解释一番……
left
——左声道
Description:
AudioBuffer
包含左声道样本。若其为单声道声音,则其包含单声道音频。
Signature:
AudioBuffer left
Related:
Example:
mix
——混合声道
Description:
AudioBuffer
包含左右声道的混合样本。 若其为单声道声音,则mix
包含与left
相同的样本。
Signature:
AudioBuffer mix
Related:
Example:
right
——右声道
Description:
AudioBuffer
包含右声道样本。 若其为单声道声音,则right
包含与left
相同的样本。
Signature:
AudioBuffer right
Related:
Example:
AudioInput 旗下:Methods
书到用时方恨少,肉到肥时方恨多。——金庸 《鹿鼎记》
好吧,我们有些啥:
addListener()
bufferSize()
getBalance()
getDurationFactor)
getFormat()
getGain()
getNoteOffset()
getPan()
getTempo()
getVolume()
isMuted()
mute()
pauseNotes()
playNote()
removeListener()
resumeNotes()
sampleRate()
setBalance()
setDurationFactor()
setGain()
setNoteOffset()
setPan()
setTempo()
setVolume()
shiftBalance()
shiftGain()
shiftPan()