phonic 0.2.0 → 0.4.0
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/README.md +13 -3
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +8 -6
- package/dist/index.mjs +5 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ const phonic = new Phonic("ph_...");
|
|
|
30
30
|
### Get voices
|
|
31
31
|
|
|
32
32
|
```js
|
|
33
|
-
const { data, error } = await phonic.voices.list();
|
|
33
|
+
const { data, error } = await phonic.voices.list({ model: "shasta" });
|
|
34
34
|
|
|
35
35
|
if (error === null) {
|
|
36
36
|
console.log(data.voices);
|
|
@@ -41,7 +41,7 @@ if (error === null) {
|
|
|
41
41
|
### Get voice by id
|
|
42
42
|
|
|
43
43
|
```js
|
|
44
|
-
const { data, error } = await phonic.voices.get("
|
|
44
|
+
const { data, error } = await phonic.voices.get("meredith");
|
|
45
45
|
|
|
46
46
|
if (error === null) {
|
|
47
47
|
console.log(data.voice);
|
|
@@ -56,7 +56,7 @@ Open a WebSocket connection:
|
|
|
56
56
|
const { data, error } = await phonic.tts.websocket({
|
|
57
57
|
model: "shasta",
|
|
58
58
|
output_format: "mulaw_8000",
|
|
59
|
-
voice_id: "
|
|
59
|
+
voice_id: "meredith",
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
if (error !== null) {
|
|
@@ -141,6 +141,16 @@ phonicWebSocket.onError((event) => {
|
|
|
141
141
|
});
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
## Publish a new version on npm
|
|
145
|
+
|
|
146
|
+
1. `bunx changeset`
|
|
147
|
+
2. `git add .`
|
|
148
|
+
3. `git commit -m "Add changeset"`
|
|
149
|
+
4. `git push`
|
|
150
|
+
|
|
151
|
+
This should trigger the `publish` github workflow that will create a Pull Request named "Version Packages".
|
|
152
|
+
Once this Pull Request is merged, the new version will be published on npm.
|
|
153
|
+
|
|
144
154
|
## License
|
|
145
155
|
|
|
146
156
|
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -33,7 +33,9 @@ type PhonicWebSocketResponseMessage = {
|
|
|
33
33
|
audio: string;
|
|
34
34
|
text: string;
|
|
35
35
|
} | {
|
|
36
|
-
type: "
|
|
36
|
+
type: "flush_confirm";
|
|
37
|
+
} | {
|
|
38
|
+
type: "stop_confirm";
|
|
37
39
|
} | {
|
|
38
40
|
type: "error";
|
|
39
41
|
error: {
|
|
@@ -92,7 +94,9 @@ type VoiceSuccessResponse = {
|
|
|
92
94
|
declare class Voices {
|
|
93
95
|
private readonly phonic;
|
|
94
96
|
constructor(phonic: Phonic);
|
|
95
|
-
list(
|
|
97
|
+
list({ model }: {
|
|
98
|
+
model: string;
|
|
99
|
+
}): DataOrError<VoicesSuccessResponse>;
|
|
96
100
|
get(id: string): DataOrError<VoiceSuccessResponse>;
|
|
97
101
|
}
|
|
98
102
|
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,9 @@ type PhonicWebSocketResponseMessage = {
|
|
|
33
33
|
audio: string;
|
|
34
34
|
text: string;
|
|
35
35
|
} | {
|
|
36
|
-
type: "
|
|
36
|
+
type: "flush_confirm";
|
|
37
|
+
} | {
|
|
38
|
+
type: "stop_confirm";
|
|
37
39
|
} | {
|
|
38
40
|
type: "error";
|
|
39
41
|
error: {
|
|
@@ -92,7 +94,9 @@ type VoiceSuccessResponse = {
|
|
|
92
94
|
declare class Voices {
|
|
93
95
|
private readonly phonic;
|
|
94
96
|
constructor(phonic: Phonic);
|
|
95
|
-
list(
|
|
97
|
+
list({ model }: {
|
|
98
|
+
model: string;
|
|
99
|
+
}): DataOrError<VoicesSuccessResponse>;
|
|
96
100
|
get(id: string): DataOrError<VoiceSuccessResponse>;
|
|
97
101
|
}
|
|
98
102
|
|
package/dist/index.js
CHANGED
|
@@ -28,14 +28,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Phonic: () => Phonic
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "0.
|
|
38
|
+
var version = "0.4.0";
|
|
39
39
|
|
|
40
40
|
// src/tts/index.ts
|
|
41
41
|
var import_ws = __toESM(require("ws"));
|
|
@@ -138,8 +138,10 @@ var Voices = class {
|
|
|
138
138
|
constructor(phonic) {
|
|
139
139
|
this.phonic = phonic;
|
|
140
140
|
}
|
|
141
|
-
async list() {
|
|
142
|
-
const response = await this.phonic.get(
|
|
141
|
+
async list({ model }) {
|
|
142
|
+
const response = await this.phonic.get(
|
|
143
|
+
`/voices?model=${encodeURIComponent(model)}`
|
|
144
|
+
);
|
|
143
145
|
return response;
|
|
144
146
|
}
|
|
145
147
|
async get(id) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.4.0";
|
|
3
3
|
|
|
4
4
|
// src/tts/index.ts
|
|
5
5
|
import WebSocket from "ws";
|
|
@@ -102,8 +102,10 @@ var Voices = class {
|
|
|
102
102
|
constructor(phonic) {
|
|
103
103
|
this.phonic = phonic;
|
|
104
104
|
}
|
|
105
|
-
async list() {
|
|
106
|
-
const response = await this.phonic.get(
|
|
105
|
+
async list({ model }) {
|
|
106
|
+
const response = await this.phonic.get(
|
|
107
|
+
`/voices?model=${encodeURIComponent(model)}`
|
|
108
|
+
);
|
|
107
109
|
return response;
|
|
108
110
|
}
|
|
109
111
|
async get(id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phonic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Phonic Node.js SDK",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@biomejs/biome": "1.9.4",
|
|
40
40
|
"@changesets/changelog-github": "0.5.0",
|
|
41
|
-
"@changesets/cli": "2.27.
|
|
42
|
-
"@types/bun": "1.
|
|
43
|
-
"tsup": "8.3.
|
|
44
|
-
"typescript": "5.7.
|
|
45
|
-
"zod": "3.24.
|
|
41
|
+
"@changesets/cli": "2.27.12",
|
|
42
|
+
"@types/bun": "1.2.2",
|
|
43
|
+
"tsup": "8.3.6",
|
|
44
|
+
"typescript": "5.7.3",
|
|
45
|
+
"zod": "3.24.2"
|
|
46
46
|
},
|
|
47
47
|
"files": ["dist/**"],
|
|
48
48
|
"author": {
|