summaryrefslogtreecommitdiffstats
path: root/components/audio_modem/test/random_samples.h
blob: 2e935f7d8815cfdb5751d0a89a9fb4e70974a4cd (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 2015 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_AUDIO_MODEM_TEST_RANDOM_SAMPLES_H_
#define COMPONENTS_AUDIO_MODEM_TEST_RANDOM_SAMPLES_H_

#include <stddef.h>

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

namespace media {
class AudioBus;
class AudioBusRefCounted;
}

namespace audio_modem {

// Populate random samples given a random seed into the samples array.
void PopulateSamples(unsigned 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 audio_modem

#endif  // COMPONENTS_AUDIO_MODEM_TEST_RANDOM_SAMPLES_H_