mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-03 13:02:57 +00:00
Bug 976471 - Implement AnalyserNode.getFloatTimeDomainData(). r=karlt
--HG-- extra : rebase_source : cfe6f31f7991c84cf8e0f2679cd89560260d0f40
This commit is contained in:
parent
143d5497f6
commit
0cd6654de1
@ -180,6 +180,17 @@ AnalyserNode::GetByteFrequencyData(const Uint8Array& aArray)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AnalyserNode::GetFloatTimeDomainData(const Float32Array& aArray)
|
||||
{
|
||||
float* buffer = aArray.Data();
|
||||
uint32_t length = std::min(aArray.Length(), mBuffer.Length());
|
||||
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
buffer[i] = mBuffer[(i + mWriteIndex) % mBuffer.Length()];;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AnalyserNode::GetByteTimeDomainData(const Uint8Array& aArray)
|
||||
{
|
||||
|
@ -27,6 +27,7 @@ public:
|
||||
|
||||
void GetFloatFrequencyData(const Float32Array& aArray);
|
||||
void GetByteFrequencyData(const Uint8Array& aArray);
|
||||
void GetFloatTimeDomainData(const Float32Array& aArray);
|
||||
void GetByteTimeDomainData(const Uint8Array& aArray);
|
||||
uint32_t FftSize() const
|
||||
{
|
||||
|
@ -17,6 +17,7 @@ interface AnalyserNode : AudioNode {
|
||||
void getByteFrequencyData(Uint8Array array);
|
||||
|
||||
// Real-time waveform data
|
||||
void getFloatTimeDomainData(Float32Array array);
|
||||
void getByteTimeDomainData(Uint8Array array);
|
||||
|
||||
[SetterThrows, Pure]
|
||||
|
Loading…
x
Reference in New Issue
Block a user