hume 0.5.3 → 0.5.5

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.
Files changed (38) hide show
  1. package/Client.d.ts +3 -3
  2. package/Client.js +6 -6
  3. package/api/resources/customModels/resources/datasets/client/Client.js +9 -9
  4. package/api/resources/customModels/resources/files/client/Client.js +7 -7
  5. package/api/resources/customModels/resources/jobs/client/Client.js +2 -2
  6. package/api/resources/customModels/resources/models/client/Client.js +6 -6
  7. package/api/resources/empathicVoice/resources/chats/client/Client.js +2 -2
  8. package/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  9. package/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
  10. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
  11. package/api/resources/index.d.ts +1 -1
  12. package/api/resources/index.js +2 -2
  13. package/dist/Client.d.ts +3 -3
  14. package/dist/Client.js +6 -6
  15. package/dist/api/resources/customModels/resources/datasets/client/Client.js +9 -9
  16. package/dist/api/resources/customModels/resources/files/client/Client.js +7 -7
  17. package/dist/api/resources/customModels/resources/jobs/client/Client.js +2 -2
  18. package/dist/api/resources/customModels/resources/models/client/Client.js +6 -6
  19. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +2 -2
  20. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  21. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
  22. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
  23. package/dist/api/resources/index.d.ts +1 -1
  24. package/dist/api/resources/index.js +2 -2
  25. package/dist/serialization/resources/index.d.ts +1 -1
  26. package/dist/serialization/resources/index.js +2 -2
  27. package/dist/wrapper/index.d.ts +0 -1
  28. package/dist/wrapper/index.js +1 -3
  29. package/package.json +3 -6
  30. package/serialization/resources/index.d.ts +1 -1
  31. package/serialization/resources/index.js +2 -2
  32. package/tests/empathicVoice/chat.test.ts +2 -3
  33. package/wrapper/index.d.ts +0 -1
  34. package/wrapper/index.js +1 -3
  35. package/dist/wrapper/ffplay.d.ts +0 -2
  36. package/dist/wrapper/ffplay.js +0 -58
  37. package/wrapper/ffplay.d.ts +0 -2
  38. package/wrapper/ffplay.js +0 -58
@@ -1,3 +1,3 @@
1
- export * as customModels from "./customModels";
2
1
  export * as empathicVoice from "./empathicVoice";
2
+ export * as customModels from "./customModels";
3
3
  export * as expressionMeasurement from "./expressionMeasurement";
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.expressionMeasurement = exports.empathicVoice = exports.customModels = void 0;
27
- exports.customModels = __importStar(require("./customModels"));
26
+ exports.expressionMeasurement = exports.customModels = exports.empathicVoice = void 0;
28
27
  exports.empathicVoice = __importStar(require("./empathicVoice"));
28
+ exports.customModels = __importStar(require("./customModels"));
29
29
  exports.expressionMeasurement = __importStar(require("./expressionMeasurement"));
@@ -1,4 +1,4 @@
1
- import { HumeClient, ffplay } from "../../src/";
1
+ import { HumeClient } from "../../src/";
2
2
 
3
3
  describe("Empathic Voice Interface", () => {
4
4
  it.skip("Chat", async () => {
@@ -10,8 +10,7 @@ describe("Empathic Voice Interface", () => {
10
10
  const socket = await hume.empathicVoice.chat.connect({
11
11
  async onMessage(message): Promise<void> {
12
12
  if (message.type === "audio_output") {
13
- const decoded = Buffer.from(message.data, "base64");
14
- await ffplay(decoded);
13
+ Buffer.from(message.data, "base64");
15
14
  }
16
15
  }
17
16
  });
@@ -1,4 +1,3 @@
1
- export { ffplay } from "./ffplay";
2
1
  export { base64Decode } from "./base64Decode";
3
2
  export { base64Encode } from "./base64Encode";
4
3
  export { HumeClient } from "./HumeClient";
package/wrapper/index.js CHANGED
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HumeClient = exports.base64Encode = exports.base64Decode = exports.ffplay = void 0;
4
- var ffplay_1 = require("./ffplay");
5
- Object.defineProperty(exports, "ffplay", { enumerable: true, get: function () { return ffplay_1.ffplay; } });
3
+ exports.HumeClient = exports.base64Encode = exports.base64Decode = void 0;
6
4
  var base64Decode_1 = require("./base64Decode");
7
5
  Object.defineProperty(exports, "base64Decode", { enumerable: true, get: function () { return base64Decode_1.base64Decode; } });
8
6
  var base64Encode_1 = require("./base64Encode");
@@ -1,2 +0,0 @@
1
- /// <reference types="node" />
2
- export declare function ffplay(audio: Buffer): Promise<void>;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.ffplay = void 0;
39
- const command_exists_1 = __importDefault(require("command-exists"));
40
- const errors = __importStar(require("../errors"));
41
- const execa_1 = __importDefault(require("execa"));
42
- function ffplay(audio) {
43
- var _a, _b;
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (!(0, command_exists_1.default)("ffplay")) {
46
- throw new errors.HumeError({
47
- message: `ffplay from ffmpeg not found, necessary to play audio.
48
- On mac you can install it with 'brew install ffmpeg'.
49
- On linux and windows you can install it from https://ffmpeg.org/`,
50
- });
51
- }
52
- const ffmpeg = (0, execa_1.default)("ffplay", ["-autoexit", "-acodec", "pcm_s16le", "-", "-nodisp"]);
53
- (_a = ffmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(audio);
54
- (_b = ffmpeg.stdin) === null || _b === void 0 ? void 0 : _b.end();
55
- yield ffmpeg;
56
- });
57
- }
58
- exports.ffplay = ffplay;
@@ -1,2 +0,0 @@
1
- /// <reference types="node" />
2
- export declare function ffplay(audio: Buffer): Promise<void>;
package/wrapper/ffplay.js DELETED
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.ffplay = void 0;
39
- const command_exists_1 = __importDefault(require("command-exists"));
40
- const errors = __importStar(require("../errors"));
41
- const execa_1 = __importDefault(require("execa"));
42
- function ffplay(audio) {
43
- var _a, _b;
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (!(0, command_exists_1.default)("ffplay")) {
46
- throw new errors.HumeError({
47
- message: `ffplay from ffmpeg not found, necessary to play audio.
48
- On mac you can install it with 'brew install ffmpeg'.
49
- On linux and windows you can install it from https://ffmpeg.org/`,
50
- });
51
- }
52
- const ffmpeg = (0, execa_1.default)("ffplay", ["-autoexit", "-acodec", "pcm_s16le", "-", "-nodisp"]);
53
- (_a = ffmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(audio);
54
- (_b = ffmpeg.stdin) === null || _b === void 0 ? void 0 : _b.end();
55
- yield ffmpeg;
56
- });
57
- }
58
- exports.ffplay = ffplay;