OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 { | 83 { |
84 float hardwareSampleRate = AudioDestination::hardwareSampleRate(); | 84 float hardwareSampleRate = AudioDestination::hardwareSampleRate(); |
85 WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate); | 85 WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate); |
86 | 86 |
87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI
nputChannels, channelCount(), hardwareSampleRate); | 87 m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfI
nputChannels, channelCount(), hardwareSampleRate); |
88 } | 88 } |
89 | 89 |
90 void DefaultAudioDestinationNode::startRendering() | 90 void DefaultAudioDestinationNode::startRendering() |
91 { | 91 { |
92 ASSERT(isInitialized()); | 92 ASSERT(isInitialized()); |
93 if (isInitialized()) | 93 if (isInitialized()) { |
| 94 ASSERT(!m_destination->isPlaying()); |
94 m_destination->start(); | 95 m_destination->start(); |
| 96 } |
| 97 } |
| 98 |
| 99 void DefaultAudioDestinationNode::stopRendering() |
| 100 { |
| 101 ASSERT(isInitialized()); |
| 102 if (isInitialized()) { |
| 103 ASSERT(m_destination->isPlaying()); |
| 104 m_destination->stop(); |
| 105 } |
95 } | 106 } |
96 | 107 |
97 unsigned long DefaultAudioDestinationNode::maxChannelCount() const | 108 unsigned long DefaultAudioDestinationNode::maxChannelCount() const |
98 { | 109 { |
99 return AudioDestination::maxChannelCount(); | 110 return AudioDestination::maxChannelCount(); |
100 } | 111 } |
101 | 112 |
102 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionState& exceptionState) | 113 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionState& exceptionState) |
103 { | 114 { |
104 // The channelCount for the input to this node controls the actual number of
channels we | 115 // The channelCount for the input to this node controls the actual number of
channels we |
(...skipping 16 matching lines...) Expand all Loading... |
121 // Re-create destination. | 132 // Re-create destination. |
122 m_destination->stop(); | 133 m_destination->stop(); |
123 createDestination(); | 134 createDestination(); |
124 m_destination->start(); | 135 m_destination->start(); |
125 } | 136 } |
126 } | 137 } |
127 | 138 |
128 } // namespace blink | 139 } // namespace blink |
129 | 140 |
130 #endif // ENABLE(WEB_AUDIO) | 141 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |