| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 void AudioContext::decodeAudioData(DOMArrayBuffer* audioData, AudioBufferCallbac
k* successCallback, AudioBufferCallback* errorCallback, ExceptionState& exceptio
nState) | 235 void AudioContext::decodeAudioData(DOMArrayBuffer* audioData, AudioBufferCallbac
k* successCallback, AudioBufferCallback* errorCallback, ExceptionState& exceptio
nState) |
| 236 { | 236 { |
| 237 if (!audioData) { | 237 if (!audioData) { |
| 238 exceptionState.throwDOMException( | 238 exceptionState.throwDOMException( |
| 239 SyntaxError, | 239 SyntaxError, |
| 240 "invalid ArrayBuffer for audioData."); | 240 "invalid ArrayBuffer for audioData."); |
| 241 return; | 241 return; |
| 242 } | 242 } |
| 243 m_audioDecoder.decodeAsync(audioData->buffer(), sampleRate(), successCallbac
k, errorCallback); | 243 m_audioDecoder.decodeAsync(audioData, sampleRate(), successCallback, errorCa
llback); |
| 244 } | 244 } |
| 245 | 245 |
| 246 AudioBufferSourceNode* AudioContext::createBufferSource() | 246 AudioBufferSourceNode* AudioContext::createBufferSource() |
| 247 { | 247 { |
| 248 ASSERT(isMainThread()); | 248 ASSERT(isMainThread()); |
| 249 AudioBufferSourceNode* node = AudioBufferSourceNode::create(this, m_destinat
ionNode->sampleRate()); | 249 AudioBufferSourceNode* node = AudioBufferSourceNode::create(this, m_destinat
ionNode->sampleRate()); |
| 250 | 250 |
| 251 // Because this is an AudioScheduledSourceNode, the context keeps a referenc
e until it has finished playing. | 251 // Because this is an AudioScheduledSourceNode, the context keeps a referenc
e until it has finished playing. |
| 252 // When this happens, AudioScheduledSourceNode::finish() calls AudioContext:
:notifyNodeFinishedProcessing(). | 252 // When this happens, AudioScheduledSourceNode::finish() calls AudioContext:
:notifyNodeFinishedProcessing(). |
| 253 refNode(node); | 253 refNode(node); |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 | 877 |
| 878 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) | 878 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) |
| 879 (*k)->updateChannelCountMode(); | 879 (*k)->updateChannelCountMode(); |
| 880 | 880 |
| 881 m_deferredCountModeChange.clear(); | 881 m_deferredCountModeChange.clear(); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace blink | 884 } // namespace blink |
| 885 | 885 |
| 886 #endif // ENABLE(WEB_AUDIO) | 886 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |