audio_test_support.h revision 5f1c94371a64b3196d4be9466099bb892df9b88e
154d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org// Copyright 2014 The Chromium Authors. All rights reserved. 254d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org// Use of this source code is governed by a BSD-style license that can be 354d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org// found in the LICENSE file. 454d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org 554d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org#ifndef COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ 654d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org#define COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ 754d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83fsbc@chromium.org 8#include <cstddef> 9 10#include "base/memory/ref_counted.h" 11#include "base/memory/scoped_ptr.h" 12 13namespace media { 14class AudioBus; 15class AudioBusRefCounted; 16} 17 18namespace copresence { 19 20// Populate random samples given a random seed into the samples array. 21void PopulateSamples(int random_seed, size_t size, float* samples); 22 23// Create an audio bus populated with random samples. 24scoped_ptr<media::AudioBus> CreateRandomAudio(int random_seed, 25 int channels, 26 int samples); 27 28// Create an ref counted audio bus populated with random samples. 29scoped_refptr<media::AudioBusRefCounted> 30 CreateRandomAudioRefCounted(int random_seed, int channels, int samples); 31 32} // namespace copresence 33 34#endif // COMPONENTS_COPRESENCE_COMMON_AUDIO_TEST_SUPPORT_ 35