haikuwebkit/LayoutTests/webaudio/oscillator-sine.html

31 lines
589 B
HTML
Raw Permalink Normal View History

Source/WebCore: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Oscillator represents an audio source generating a periodic waveform. It can be set to a few commonly used waveforms. Additionally, it can be set to an arbitrary periodic waveform through the use of a WaveTable object. Reviewed by Kenneth Russell. Tests: webaudio/oscillator-custom.html webaudio/oscillator-sawtooth.html webaudio/oscillator-sine.html webaudio/oscillator-square.html webaudio/oscillator-triangle.html * DerivedSources.make: * GNUmakefile.list.am: Add Oscillator and WaveTable to build files. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createOscillator): (WebCore): (WebCore::AudioContext::createWaveTable): * Modules/webaudio/AudioContext.h: Add create methods for Oscillator and WaveTable. (WebCore): (AudioContext): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioNode.h: * Modules/webaudio/Oscillator.cpp: Added. (WebCore): (WebCore::Oscillator::create): (WebCore::Oscillator::Oscillator): (WebCore::Oscillator::~Oscillator): (WebCore::Oscillator::setType): (WebCore::Oscillator::calculateSampleAccuratePhaseIncrements): (WebCore::Oscillator::process): (WebCore::Oscillator::reset): (WebCore::Oscillator::setWaveTable): * Modules/webaudio/Oscillator.h: Added. (WebCore): (Oscillator): (WebCore::Oscillator::type): (WebCore::Oscillator::frequency): (WebCore::Oscillator::detune): Implement Oscillator as AudioSourceNode. * Modules/webaudio/Oscillator.idl: Added. * Modules/webaudio/WaveTable.cpp: Added. (WebCore): (WebCore::WaveTable::create): (WebCore::WaveTable::createSine): (WebCore::WaveTable::createSquare): (WebCore::WaveTable::createSawtooth): (WebCore::WaveTable::createTriangle): (WebCore::WaveTable::WaveTable): (WebCore::WaveTable::waveDataForFundamentalFrequency): (WebCore::WaveTable::maxNumberOfPartials): (WebCore::WaveTable::numberOfPartialsForRange): (WebCore::WaveTable::createBandLimitedTables): (WebCore::WaveTable::generateBasicWaveform): * Modules/webaudio/WaveTable.h: Added. (WebCore): (WaveTable): (WebCore::WaveTable::rateScale): (WebCore::WaveTable::waveTableSize): (WebCore::WaveTable::sampleRate): (WebCore::WaveTable::numberOfRanges): Implement WaveTable which is constructed given a set of Fourier coefficients. * Modules/webaudio/WaveTable.idl: Added. * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: Add Oscillator and WaveTable files to build files. LayoutTests: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Reviewed by Kenneth Russell. * webaudio/oscillator-custom-expected.wav: Added. * webaudio/oscillator-custom.html: Added. * webaudio/oscillator-sawtooth-expected.wav: Added. * webaudio/oscillator-sawtooth.html: Added. * webaudio/oscillator-sine-expected.wav: Added. * webaudio/oscillator-sine.html: Added. * webaudio/oscillator-square-expected.wav: Added. * webaudio/oscillator-square.html: Added. * webaudio/oscillator-triangle-expected.wav: Added. * webaudio/oscillator-triangle.html: Added. * webaudio/resources/oscillator-testing.js: Added. (generateExponentialOscillatorSweep): Canonical link: https://commits.webkit.org/100297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-02 21:07:37 +00:00
<!DOCTYPE html>
<!--
Create an oscillator of type SINE and generate a slow exponential tone sweep.
The result can be checked for the correct wave shape and for aliasing artifacts.
See oscillator-testing.js for details.
-->
<html>
<head>
<script type="text/javascript" src="resources/audio-testing.js"></script>
<script type="text/javascript" src="resources/oscillator-testing-legacy.js"></script>
Source/WebCore: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Oscillator represents an audio source generating a periodic waveform. It can be set to a few commonly used waveforms. Additionally, it can be set to an arbitrary periodic waveform through the use of a WaveTable object. Reviewed by Kenneth Russell. Tests: webaudio/oscillator-custom.html webaudio/oscillator-sawtooth.html webaudio/oscillator-sine.html webaudio/oscillator-square.html webaudio/oscillator-triangle.html * DerivedSources.make: * GNUmakefile.list.am: Add Oscillator and WaveTable to build files. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createOscillator): (WebCore): (WebCore::AudioContext::createWaveTable): * Modules/webaudio/AudioContext.h: Add create methods for Oscillator and WaveTable. (WebCore): (AudioContext): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioNode.h: * Modules/webaudio/Oscillator.cpp: Added. (WebCore): (WebCore::Oscillator::create): (WebCore::Oscillator::Oscillator): (WebCore::Oscillator::~Oscillator): (WebCore::Oscillator::setType): (WebCore::Oscillator::calculateSampleAccuratePhaseIncrements): (WebCore::Oscillator::process): (WebCore::Oscillator::reset): (WebCore::Oscillator::setWaveTable): * Modules/webaudio/Oscillator.h: Added. (WebCore): (Oscillator): (WebCore::Oscillator::type): (WebCore::Oscillator::frequency): (WebCore::Oscillator::detune): Implement Oscillator as AudioSourceNode. * Modules/webaudio/Oscillator.idl: Added. * Modules/webaudio/WaveTable.cpp: Added. (WebCore): (WebCore::WaveTable::create): (WebCore::WaveTable::createSine): (WebCore::WaveTable::createSquare): (WebCore::WaveTable::createSawtooth): (WebCore::WaveTable::createTriangle): (WebCore::WaveTable::WaveTable): (WebCore::WaveTable::waveDataForFundamentalFrequency): (WebCore::WaveTable::maxNumberOfPartials): (WebCore::WaveTable::numberOfPartialsForRange): (WebCore::WaveTable::createBandLimitedTables): (WebCore::WaveTable::generateBasicWaveform): * Modules/webaudio/WaveTable.h: Added. (WebCore): (WaveTable): (WebCore::WaveTable::rateScale): (WebCore::WaveTable::waveTableSize): (WebCore::WaveTable::sampleRate): (WebCore::WaveTable::numberOfRanges): Implement WaveTable which is constructed given a set of Fourier coefficients. * Modules/webaudio/WaveTable.idl: Added. * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: Add Oscillator and WaveTable files to build files. LayoutTests: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Reviewed by Kenneth Russell. * webaudio/oscillator-custom-expected.wav: Added. * webaudio/oscillator-custom.html: Added. * webaudio/oscillator-sawtooth-expected.wav: Added. * webaudio/oscillator-sawtooth.html: Added. * webaudio/oscillator-sine-expected.wav: Added. * webaudio/oscillator-sine.html: Added. * webaudio/oscillator-square-expected.wav: Added. * webaudio/oscillator-square.html: Added. * webaudio/oscillator-triangle-expected.wav: Added. * webaudio/oscillator-triangle.html: Added. * webaudio/resources/oscillator-testing.js: Added. (generateExponentialOscillatorSweep): Canonical link: https://commits.webkit.org/100297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-02 21:07:37 +00:00
</head>
<body>
<script>
window.onload = init;
function init() {
if (!window.testRunner)
Source/WebCore: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Oscillator represents an audio source generating a periodic waveform. It can be set to a few commonly used waveforms. Additionally, it can be set to an arbitrary periodic waveform through the use of a WaveTable object. Reviewed by Kenneth Russell. Tests: webaudio/oscillator-custom.html webaudio/oscillator-sawtooth.html webaudio/oscillator-sine.html webaudio/oscillator-square.html webaudio/oscillator-triangle.html * DerivedSources.make: * GNUmakefile.list.am: Add Oscillator and WaveTable to build files. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createOscillator): (WebCore): (WebCore::AudioContext::createWaveTable): * Modules/webaudio/AudioContext.h: Add create methods for Oscillator and WaveTable. (WebCore): (AudioContext): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioNode.h: * Modules/webaudio/Oscillator.cpp: Added. (WebCore): (WebCore::Oscillator::create): (WebCore::Oscillator::Oscillator): (WebCore::Oscillator::~Oscillator): (WebCore::Oscillator::setType): (WebCore::Oscillator::calculateSampleAccuratePhaseIncrements): (WebCore::Oscillator::process): (WebCore::Oscillator::reset): (WebCore::Oscillator::setWaveTable): * Modules/webaudio/Oscillator.h: Added. (WebCore): (Oscillator): (WebCore::Oscillator::type): (WebCore::Oscillator::frequency): (WebCore::Oscillator::detune): Implement Oscillator as AudioSourceNode. * Modules/webaudio/Oscillator.idl: Added. * Modules/webaudio/WaveTable.cpp: Added. (WebCore): (WebCore::WaveTable::create): (WebCore::WaveTable::createSine): (WebCore::WaveTable::createSquare): (WebCore::WaveTable::createSawtooth): (WebCore::WaveTable::createTriangle): (WebCore::WaveTable::WaveTable): (WebCore::WaveTable::waveDataForFundamentalFrequency): (WebCore::WaveTable::maxNumberOfPartials): (WebCore::WaveTable::numberOfPartialsForRange): (WebCore::WaveTable::createBandLimitedTables): (WebCore::WaveTable::generateBasicWaveform): * Modules/webaudio/WaveTable.h: Added. (WebCore): (WaveTable): (WebCore::WaveTable::rateScale): (WebCore::WaveTable::waveTableSize): (WebCore::WaveTable::sampleRate): (WebCore::WaveTable::numberOfRanges): Implement WaveTable which is constructed given a set of Fourier coefficients. * Modules/webaudio/WaveTable.idl: Added. * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: Add Oscillator and WaveTable files to build files. LayoutTests: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Reviewed by Kenneth Russell. * webaudio/oscillator-custom-expected.wav: Added. * webaudio/oscillator-custom.html: Added. * webaudio/oscillator-sawtooth-expected.wav: Added. * webaudio/oscillator-sawtooth.html: Added. * webaudio/oscillator-sine-expected.wav: Added. * webaudio/oscillator-sine.html: Added. * webaudio/oscillator-square-expected.wav: Added. * webaudio/oscillator-square.html: Added. * webaudio/oscillator-triangle-expected.wav: Added. * webaudio/oscillator-triangle.html: Added. * webaudio/resources/oscillator-testing.js: Added. (generateExponentialOscillatorSweep): Canonical link: https://commits.webkit.org/100297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-02 21:07:37 +00:00
return;
Remove support for ENABLE_LEGACY_WEB_AUDIO https://bugs.webkit.org/show_bug.cgi?id=161262 Reviewed by Anders Carlsson. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Remove ENABLE_LEGACY_WEB_AUDIO Source/WebCore: * Configurations/FeatureDefines.xcconfig: Remove ENABLE_LEGACY_WEB_AUDIO. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::noteGrainOn): Deleted. * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: (WebCore::AudioScheduledSourceNode::noteOn): Deleted. (WebCore::AudioScheduledSourceNode::noteOff): Deleted. * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: Remove the looping attribute, as well as the noteOn, noteOff, and noteGrainOn functions. * Modules/webaudio/AudioContext.idl: Remove the createGainNode, createDelayNode and createJavaScriptNode functions. * Modules/webaudio/AudioParam.idl: Remove the setTargetValueAtTime function. * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::type): (WebCore::BiquadFilterNode::setType): (WebCore::BiquadFilterNode::getFrequencyResponse): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): (WebCore::BiquadProcessor::setType): (WebCore::BiquadProcessor::getFrequencyResponse): * Modules/webaudio/BiquadProcessor.h: (WebCore::BiquadProcessor::type): * bindings/js/JSBiquadFilterNodeCustom.cpp: Removed. Rename BiquadProcessor::FilterType to BiquadFilterType and use it directly from the IDL. Remove legacy filter constants from the IDL and the need for a custom binding for the type attribute. * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): (WebCore::OscillatorNode::setType): (WebCore::OscillatorNode::setPeriodicWave): (WebCore::OscillatorNode::type): Deleted. * Modules/webaudio/OscillatorNode.h: (WebCore::OscillatorNode::type): * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::createSine): (WebCore::PeriodicWave::createSquare): (WebCore::PeriodicWave::createSawtooth): (WebCore::PeriodicWave::createTriangle): (WebCore::PeriodicWave::generateBasicWaveform): * Modules/webaudio/PeriodicWave.h: * bindings/js/JSOscillatorNodeCustom.cpp: Removed. Remove noteOn and noteOff functions and the type integer constants. Remove the need for a custom binding for the type attribute by renaming the type enum OscillatorNode::Type and putting the enum in the IDL. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::process): (WebCore::PannerNode::setPanningModel): (WebCore::PannerNode::distanceModel): (WebCore::PannerNode::setDistanceModel): (WebCore::PannerNode::panningModel): Deleted. * Modules/webaudio/PannerNode.h: (WebCore::PannerNode::panningModel): * Modules/webaudio/PannerNode.idl: * bindings/js/JSPannerNodeCustom.cpp: Removed. * platform/audio/Distance.cpp: (WebCore::DistanceEffect::DistanceEffect): (WebCore::DistanceEffect::gain): * platform/audio/Distance.h: (WebCore::DistanceEffect::model): (WebCore::DistanceEffect::setModel): * platform/audio/EqualPowerPanner.cpp: (WebCore::EqualPowerPanner::EqualPowerPanner): * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::HRTFPanner): * platform/audio/Panner.cpp: (WebCore::Panner::create): * platform/audio/Panner.h: (WebCore::Panner::panningModel): (WebCore::Panner::Panner): Replace the panning model and distance model integer constants with IDL enum support, removing the need for a custom binding. Rename the supporting C++ enums to work with the bindings. * bindings/js/JSAudioContextCustom.cpp: (WebCore::constructJSAudioContext): Remove deprecated way of creating an offline context. * WebCore.xcodeproj/project.pbxproj: Update files. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Remove ENABLE_LEGACY_WEB_AUDIO Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Remove ENABLE_LEGACY_WEB_AUDIO. Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: LayoutTests: * webaudio/audiobuffersource-loop-points.html: * webaudio/audiobuffersource-multi-channels.html: * webaudio/audiobuffersource-playbackState-expected.txt: * webaudio/audiobuffersource-playbackState.html: * webaudio/audiobuffersource-playbackrate.html: * webaudio/audiochannelmerger-stereo.html: * webaudio/audiochannelsplitter.html: * webaudio/audionode-connect-order.html: * webaudio/audionode-expected.txt: * webaudio/audionode.html: * webaudio/audioparam-connect-audioratesignal.html: * webaudio/audioparam-summingjunction.html: * webaudio/audioprocessingevent.html: * webaudio/automatic-pull-node.html: * webaudio/biquad-allpass.html: * webaudio/biquad-bandpass.html: * webaudio/biquad-getFrequencyResponse.html: * webaudio/biquad-highpass.html: * webaudio/biquad-highshelf.html: * webaudio/biquad-lowpass.html: * webaudio/biquad-lowshelf.html: * webaudio/biquad-notch.html: * webaudio/biquad-peaking.html: * webaudio/biquadfilternode-basic-expected.txt: * webaudio/biquadfilternode-basic.html: * webaudio/convolution-mono-mono.html: * webaudio/delaynode-max-default-delay.html: * webaudio/delaynode-max-nondefault-delay.html: * webaudio/delaynode-maxdelay.html: * webaudio/delaynode-scheduling.html: * webaudio/delaynode.html: * webaudio/distance-exponential-expected.txt: * webaudio/distance-exponential.html: * webaudio/distance-inverse-expected.txt: * webaudio/distance-inverse.html: * webaudio/distance-linear-expected.txt: * webaudio/distance-linear.html: * webaudio/gain-basic.html: * webaudio/gain.html: * webaudio/javascriptaudionode-zero-input-channels.html: * webaudio/javascriptaudionode.html: * webaudio/mixing.html: * webaudio/note-grain-on-play-expected.txt: Removed. * webaudio/note-grain-on-play.html: Removed. * webaudio/note-grain-on-timing-expected.txt: Removed. * webaudio/note-grain-on-timing.html: Removed. * webaudio/oscillator-basic-expected.txt: * webaudio/oscillator-basic.html: * webaudio/oscillator-custom.html: * webaudio/oscillator-sawtooth.html: * webaudio/oscillator-sine.html: * webaudio/oscillator-square.html: * webaudio/oscillator-triangle.html: * webaudio/pannernode-basic-expected.txt: * webaudio/pannernode-basic.html: * webaudio/resources/audio-testing.js: * webaudio/resources/audioparam-testing.js: * webaudio/resources/biquad-testing.js: * webaudio/resources/distance-model-testing.js: * webaudio/resources/javascriptaudionode-testing.js: * webaudio/resources/oscillator-testing.js: * webaudio/resources/panner-model-testing.js: * webaudio/sample-accurate-scheduling.html: * webaudio/stereo2mono-down-mixing.html: * webaudio/up-mixing-mono-51.html: * webaudio/up-mixing-mono-stereo.html: * webaudio/up-mixing-stereo-51.html: * webaudio/waveshaper.html: Update tests for removal of ENABLE_LEGACY_WEB_AUDIO. Canonical link: https://commits.webkit.org/179440@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-27 02:01:11 +00:00
generateExponentialOscillatorSweep("sine");
Source/WebCore: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Oscillator represents an audio source generating a periodic waveform. It can be set to a few commonly used waveforms. Additionally, it can be set to an arbitrary periodic waveform through the use of a WaveTable object. Reviewed by Kenneth Russell. Tests: webaudio/oscillator-custom.html webaudio/oscillator-sawtooth.html webaudio/oscillator-sine.html webaudio/oscillator-square.html webaudio/oscillator-triangle.html * DerivedSources.make: * GNUmakefile.list.am: Add Oscillator and WaveTable to build files. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createOscillator): (WebCore): (WebCore::AudioContext::createWaveTable): * Modules/webaudio/AudioContext.h: Add create methods for Oscillator and WaveTable. (WebCore): (AudioContext): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioNode.h: * Modules/webaudio/Oscillator.cpp: Added. (WebCore): (WebCore::Oscillator::create): (WebCore::Oscillator::Oscillator): (WebCore::Oscillator::~Oscillator): (WebCore::Oscillator::setType): (WebCore::Oscillator::calculateSampleAccuratePhaseIncrements): (WebCore::Oscillator::process): (WebCore::Oscillator::reset): (WebCore::Oscillator::setWaveTable): * Modules/webaudio/Oscillator.h: Added. (WebCore): (Oscillator): (WebCore::Oscillator::type): (WebCore::Oscillator::frequency): (WebCore::Oscillator::detune): Implement Oscillator as AudioSourceNode. * Modules/webaudio/Oscillator.idl: Added. * Modules/webaudio/WaveTable.cpp: Added. (WebCore): (WebCore::WaveTable::create): (WebCore::WaveTable::createSine): (WebCore::WaveTable::createSquare): (WebCore::WaveTable::createSawtooth): (WebCore::WaveTable::createTriangle): (WebCore::WaveTable::WaveTable): (WebCore::WaveTable::waveDataForFundamentalFrequency): (WebCore::WaveTable::maxNumberOfPartials): (WebCore::WaveTable::numberOfPartialsForRange): (WebCore::WaveTable::createBandLimitedTables): (WebCore::WaveTable::generateBasicWaveform): * Modules/webaudio/WaveTable.h: Added. (WebCore): (WaveTable): (WebCore::WaveTable::rateScale): (WebCore::WaveTable::waveTableSize): (WebCore::WaveTable::sampleRate): (WebCore::WaveTable::numberOfRanges): Implement WaveTable which is constructed given a set of Fourier coefficients. * Modules/webaudio/WaveTable.idl: Added. * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: Add Oscillator and WaveTable files to build files. LayoutTests: Add Oscillator/WaveTable implementation and tests https://bugs.webkit.org/show_bug.cgi?id=82414 Reviewed by Kenneth Russell. * webaudio/oscillator-custom-expected.wav: Added. * webaudio/oscillator-custom.html: Added. * webaudio/oscillator-sawtooth-expected.wav: Added. * webaudio/oscillator-sawtooth.html: Added. * webaudio/oscillator-sine-expected.wav: Added. * webaudio/oscillator-sine.html: Added. * webaudio/oscillator-square-expected.wav: Added. * webaudio/oscillator-square.html: Added. * webaudio/oscillator-triangle-expected.wav: Added. * webaudio/oscillator-triangle.html: Added. * webaudio/resources/oscillator-testing.js: Added. (generateExponentialOscillatorSweep): Canonical link: https://commits.webkit.org/100297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-02 21:07:37 +00:00
}
</script>
</body>
</html>