找回密码
 注册
查看: 296|回复: 0

R语言 sound包 sampleLength()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 12:06:02 | 显示全部楼层 |阅读模式
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) &lt;- 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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-9 19:45 , Processed in 0.023084 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表