Chromium Code Reviews| 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 * 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 #include "wtf/PassOwnPtr.h" | 73 #include "wtf/PassOwnPtr.h" |
| 74 #include "wtf/text/WTFString.h" | 74 #include "wtf/text/WTFString.h" |
| 75 | 75 |
| 76 // FIXME: check the proper way to reference an undefined thread ID | 76 // FIXME: check the proper way to reference an undefined thread ID |
| 77 const int UndefinedThreadIdentifier = 0xffffffff; | 77 const int UndefinedThreadIdentifier = 0xffffffff; |
| 78 | 78 |
| 79 namespace WebCore { | 79 namespace WebCore { |
| 80 | 80 |
| 81 bool AudioContext::isSampleRateRangeGood(float sampleRate) | 81 bool AudioContext::isSampleRateRangeGood(float sampleRate) |
| 82 { | 82 { |
| 83 // FIXME: It would be nice if the minimum sample-rate could be less than 44. 1KHz, | 83 return sampleRate >= 8000 && sampleRate <= 96000; |
|
Raymond Toy
2014/07/30 16:49:38
AudioBuffers support sample rates from 3kHz to 192
KhNo
2014/07/31 16:45:53
I think there is no reason we should hesitate to e
Raymond Toy
2014/07/31 17:25:13
Great. Then you can use AudioBuffer::minSampleRate
| |
| 84 // but that will require some fixes in HRTFPanner::fftSizeForSampleRate(), a nd some testing there. | |
| 85 return sampleRate >= 44100 && sampleRate <= 96000; | |
| 86 } | 84 } |
| 87 | 85 |
| 88 // Don't allow more than this number of simultaneous AudioContexts talking to ha rdware. | 86 // Don't allow more than this number of simultaneous AudioContexts talking to ha rdware. |
| 89 const unsigned MaxHardwareContexts = 6; | 87 const unsigned MaxHardwareContexts = 6; |
| 90 unsigned AudioContext::s_hardwareContextCount = 0; | 88 unsigned AudioContext::s_hardwareContextCount = 0; |
| 91 | 89 |
| 92 PassRefPtrWillBeRawPtr<AudioContext> AudioContext::create(Document& document, Ex ceptionState& exceptionState) | 90 PassRefPtrWillBeRawPtr<AudioContext> AudioContext::create(Document& document, Ex ceptionState& exceptionState) |
| 93 { | 91 { |
| 94 ASSERT(isMainThread()); | 92 ASSERT(isMainThread()); |
| 95 if (s_hardwareContextCount >= MaxHardwareContexts) { | 93 if (s_hardwareContextCount >= MaxHardwareContexts) { |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 955 visitor->trace(m_renderTarget); | 953 visitor->trace(m_renderTarget); |
| 956 visitor->trace(m_destinationNode); | 954 visitor->trace(m_destinationNode); |
| 957 visitor->trace(m_listener); | 955 visitor->trace(m_listener); |
| 958 visitor->trace(m_dirtySummingJunctions); | 956 visitor->trace(m_dirtySummingJunctions); |
| 959 EventTargetWithInlineData::trace(visitor); | 957 EventTargetWithInlineData::trace(visitor); |
| 960 } | 958 } |
| 961 | 959 |
| 962 } // namespace WebCore | 960 } // namespace WebCore |
| 963 | 961 |
| 964 #endif // ENABLE(WEB_AUDIO) | 962 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |