summaryrefslogtreecommitdiffstats
path: root/components/copresence/test/audio_test_support.h
blob: 205577b8df5e0bb5ecf6592fbe739b4c297561e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_COPRESENCE_TEST_AUDIO_TEST_SUPPORT_H_
#define COMPONENTS_COPRESENCE_TEST_AUDIO_TEST_SUPPORT_H_

#include <cstddef>

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"

namespace media {
class AudioBus;
class AudioBusRefCounted;
}

namespace copresence {

// Populate random samples given a random seed into the samples array.
void PopulateSamples(int random_seed, size_t size, float* samples);

// Create an ref counted audio bus populated with random samples.
scoped_refptr<media::AudioBusRefCounted>
    CreateRandomAudioRefCounted(int random_seed, int channels, int samples);

}  // namespace copresence

#endif  // COMPONENTS_COPRESENCE_TEST_AUDIO_TEST_SUPPORT_H_