Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: Source/modules/webaudio/OfflineAudioContext.cpp

Issue 375383002: Extending supported sample rate from 3.0KHz to 192.0KHz for OfflineAudioContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update names and comment. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/platform/audio/HRTFPanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 "number of channels", 60 "number of channels",
61 numberOfChannels, 61 numberOfChannels,
62 0, 62 0,
63 ExceptionMessages::InclusiveBound, 63 ExceptionMessages::InclusiveBound,
64 AudioContext::maxNumberOfChannels(), 64 AudioContext::maxNumberOfChannels(),
65 ExceptionMessages::InclusiveBound)); 65 ExceptionMessages::InclusiveBound));
66 return 0; 66 return 0;
67 } 67 }
68 68
69 if (!isSampleRateRangeGood(sampleRate)) { 69 if (!isSampleRateRangeGood(sampleRate)) {
70 exceptionState.throwDOMException(SyntaxError, "sample rate (" + String:: number(sampleRate) + ") must be in the range 44100-96000 Hz."); 70 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xOutsideRange(
71 return 0; 71 "sampleRate", sampleRate, 3000.f, ExceptionMessages::InclusiveBound, 192000.f, ExceptionMessages::InclusiveBound));
72 return nullptr;
72 } 73 }
73 74
74 OfflineAudioContext* audioContext = adoptRefCountedGarbageCollectedWillBeNoo p(new OfflineAudioContext(document, numberOfChannels, numberOfFrames, sampleRate )); 75 OfflineAudioContext* audioContext = adoptRefCountedGarbageCollectedWillBeNoo p(new OfflineAudioContext(document, numberOfChannels, numberOfFrames, sampleRate ));
75 76
76 if (!audioContext->destination()) { 77 if (!audioContext->destination()) {
77 exceptionState.throwDOMException( 78 exceptionState.throwDOMException(
78 NotSupportedError, 79 NotSupportedError,
79 "OfflineAudioContext(" + String::number(numberOfChannels) 80 "OfflineAudioContext(" + String::number(numberOfChannels)
80 + ", " + String::number(numberOfFrames) 81 + ", " + String::number(numberOfFrames)
81 + ", " + String::number(sampleRate) 82 + ", " + String::number(sampleRate)
(...skipping 10 matching lines...) Expand all
92 ScriptWrappable::init(this); 93 ScriptWrappable::init(this);
93 } 94 }
94 95
95 OfflineAudioContext::~OfflineAudioContext() 96 OfflineAudioContext::~OfflineAudioContext()
96 { 97 {
97 } 98 }
98 99
99 } // namespace blink 100 } // namespace blink
100 101
101 #endif // ENABLE(WEB_AUDIO) 102 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/platform/audio/HRTFPanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698