Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 // playing. Stop the node now and deref it. (But don't run the onEnd ed event because the | 576 // playing. Stop the node now and deref it. (But don't run the onEnd ed event because the |
| 577 // source never actually played.) | 577 // source never actually played.) |
| 578 finishWithoutOnEnded(); | 578 finishWithoutOnEnded(); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 } | 581 } |
| 582 | 582 |
| 583 // ---------------------------------------------------------------- | 583 // ---------------------------------------------------------------- |
| 584 AudioBufferSourceNode::AudioBufferSourceNode(AbstractAudioContext& context, floa t sampleRate) | 584 AudioBufferSourceNode::AudioBufferSourceNode(AbstractAudioContext& context, floa t sampleRate) |
| 585 : AudioScheduledSourceNode(context) | 585 : AudioScheduledSourceNode(context) |
| 586 , m_playbackRate(AudioParam::create(context, ParamTypeAudioBufferSourcePlayb ackRate, 1.0)) | 586 // Arbitrarily choose a limit of +/- Nyquist frequency for playback |
|
hongchan
2016/05/13 01:30:14
Not arbitrarily - it is based on the spec. Right?
Raymond Toy
2016/05/13 17:06:15
Forgot to update it after it was decided to be unl
Raymond Toy
2016/05/13 18:40:32
Done.
| |
| 587 , m_playbackRate(AudioParam::create(context, ParamTypeAudioBufferSourcePlayb ackRate, 1.0, -sampleRate / 2, sampleRate / 2)) | |
| 587 , m_detune(AudioParam::create(context, ParamTypeAudioBufferSourceDetune, 0.0 )) | 588 , m_detune(AudioParam::create(context, ParamTypeAudioBufferSourceDetune, 0.0 )) |
| 588 { | 589 { |
| 589 setHandler(AudioBufferSourceHandler::create(*this, sampleRate, m_playbackRat e->handler(), m_detune->handler())); | 590 setHandler(AudioBufferSourceHandler::create(*this, sampleRate, m_playbackRat e->handler(), m_detune->handler())); |
| 590 } | 591 } |
| 591 | 592 |
| 592 AudioBufferSourceNode* AudioBufferSourceNode::create(AbstractAudioContext& conte xt, float sampleRate) | 593 AudioBufferSourceNode* AudioBufferSourceNode::create(AbstractAudioContext& conte xt, float sampleRate) |
| 593 { | 594 { |
| 594 return new AudioBufferSourceNode(context, sampleRate); | 595 return new AudioBufferSourceNode(context, sampleRate); |
| 595 } | 596 } |
| 596 | 597 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 670 { | 671 { |
| 671 audioBufferSourceHandler().start(when, grainOffset, exceptionState); | 672 audioBufferSourceHandler().start(when, grainOffset, exceptionState); |
| 672 } | 673 } |
| 673 | 674 |
| 674 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) | 675 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) |
| 675 { | 676 { |
| 676 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); | 677 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); |
| 677 } | 678 } |
| 678 | 679 |
| 679 } // namespace blink | 680 } // namespace blink |
| OLD | NEW |