この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。
The detune
property of the AudioBufferSourceNode
interface is a k-rate AudioParam
representing detuning of oscillation in cents.
For example, values of +100 and -100 detune the source up or down by one semitone, while +1200 and -1200 detune it up or down by one octave.
Syntax
var source = audioCtx.createBufferSource(); source.detune.value = 100; // value in cents
Note: Though the AudioParam
returned is read-only, the value it represents is not.
Value
A k-rate AudioParam
whose value indicates the detuning of oscillation in cents.
Example
const audioCtx = new AudioContext(); const channelCount = 2; const frameCount = audioCtx.sampleRate * 2.0; // 2 seconds const myArrayBuffer = audioCtx.createBuffer(channelCount, frameCount, audioCtx.sampleRate); for (let channel = 0; channel < channelCount; channel++) { const nowBuffering = myArrayBuffer.getChannelData(channel); for (let i = 0; i < frameCount; i++) { nowBuffering[i] = Math.random() * 2 - 1; } } const source = audioCtx.createBufferSource(); source.buffer = myArrayBuffer; source.connect(audioCtx.destination); source.detune.value = 100; // value in cents source.start();
Specifications
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'detune' in that specification. |
Working Draft |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 44 | Edge Full support 13 | Firefox Full support 40 | IE No support No | Opera Full support 31 | Safari No support No | WebView Android Full support 44 | Chrome Android Full support 44 | Edge Mobile Full support Yes | Firefox Android Full support 40 | Opera Android Full support 31 | Safari iOS ? | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
See also
ドキュメントのタグと貢献者
タグ:
このページの貢献者:
alien35,
Sheppy,
SphinxKnight,
Jedipedia,
fscholz,
nbriz,
erikadoyle,
Jeremie,
chrisdavidmills
最終更新者:
alien35,