| 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_
|
|
|