1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Use the <code>chrome.copresencePrivate</code> API to interface with Chrome
6 // from the whispernet_proxy extension.
7 namespace copresencePrivate {
9 dictionary PlayParameters {
12 double carrierFrequency;
16 dictionary RecordParameters {
20 double carrierFrequency;
23 dictionary AudioParameters {
25 RecordParameters record;
34 // Send a boolean indicating whether our initialization was successful.
35 static void sendInitialized(boolean success);
36 // Sends an array of found tokens to Chrome.
37 static void sendFound(Token[] tokens);
38 // Send an array buffer of samples encoded for the specified token.
39 static void sendSamples(Token token, ArrayBuffer samples);
40 // Send a boolean indicating whether we detected a broadcast or not.
41 static void sendDetect(boolean detected);
45 // Fired to request initialization of the whisper.net library.
46 static void onInitialize(AudioParameters audioParams);
47 // Fired to request encoding of the given token.
48 static void onEncodeTokenRequest(DOMString base64Token, boolean audible);
49 // Fired when we have new samples to decode.
50 static void onDecodeSamplesRequest(ArrayBuffer audioSamples);
51 // Fired to request a DetectBroadcast.
52 static void onDetectBroadcastRequest();