duration(sound)
duration()所属R语言包:sound
Duration of a Sample Object
时间的样品对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Get or set the duration (in seconds) of a Sample object or a wav file.
获取或设置一个Sample对象或WAV文件的持续时间(以秒计)。
用法----------Usage----------
duration(s) <- value
setDuration(s,value)
参数----------Arguments----------
参数:s
a Sample object, or a string giving the name of a wav file.
样品对象,或者一个字符串,给出一个wav文件的名称。
参数:value
a double giving the duration in seconds.
一个双给人以秒为单位的持续时间。
Details
详细信息----------Details----------
The replacement form can be used to reset the duration of the Sample object (here, filenames are not accepted).
替换形式可以被用来重置Sample对象的持续时间(在此,文件名不被接受)。
If a Sample object is shortened, extra values are discarded. When a Sample object is lengthened, it is padded out to its new length with zeros (silence).
如果样本对象被缩短,多余的值将被丢弃。当一个Sample对象延长,它被填充到新的零长度(沉默)。
值----------Value----------
For duration, the duration of the sample in seconds.
对于duration,以秒为单位的持续时间的样品。
For setDuration, a Sample object with the new duration.
对于setDuration,一个Sample对象的新的持续时间。
(作者)----------Author(s)----------
Matthias Heymann
参见----------See Also----------
sampleLength
sampleLength
实例----------Examples----------
s <- Sine(440,3)
duration(s) # 3[3]
duration(s) <-.5 # sample is now .5 sec long[样品是现在的0.5秒长]
play(setDuration(s,1)) # plays a .5 sec sine wave and then .5 sec silence[扮演一个0.5秒的正弦波,然后0.5秒沉默]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|