@mastra/voice-speechify 0.0.0-storage-20250225005900 → 0.0.0-vnextWorkflows-20250416071310

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/dist/index.cjs ADDED
@@ -0,0 +1,793 @@
1
+ 'use strict';
2
+
3
+ var stream = require('stream');
4
+ var voice = require('@mastra/core/voice');
5
+ var apiSdk = require('@speechify/api-sdk');
6
+
7
+ // src/index.ts
8
+
9
+ // src/voices.ts
10
+ var SPEECHIFY_VOICES = [
11
+ "henry",
12
+ "bwyneth",
13
+ "carly",
14
+ "kristy",
15
+ "oliver",
16
+ "tasha",
17
+ "joe",
18
+ "lisa",
19
+ "george",
20
+ "emily",
21
+ "rob",
22
+ "russell",
23
+ "benjamin",
24
+ "michael",
25
+ "kim",
26
+ "ankit",
27
+ "arun",
28
+ "carol",
29
+ "helen",
30
+ "julie",
31
+ "linda",
32
+ "mark",
33
+ "nick",
34
+ "elijah",
35
+ "beverly",
36
+ "collin",
37
+ "erin",
38
+ "jack",
39
+ "jesse",
40
+ "ken",
41
+ "lindsey",
42
+ "monica",
43
+ "phil",
44
+ "ron",
45
+ "stacy",
46
+ "archie",
47
+ "evelyn",
48
+ "freddie",
49
+ "harper",
50
+ "jacob",
51
+ "james",
52
+ "mason",
53
+ "victoria",
54
+ "christina",
55
+ "douglas",
56
+ "lauren",
57
+ "patricia",
58
+ "jennifer",
59
+ "robert",
60
+ "peter",
61
+ "jeremy",
62
+ "barbara",
63
+ "susan",
64
+ "charles",
65
+ "harold",
66
+ "sarah",
67
+ "karen",
68
+ "anthony",
69
+ "donald",
70
+ "paul",
71
+ "steven",
72
+ "andrew",
73
+ "kenneth",
74
+ "joshua",
75
+ "betty",
76
+ "margaret",
77
+ "kyle",
78
+ "edward",
79
+ "ronald",
80
+ "timothy",
81
+ "sandra",
82
+ "dorothy",
83
+ "jeffrey",
84
+ "kimberly",
85
+ "donna",
86
+ "walter",
87
+ "megan",
88
+ "richard",
89
+ "amanda",
90
+ "melissa",
91
+ "deborah",
92
+ "gary",
93
+ "rebecca",
94
+ "sharon",
95
+ "cynthia",
96
+ "kathleen",
97
+ "joan",
98
+ "shirley",
99
+ "angela",
100
+ "anna",
101
+ "brenda",
102
+ "larry",
103
+ "keith",
104
+ "scott",
105
+ "pamela",
106
+ "samuel",
107
+ "gregory",
108
+ "samantha",
109
+ "katherine",
110
+ "christine",
111
+ "frank",
112
+ "alexander",
113
+ "raymond",
114
+ "debra",
115
+ "patrick",
116
+ "catherine",
117
+ "carolyn",
118
+ "janet",
119
+ "ruth",
120
+ "zachary",
121
+ "heather",
122
+ "diane",
123
+ "dennis",
124
+ "jerry",
125
+ "tyler",
126
+ "aaron",
127
+ "virginia",
128
+ "joyce",
129
+ "judith",
130
+ "kelly",
131
+ "nathan",
132
+ "terry",
133
+ "carl",
134
+ "gerald",
135
+ "jaqueline",
136
+ "cheryl",
137
+ "christian",
138
+ "rohit",
139
+ "gloria",
140
+ "arthur",
141
+ "austin",
142
+ "sean",
143
+ "martha",
144
+ "randy",
145
+ "ralph",
146
+ "roy",
147
+ "alan",
148
+ "logan",
149
+ "willie",
150
+ "kathryn",
151
+ "frances",
152
+ "madison",
153
+ "bruce",
154
+ "billy",
155
+ "jordan",
156
+ "bryan",
157
+ "dylan",
158
+ "vincent",
159
+ "eugene",
160
+ "janice",
161
+ "jean",
162
+ "abigail",
163
+ "alice",
164
+ "bobby",
165
+ "julia",
166
+ "johnny",
167
+ "judy",
168
+ "bradley",
169
+ "hunter",
170
+ "dale",
171
+ "howard",
172
+ "fred",
173
+ "danielle",
174
+ "marilyn",
175
+ "blake",
176
+ "doris",
177
+ "denise",
178
+ "issac",
179
+ "theresa",
180
+ "natalie",
181
+ "aiden",
182
+ "brittany",
183
+ "charlotte",
184
+ "marie",
185
+ "kayla",
186
+ "alexis",
187
+ "lori",
188
+ "landon",
189
+ "tiffany",
190
+ "marcus",
191
+ "martin",
192
+ "curtis",
193
+ "kathy",
194
+ "todd",
195
+ "leonard",
196
+ "calvin",
197
+ "rose",
198
+ "ava",
199
+ "bonnie",
200
+ "peggy",
201
+ "edwin",
202
+ "don",
203
+ "ruby",
204
+ "crystal",
205
+ "craig",
206
+ "norma",
207
+ "paula",
208
+ "annie",
209
+ "shawn",
210
+ "lillian",
211
+ "robin",
212
+ "evan",
213
+ "garrette",
214
+ "francis",
215
+ "danny",
216
+ "stanley",
217
+ "lucy",
218
+ "jeffery",
219
+ "herbert",
220
+ "lee",
221
+ "april",
222
+ "anne",
223
+ "tammy",
224
+ "trevor",
225
+ "eleanor",
226
+ "regina",
227
+ "carrie",
228
+ "leah",
229
+ "beth",
230
+ "cody",
231
+ "shane",
232
+ "dana",
233
+ "allison",
234
+ "dawn",
235
+ "julian",
236
+ "wendy",
237
+ "travis",
238
+ "florence",
239
+ "tracy",
240
+ "adrian",
241
+ "phillis",
242
+ "carole",
243
+ "mildred",
244
+ "cameron",
245
+ "chad",
246
+ "connie",
247
+ "gladys",
248
+ "arlene",
249
+ "jana",
250
+ "leona",
251
+ "miriam",
252
+ "lorrie",
253
+ "velma",
254
+ "eduardo",
255
+ "bennie",
256
+ "rene",
257
+ "ed",
258
+ "stuart",
259
+ "terrence",
260
+ "delbert",
261
+ "colin",
262
+ "susanne",
263
+ "hugo",
264
+ "ignacio",
265
+ "sheldon",
266
+ "josefina",
267
+ "corinne",
268
+ "lana",
269
+ "cherry",
270
+ "erick",
271
+ "frankie",
272
+ "stewart",
273
+ "claudette",
274
+ "doyle",
275
+ "darrel",
276
+ "janine",
277
+ "simone",
278
+ "casey",
279
+ "leta",
280
+ "rogelio",
281
+ "lorraine",
282
+ "terence",
283
+ "santiago",
284
+ "alonzo",
285
+ "benny",
286
+ "elisa",
287
+ "dee",
288
+ "bert",
289
+ "elbert",
290
+ "charmaine",
291
+ "roslyn",
292
+ "shelley",
293
+ "ramiro",
294
+ "noel",
295
+ "mercedes",
296
+ "christie",
297
+ "laurel",
298
+ "spencer",
299
+ "pat",
300
+ "dorthy",
301
+ "jeanie",
302
+ "clare",
303
+ "aileen",
304
+ "grady",
305
+ "deana",
306
+ "cornelius",
307
+ "cecelia",
308
+ "maryann",
309
+ "rolando",
310
+ "lamar",
311
+ "susana",
312
+ "katharine",
313
+ "clay",
314
+ "liza",
315
+ "jerri",
316
+ "rochelle",
317
+ "cathy",
318
+ "percy",
319
+ "dexter",
320
+ "maribel",
321
+ "rosemarie",
322
+ "bradford",
323
+ "kari",
324
+ "nikki",
325
+ "bernadette",
326
+ "eugenia",
327
+ "merie",
328
+ "darie",
329
+ "amon",
330
+ "moses",
331
+ "concetta",
332
+ "irvin",
333
+ "rodolfo",
334
+ "christi",
335
+ "roman",
336
+ "janie",
337
+ "marcy",
338
+ "lindy",
339
+ "tommie",
340
+ "darnell",
341
+ "randal",
342
+ "selena",
343
+ "shari",
344
+ "antoinette",
345
+ "timmy",
346
+ "darrin",
347
+ "margo",
348
+ "sherri",
349
+ "erika",
350
+ "robbie",
351
+ "marcella",
352
+ "lela",
353
+ "winston",
354
+ "jeannine",
355
+ "brendan",
356
+ "christa",
357
+ "deloris",
358
+ "toby",
359
+ "elva",
360
+ "van",
361
+ "abel",
362
+ "myron",
363
+ "gracie",
364
+ "gwen",
365
+ "melba",
366
+ "boyd",
367
+ "shawna",
368
+ "courtney",
369
+ "marlena",
370
+ "cathie",
371
+ "ramesh",
372
+ "rita",
373
+ "joel",
374
+ "derek",
375
+ "earl",
376
+ "brett",
377
+ "ellis",
378
+ "ian",
379
+ "oscar",
380
+ "edna",
381
+ "ethel",
382
+ "gene",
383
+ "shannon",
384
+ "sheila",
385
+ "dustin",
386
+ "ellen",
387
+ "hilda",
388
+ "ray",
389
+ "marjorie",
390
+ "sylvia",
391
+ "barry",
392
+ "melvin",
393
+ "thelma",
394
+ "cindy",
395
+ "miranda",
396
+ "bernard",
397
+ "carlton",
398
+ "juanita",
399
+ "darrell",
400
+ "erik",
401
+ "jeremiah",
402
+ "nicolas",
403
+ "gordon",
404
+ "violet",
405
+ "mona",
406
+ "glen",
407
+ "willis",
408
+ "harvey",
409
+ "rudolph",
410
+ "preston",
411
+ "cole",
412
+ "june",
413
+ "pauline",
414
+ "leo",
415
+ "earnest",
416
+ "devin",
417
+ "audrey",
418
+ "claire",
419
+ "vivian",
420
+ "goldie",
421
+ "tommy",
422
+ "allen",
423
+ "glenn",
424
+ "wilson",
425
+ "jill",
426
+ "loretta",
427
+ "mabel",
428
+ "marsha",
429
+ "lillie",
430
+ "minnie",
431
+ "essie",
432
+ "madge",
433
+ "viola",
434
+ "nellie",
435
+ "pearl",
436
+ "marvin",
437
+ "mae",
438
+ "levi",
439
+ "lucille",
440
+ "hazel",
441
+ "nathaniel",
442
+ "lydia",
443
+ "bertha",
444
+ "ursula",
445
+ "kay",
446
+ "sue",
447
+ "dean",
448
+ "verna",
449
+ "teri",
450
+ "edith",
451
+ "dan",
452
+ "lewis",
453
+ "harriett",
454
+ "clifford",
455
+ "genevieve",
456
+ "colleen",
457
+ "gilbert",
458
+ "patrice",
459
+ "jared",
460
+ "elaine",
461
+ "maureen",
462
+ "edmund",
463
+ "nina",
464
+ "georgia",
465
+ "garrett",
466
+ "renee",
467
+ "bessie",
468
+ "leslie",
469
+ "max",
470
+ "leon",
471
+ "fannie",
472
+ "lowell",
473
+ "veronica",
474
+ "vanessa",
475
+ "joy",
476
+ "jim",
477
+ "faith",
478
+ "valerie",
479
+ "wanda",
480
+ "steve",
481
+ "naomi",
482
+ "miles",
483
+ "marcia",
484
+ "brent",
485
+ "clinton",
486
+ "jon",
487
+ "marshall",
488
+ "roberta",
489
+ "alexandra",
490
+ "doreen",
491
+ "daisy",
492
+ "della",
493
+ "minerva",
494
+ "cedric",
495
+ "patsy",
496
+ "kerry",
497
+ "lena",
498
+ "gregg",
499
+ "lois",
500
+ "kurt",
501
+ "lorene",
502
+ "susie",
503
+ "nora",
504
+ "lucinda",
505
+ "mathew",
506
+ "flora",
507
+ "rosie",
508
+ "sherman",
509
+ "lance",
510
+ "darcy",
511
+ "mattie",
512
+ "madeline",
513
+ "sylvester",
514
+ "cory",
515
+ "anita",
516
+ "allan",
517
+ "lula",
518
+ "nell",
519
+ "priscilla",
520
+ "kristin",
521
+ "rosemary",
522
+ "roosevelt",
523
+ "geneva",
524
+ "jeannette",
525
+ "bob",
526
+ "esther",
527
+ "michele",
528
+ "forrest",
529
+ "wilbert",
530
+ "cathleen",
531
+ "jaime",
532
+ "dwayne",
533
+ "inez",
534
+ "alberto",
535
+ "lynne",
536
+ "maxine",
537
+ "wilma",
538
+ "taylor",
539
+ "angelina",
540
+ "hope",
541
+ "margie",
542
+ "myrtle",
543
+ "misty",
544
+ "jimmie",
545
+ "eunice",
546
+ "everett",
547
+ "miracle",
548
+ "billie",
549
+ "leland",
550
+ "jackie",
551
+ "kristina",
552
+ "johnnie",
553
+ "isaac",
554
+ "bobbie",
555
+ "tonya",
556
+ "reba",
557
+ "kristine",
558
+ "amelia",
559
+ "cassandra",
560
+ "angie",
561
+ "maude",
562
+ "nichole",
563
+ "marguerite",
564
+ "justine",
565
+ "kelli",
566
+ "mandy",
567
+ "jeri",
568
+ "darla",
569
+ "shelia",
570
+ "jacquelin",
571
+ "cara",
572
+ "kellie",
573
+ "jolene",
574
+ "chelsea",
575
+ "autumn",
576
+ "glenda",
577
+ "lolita",
578
+ "jeanne",
579
+ "sherrie",
580
+ "toni",
581
+ "becky",
582
+ "jennie",
583
+ "jenna",
584
+ "leigh",
585
+ "cristina",
586
+ "blanche",
587
+ "clarissa",
588
+ "betsy",
589
+ "bridget",
590
+ "ginger",
591
+ "faye",
592
+ "candice",
593
+ "jaclyn",
594
+ "krista",
595
+ "marisa",
596
+ "gayle",
597
+ "meredith",
598
+ "angelica",
599
+ "rachael",
600
+ "candy",
601
+ "trisha",
602
+ "sandy",
603
+ "holly",
604
+ "alicia",
605
+ "melinda",
606
+ "geraldine",
607
+ "tara",
608
+ "isabel",
609
+ "adrienne",
610
+ "terra",
611
+ "rubye",
612
+ "antonia",
613
+ "guadalupe",
614
+ "cheri",
615
+ "janelle",
616
+ "constance",
617
+ "robyn",
618
+ "jodi",
619
+ "krystal",
620
+ "rosalie",
621
+ "deanna",
622
+ "debbie",
623
+ "josie",
624
+ "ronda",
625
+ "paulette",
626
+ "belinda",
627
+ "alton",
628
+ "rudy",
629
+ "kelvin",
630
+ "damon",
631
+ "johnathan",
632
+ "cesar",
633
+ "ira",
634
+ "horace",
635
+ "grant",
636
+ "lionel",
637
+ "wilbur",
638
+ "jake",
639
+ "jody",
640
+ "rickey",
641
+ "lester",
642
+ "pablo",
643
+ "neal",
644
+ "mack",
645
+ "orlando",
646
+ "alfonso",
647
+ "ernesto",
648
+ "rex",
649
+ "lynn",
650
+ "matt",
651
+ "lyle",
652
+ "kristopher",
653
+ "hubert",
654
+ "kenny",
655
+ "doug",
656
+ "sammy",
657
+ "homer",
658
+ "wendell",
659
+ "woodrow",
660
+ "felipe",
661
+ "garry",
662
+ "pete",
663
+ "marco",
664
+ "rufus",
665
+ "owen",
666
+ "bryant",
667
+ "abraham",
668
+ "irving",
669
+ "jermaine",
670
+ "julius",
671
+ "marty",
672
+ "alejandro",
673
+ "carmen",
674
+ "carlos",
675
+ "celia",
676
+ "lucas",
677
+ "luiza",
678
+ "diogo",
679
+ "agueda",
680
+ "raphael",
681
+ "elise",
682
+ "frederick",
683
+ "andra",
684
+ "frederik",
685
+ "freja",
686
+ "daan",
687
+ "lotte",
688
+ "eino",
689
+ "helmi",
690
+ "jakob",
691
+ "frida",
692
+ "kostas",
693
+ "eleni",
694
+ "lazzaro",
695
+ "alessia",
696
+ "mart",
697
+ "liis",
698
+ "trinh",
699
+ "thoa",
700
+ "lesya",
701
+ "taras",
702
+ "mikhail",
703
+ "olga",
704
+ "axel",
705
+ "ebba",
706
+ "hemant",
707
+ "priya",
708
+ "aicha",
709
+ "ismail",
710
+ "moshe",
711
+ "inbar",
712
+ "gil",
713
+ "lital",
714
+ "yusuf",
715
+ "elif",
716
+ "dominika",
717
+ "michal"
718
+ ];
719
+
720
+ // src/index.ts
721
+ var SpeechifyVoice = class extends voice.MastraVoice {
722
+ client;
723
+ constructor({ speechModel, speaker } = {}) {
724
+ super({
725
+ speechModel: {
726
+ name: speechModel?.name ?? "simba-english",
727
+ apiKey: speechModel?.apiKey ?? process.env.SPEECHIFY_API_KEY
728
+ },
729
+ speaker: speaker ?? "george"
730
+ });
731
+ const apiKey = speechModel?.apiKey ?? process.env.SPEECHIFY_API_KEY;
732
+ if (!apiKey) {
733
+ throw new Error("SPEECHIFY_API_KEY is not set");
734
+ }
735
+ this.client = new apiSdk.Speechify({ apiKey });
736
+ }
737
+ async getSpeakers() {
738
+ return this.traced(
739
+ () => SPEECHIFY_VOICES.map((voice) => ({
740
+ voiceId: voice,
741
+ name: voice
742
+ })),
743
+ "voice.speechify.voices"
744
+ )();
745
+ }
746
+ async streamToString(stream) {
747
+ const chunks = [];
748
+ for await (const chunk of stream) {
749
+ if (typeof chunk === "string") {
750
+ chunks.push(Buffer.from(chunk));
751
+ } else {
752
+ chunks.push(chunk);
753
+ }
754
+ }
755
+ return Buffer.concat(chunks).toString("utf-8");
756
+ }
757
+ async speak(input, options) {
758
+ const text = typeof input === "string" ? input : await this.streamToString(input);
759
+ return this.traced(async () => {
760
+ const request = {
761
+ input: text,
762
+ model: options?.model || this.speechModel?.name,
763
+ voiceId: options?.speaker || this.speaker,
764
+ ...options
765
+ };
766
+ const webStream = await this.client.audioStream(request);
767
+ const reader = webStream.getReader();
768
+ const nodeStream = new stream.Readable({
769
+ read: async function() {
770
+ try {
771
+ const { done, value } = await reader.read();
772
+ if (done) {
773
+ this.push(null);
774
+ } else {
775
+ this.push(value);
776
+ }
777
+ } catch (error) {
778
+ this.destroy(error);
779
+ }
780
+ }
781
+ });
782
+ nodeStream.on("end", () => {
783
+ reader.releaseLock();
784
+ });
785
+ return nodeStream;
786
+ }, "voice.speechify.speak")();
787
+ }
788
+ async listen(_input, _options) {
789
+ throw new Error("Speechify does not support speech recognition");
790
+ }
791
+ };
792
+
793
+ exports.SpeechifyVoice = SpeechifyVoice;