用法:
oss_audio_device.setparameters(format, nchannels, samplerate[, strict=False])
在一個方法調用中設置關鍵的音頻采樣參數——采樣格式、通道數和采樣率。
format
、nchannels
和samplerate
應該在setfmt()
、channels()
和speed()
方法中指定。如果strict
為真,setparameters()
檢查每個參數是否實際設置為請求的值,如果不是,則引發OSSAudioError
。返回一個元組(format
、nchannels
、samplerate
)指示設備驅動程序實際設置的參數值(即,與setfmt()
、channels()
和speed()
的返回值相同) )。例如,
(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)
相當於
fmt = dsp.setfmt(fmt) channels = dsp.channels(channels) rate = dsp.rate(rate)
相關用法
- Python ossaudiodev.oss_mixer_device.controls用法及代碼示例
- Python os.path.normcase()用法及代碼示例
- Python os.read()用法及代碼示例
- Python os.DirEntry.inode()用法及代碼示例
- Python os.closerange()用法及代碼示例
- Python os.set_blocking()用法及代碼示例
- Python os.pathconf()用法及代碼示例
- Python os.chflags()用法及代碼示例
- Python os.WCOREDUMP()用法及代碼示例
- Python os.fork()用法及代碼示例
- Python os.ctermid()用法及代碼示例
- Python os.mkfifo()用法及代碼示例
- Python os.tcsetpgrp()用法及代碼示例
- Python os.path.commonpath()用法及代碼示例
- Python os.path.splitdrive用法及代碼示例
- Python os.mkdir()用法及代碼示例
- Python os.close()用法及代碼示例
- Python os.chroot()用法及代碼示例
- Python os.path.expanduser()用法及代碼示例
- Python os.ttyname()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 ossaudiodev.oss_audio_device.setparameters。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。