| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview This is the low-level class that generates ChromeVox's | 6 * @fileoverview This is the low-level class that generates ChromeVox's |
| 7 * earcons. It's designed to be self-contained and not depend on the | 7 * earcons. It's designed to be self-contained and not depend on the |
| 8 * rest of the code. | 8 * rest of the code. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 goog.provide('EarconEngine'); | 11 goog.provide('EarconEngine'); |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * EarconEngine generates ChromeVox's earcons using the web audio API. | 14 * EarconEngine generates ChromeVox's earcons using the web audio API. |
| 15 * @constructor | 15 * @constructor |
| 16 */ | 16 */ |
| 17 EarconEngine = function() { | 17 EarconEngine = function() { |
| 18 // Public control parameters. All of these are meant to be adjustable. | 18 // Public control parameters. All of these are meant to be adjustable. |
| 19 | 19 |
| 20 /** @type {number} The master volume, as an amplification factor. */ | 20 /** @type {number} The master volume, as an amplification factor. */ |
| 21 this.masterVolume = 0.2; | 21 this.masterVolume = 1.0; |
| 22 | 22 |
| 23 /** @type {number} The base relative pitch adjustment, in half-steps. */ | 23 /** @type {number} The base relative pitch adjustment, in half-steps. */ |
| 24 this.masterPitch = -4; | 24 this.masterPitch = -4; |
| 25 | 25 |
| 26 /** @type {number} The click volume, as an amplification factor. */ | 26 /** @type {number} The click volume, as an amplification factor. */ |
| 27 this.clickVolume = 0.4; | 27 this.clickVolume = 0.4; |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @type {number} The volume of the static sound, as an | 30 * @type {number} The volume of the static sound, as an |
| 31 * amplification factor. | 31 * amplification factor. |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 } | 702 } |
| 703 | 703 |
| 704 for (var i = 0; i < this.progressSources_.length; i++) { | 704 for (var i = 0; i < this.progressSources_.length; i++) { |
| 705 this.progressSources_[i][1].stop(); | 705 this.progressSources_[i][1].stop(); |
| 706 } | 706 } |
| 707 this.progressSources_ = []; | 707 this.progressSources_ = []; |
| 708 | 708 |
| 709 window.clearInterval(this.progressIntervalID_); | 709 window.clearInterval(this.progressIntervalID_); |
| 710 this.progressIntervalID_ = null; | 710 this.progressIntervalID_ = null; |
| 711 }; | 711 }; |
| OLD | NEW |