| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode); | 96 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode); |
| 97 public: | 97 public: |
| 98 // bufferSize must be one of the following values: 256, 512, 1024, 2048, | 98 // bufferSize must be one of the following values: 256, 512, 1024, 2048, |
| 99 // 4096, 8192, 16384. | 99 // 4096, 8192, 16384. |
| 100 // This value controls how frequently the onaudioprocess event handler is | 100 // This value controls how frequently the onaudioprocess event handler is |
| 101 // called and how many sample-frames need to be processed each call. | 101 // called and how many sample-frames need to be processed each call. |
| 102 // Lower numbers for bufferSize will result in a lower (better) | 102 // Lower numbers for bufferSize will result in a lower (better) |
| 103 // latency. Higher numbers will be necessary to avoid audio breakup and | 103 // latency. Higher numbers will be necessary to avoid audio breakup and |
| 104 // glitches. | 104 // glitches. |
| 105 // The value chosen must carefully balance between latency and audio quality
. | 105 // The value chosen must carefully balance between latency and audio quality
. |
| 106 static ScriptProcessorNode* create(AbstractAudioContext&, float sampleRate,
size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChanne
ls); | 106 static ScriptProcessorNode* create(AbstractAudioContext&, ExceptionState&); |
| 107 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize,
ExceptionState&); |
| 108 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize,
unsigned numberOfInputChannels, ExceptionState&); |
| 109 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize,
unsigned numberOfInputChannels, unsigned numberOfOutputChannels, ExceptionState
&); |
| 107 | 110 |
| 108 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); | 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); |
| 109 size_t bufferSize() const; | 112 size_t bufferSize() const; |
| 110 | 113 |
| 111 // ActiveScriptWrappable | 114 // ActiveScriptWrappable |
| 112 bool hasPendingActivity() const final; | 115 bool hasPendingActivity() const final; |
| 113 | 116 |
| 114 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); } | 117 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); } |
| 115 | 118 |
| 116 private: | 119 private: |
| 117 ScriptProcessorNode(AbstractAudioContext&, float sampleRate, size_t bufferSi
ze, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); | 120 ScriptProcessorNode(AbstractAudioContext&, float sampleRate, size_t bufferSi
ze, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace blink | 123 } // namespace blink |
| 121 | 124 |
| 122 #endif // ScriptProcessorNode_h | 125 #endif // ScriptProcessorNode_h |
| OLD | NEW |