Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: components/copresence/test/audio_test_support.cc

Issue 865483005: Creating the audio_modem component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging again Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/copresence/test/audio_test_support.cc
diff --git a/components/copresence/test/audio_test_support.cc b/components/copresence/test/audio_test_support.cc
deleted file mode 100644
index 5dd8966896c1867eba6fa4da2d86654415b1ea47..0000000000000000000000000000000000000000
--- a/components/copresence/test/audio_test_support.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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.
-
-#include "components/copresence/test/audio_test_support.h"
-
-#include <cstdlib>
-
-#include "media/base/audio_bus.h"
-
-namespace copresence {
-
-void PopulateSamples(unsigned int random_seed, size_t size, float* samples) {
-#if defined(OS_WIN)
- srand(random_seed);
- for (size_t i = 0; i < size; ++i)
- samples[i] = (2.0 * rand() / RAND_MAX) - 1;
-#else
- for (size_t i = 0; i < size; ++i)
- samples[i] = (2.0 * rand_r(&random_seed) / RAND_MAX) - 1;
-#endif
-}
-
-scoped_refptr<media::AudioBusRefCounted>
-CreateRandomAudioRefCounted(int random_seed, int channels, int samples) {
- scoped_refptr<media::AudioBusRefCounted> bus =
- media::AudioBusRefCounted::Create(channels, samples);
- for (int ch = 0; ch < channels; ++ch)
- PopulateSamples(random_seed, samples, bus->channel(ch));
- return bus;
-}
-
-} // namespace copresence
« no previous file with comments | « components/copresence/test/audio_test_support.h ('k') | components/copresence/test/fake_directive_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698