Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ebf7599 authored by Shunkai Yao's avatar Shunkai Yao Committed by Android (Google) Code Review
Browse files

Merge "HapticGeneratorTest: Add Tests for all HapticGenerator effect parameters" into main

parents 84f24170 393369b8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -136,6 +136,9 @@ cc_test {
    name: "VtsHalHapticGeneratorTargetTest",
    defaults: ["VtsHalAudioEffectTargetTestDefaults"],
    srcs: ["VtsHalHapticGeneratorTargetTest.cpp"],
    shared_libs: [
        "libaudioutils",
    ],
}

cc_test {
+11 −0
Original line number Diff line number Diff line
@@ -454,6 +454,17 @@ class EffectHelper {
        mOutputSamples = common.output.frameCount * mOutputFrameSize / sizeof(float);
    }

    void generateInput(std::vector<float>& input, float inputFrequency, float samplingFrequency,
                       size_t inputSize = 0) {
        if (inputSize == 0 || inputSize > input.size()) {
            inputSize = input.size();
        }

        for (size_t i = 0; i < inputSize; i++) {
            input[i] = sin(2 * M_PI * inputFrequency * i / samplingFrequency);
        }
    }

    bool mIsSpatializer;
    Descriptor mDescriptor;
    size_t mInputFrameSize, mOutputFrameSize;
+315 −343

File changed.

Preview size limit exceeded, changes collapsed.