speaker-calibration 2.2.238 → 2.2.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speaker-calibration",
3
- "version": "2.2.238",
3
+ "version": "2.2.239",
4
4
  "description": "Speaker calibration library for auditory testing",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
@@ -26,6 +26,10 @@ export class PhonePeer {
26
26
  console.log('connectionParams', data.payload);
27
27
  this.handleConnectionParams(data.payload);
28
28
  break;
29
+ case 'phrases':
30
+ console.log('phrases', data.payload);
31
+ this.handlePhrases(data.payload);
32
+ break;
29
33
  }
30
34
  };
31
35
 
@@ -42,6 +46,10 @@ export class PhonePeer {
42
46
  this.handleStartCalibration();
43
47
  };
44
48
 
49
+ handlePhrases = payload => {
50
+ this.phrases = payload;
51
+ };
52
+
45
53
  createUI = () => {
46
54
  const container = document.createElement('div');
47
55
  container.id = 'listenerContainer';
@@ -164,6 +164,18 @@ class Speaker extends AudioPeer {
164
164
  await speaker.connectionManager.waitForPeerConnection();
165
165
  await speaker.connectionManager.resolveWhenHandshakeReceived();
166
166
  speaker.connectionManager.sendPageTitle('EasyEyes Microphone');
167
+ speaker.connectionManager.send({
168
+ name: 'CompatibilityPeer',
169
+ message: 'Text',
170
+ text: 'Loading...',
171
+ });
172
+ speaker.connectionManager.send({
173
+ name: 'SoundCalibration',
174
+ message: 'phrases',
175
+ payload: {
176
+ phrases: speaker.phrases,
177
+ },
178
+ });
167
179
 
168
180
  // Send connection parameters to the listener
169
181
  speaker.connectionManager.send(speaker.prepareConnectionParams());