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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 for (unsigned i = 0; i < numberOfOutputChannels; ++i) { | 74 for (unsigned i = 0; i < numberOfOutputChannels; ++i) { |
75 AudioNodeInput& input = this->input(i); | 75 AudioNodeInput& input = this->input(i); |
76 DCHECK_EQ(input.numberOfChannels(), 1u); | 76 DCHECK_EQ(input.numberOfChannels(), 1u); |
77 AudioChannel* outputChannel = output.bus()->channel(i); | 77 AudioChannel* outputChannel = output.bus()->channel(i); |
78 if (input.isConnected()) { | 78 if (input.isConnected()) { |
79 // The mixing rules will be applied so multiple channels are down- | 79 // The mixing rules will be applied so multiple channels are down- |
80 // mixed to mono (when the mixing rule is defined). Note that only | 80 // mixed to mono (when the mixing rule is defined). Note that only |
81 // the first channel will be taken for the undefined input channel | 81 // the first channel will be taken for the undefined input channel |
82 // layout. | 82 // layout. |
83 // | 83 // |
84 // See: http://webaudio.github.io/web-audio-api/#channel-up-mixing-and-dow
n-mixing | 84 // See: |
| 85 // http://webaudio.github.io/web-audio-api/#channel-up-mixing-and-down-mix
ing |
85 AudioChannel* inputChannel = input.bus()->channel(0); | 86 AudioChannel* inputChannel = input.bus()->channel(0); |
86 outputChannel->copyFrom(inputChannel); | 87 outputChannel->copyFrom(inputChannel); |
87 | 88 |
88 } else { | 89 } else { |
89 // If input is unconnected, fill zeros in the channel. | 90 // If input is unconnected, fill zeros in the channel. |
90 outputChannel->zero(); | 91 outputChannel->zero(); |
91 } | 92 } |
92 } | 93 } |
93 } | 94 } |
94 | 95 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 if (!node) | 170 if (!node) |
170 return nullptr; | 171 return nullptr; |
171 | 172 |
172 node->handleChannelOptions(options, exceptionState); | 173 node->handleChannelOptions(options, exceptionState); |
173 | 174 |
174 return node; | 175 return node; |
175 } | 176 } |
176 | 177 |
177 } // namespace blink | 178 } // namespace blink |
OLD | NEW |