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

Unified Diff: components/audio_modem/public/audio_modem_types.h

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
« no previous file with comments | « components/audio_modem/modem_unittest.cc ('k') | components/audio_modem/public/modem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/audio_modem/public/audio_modem_types.h
diff --git a/components/audio_modem/public/audio_modem_types.h b/components/audio_modem/public/audio_modem_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..32c6757851065f23356d453d885bf90151a51a99
--- /dev/null
+++ b/components/audio_modem/public/audio_modem_types.h
@@ -0,0 +1,58 @@
+// 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_PUBLIC_AUDIO_MODEM_TYPES_H_
+#define COMPONENTS_AUDIO_MODEM_PUBLIC_AUDIO_MODEM_TYPES_H_
+
+#include <string>
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
+#include "media/base/channel_layout.h"
+
+// Various constants and types used for the audio modem.
+// TODO(ckehoe): Move the constants out into their own header.
+
+namespace audio_modem {
+
+// Number of repetitions of the audio token in one sequence of samples.
+extern const int kDefaultRepetitions;
+
+// Whispernet encoding parameters. These need to be the same on all platforms.
+extern const float kDefaultSampleRate;
+extern const int kDefaultBitsPerSample;
+extern const float kDefaultCarrierFrequency;
+
+// The next two really need to be configurable since they don't need to be
+// consistent across platforms, or even playing/recording.
+extern const int kDefaultChannels;
+extern const media::ChannelLayout kDefaultChannelLayout;
+
+// Enum to represent the audio band (audible vs. ultrasound).
+// AUDIBLE and INAUDIBLE are used as array indices.
+enum AudioType {
+ AUDIBLE = 0,
+ INAUDIBLE = 1,
+ BOTH = 2,
+ AUDIO_TYPE_UNKNOWN = 3,
+};
+
+// Struct representing an audio token.
+// TODO(ckehoe): Make this use the AudioType enum instead of a boolean.
+struct AudioToken final {
+ AudioToken(const std::string& token, bool audible)
+ : token(token),
+ audible(audible) {}
+
+ std::string token;
+ bool audible;
+};
+
+// Callback to pass around found tokens.
+using TokensCallback = base::Callback<void(const std::vector<AudioToken>&)>;
+
+} // namespace audio_modem
+
+#endif // COMPONENTS_AUDIO_MODEM_PUBLIC_AUDIO_MODEM_TYPES_H_
« no previous file with comments | « components/audio_modem/modem_unittest.cc ('k') | components/audio_modem/public/modem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698