sampleLength(sound)
sampleLength()所属R语言包:sound
Length of a Sample Object
样品对象的长度
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Get or set the length (number of columns in the waveform matrix) of a Sample object or a wav file.
获取或设置一个Sample对象或wav文件的长度(波形矩阵中的列数)。
用法----------Usage----------
sampleLength(s) <- value
setSampleLength(s,value)
参数----------Arguments----------
参数:s
a Sample object, or a string giving the name of a wav file.
样品对象,或者一个字符串,给出一个wav文件的名称。
参数:value
an integer giving the sample length (number of columns in the waveform matrix).
给予样品的长度(在波形矩阵的列数)的整数。
Details
详细信息----------Details----------
The replacement form can be used to reset the sample length (here, filenames are not accepted).
替换形式可以被用来重置样品的长度(在此,文件名不被接受)。
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 sampleLength, the number of columns in the waveform matrix of the sample.
对于sampleLength,样品的波形矩阵中的列的数目。
For setSampleLength, a Sample object with the new length.
对于setSampleLength,一个Sample对象的新长度。
(作者)----------Author(s)----------
Matthias Heymann
参见----------See Also----------
duration
duration
实例----------Examples----------
s <- Sine(440,3,rate=44100,bits=16,channels=2)
sampleLength(s) # 132300 samples ( = 3 sec * 44100 samples/sec )[132300样品(= 3秒* 44100样本/秒)]
sampleLength(s) <- 22050 # sample is now .5 sec long[样品是现在的0.5秒长]
play(setSampleLength(s,44100)) # 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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|