@fonoster/apiserver 0.7.56 → 0.7.57

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.
@@ -12,6 +12,7 @@ function convertToApplicationData(request) {
12
12
  endpoint: request.endpoint
13
13
  };
14
14
  const createProperty = (property) => {
15
+ console.log(property);
15
16
  return property
16
17
  ? {
17
18
  create: {
@@ -105,8 +105,8 @@ class ElevenLabs extends AbstractTextToSpeech_1.AbstractTextToSpeech {
105
105
  }
106
106
  }
107
107
  observeQueue();
108
- chunks.forEach((textChunk, index) => {
109
- this.doSynthesize(textChunk, voice)
108
+ chunks.forEach((text, index) => {
109
+ this.doSynthesize({ text, voice, model: options.model })
110
110
  .then((synthesizedText) => {
111
111
  results[index] = synthesizedText;
112
112
  })
@@ -117,13 +117,15 @@ class ElevenLabs extends AbstractTextToSpeech_1.AbstractTextToSpeech {
117
117
  return { ref, stream };
118
118
  });
119
119
  }
120
- doSynthesize(text, voice) {
120
+ doSynthesize(params) {
121
121
  return __awaiter(this, void 0, void 0, function* () {
122
+ const { text, voice, model } = params;
123
+ console.log("xxxxxxxx doSynthesize", text, voice, model);
122
124
  const response = yield this.client.generate({
123
125
  stream: true,
124
126
  voice,
125
127
  text,
126
- model_id: "eleven_turbo_v2_5",
128
+ model_id: model !== null && model !== void 0 ? model : "eleven_flash_v2_5",
127
129
  output_format: "pcm_16000"
128
130
  });
129
131
  return (yield (0, streamToBuffer_1.streamToBuffer)(response));
@@ -1,4 +1,5 @@
1
1
  type SynthOptions = {
2
2
  voice: string;
3
+ model?: string;
3
4
  };
4
5
  export { SynthOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/apiserver",
3
- "version": "0.7.56",
3
+ "version": "0.7.57",
4
4
  "description": "APIServer for Fonoster",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -72,5 +72,5 @@
72
72
  "@types/uuid": "^10.0.0",
73
73
  "@types/validator": "^13.12.0"
74
74
  },
75
- "gitHead": "f918235ae68a49970b45022637347f673ca63941"
75
+ "gitHead": "6049222cffcda692472cf27efc2af216c73bcf47"
76
76
  }