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()); | |
95 m_destination->start(); | 94 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 } | |
106 } | 95 } |
107 | 96 |
108 unsigned long DefaultAudioDestinationNode::maxChannelCount() const | 97 unsigned long DefaultAudioDestinationNode::maxChannelCount() const |
109 { | 98 { |
110 return AudioDestination::maxChannelCount(); | 99 return AudioDestination::maxChannelCount(); |
111 } | 100 } |
112 | 101 |
113 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionState& exceptionState) | 102 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionState& exceptionState) |
114 { | 103 { |
115 // The channelCount for the input to this node controls the actual number of
channels we | 104 // The channelCount for the input to this node controls the actual number of
channels we |
(...skipping 16 matching lines...) Expand all Loading... |
132 // Re-create destination. | 121 // Re-create destination. |
133 m_destination->stop(); | 122 m_destination->stop(); |
134 createDestination(); | 123 createDestination(); |
135 m_destination->start(); | 124 m_destination->start(); |
136 } | 125 } |
137 } | 126 } |
138 | 127 |
139 } // namespace blink | 128 } // namespace blink |
140 | 129 |
141 #endif // ENABLE(WEB_AUDIO) | 130 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |