{"_id":"@caleblawson/voice-playai","name":"@caleblawson/voice-playai","dist-tags":{"latest":"0.10.3"},"versions":{"0.10.3":{"name":"@caleblawson/voice-playai","version":"0.10.3","description":"Mastra PlayAI voice integration","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"license":"Elastic-2.0","dependencies":{"zod":"^3.25.57"},"devDependencies":{"@microsoft/api-extractor":"^7.52.8","@types/node":"^20.19.0","eslint":"^9.28.0","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^2.1.9","@internal/lint":"0.0.13","@mastra/core":"npm:@caleblawson/core@0.10.7-alpha.0"},"peerDependencies":{"@mastra/core":"^0.10.0-alpha.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting","build:watch":"pnpm build --watch","test":"vitest run","lint":"eslint ."},"gitHead":"c31e90130a5c9765c23f688ecea70adc6164543d","_id":"@caleblawson/voice-playai@0.10.3","_integrity":"sha512-RmrdTUOwIQwffakKlYaxEItkD+SdjmFHjkIlSchikT1DtD4KFmAtSj+0pnklAEQIRkBWGum1/QbCxgO4B29t3A==","_resolved":"C:\\Users\\caleb\\AppData\\Local\\Temp\\fa23da015a6966c092dfa6624fe49385\\caleblawson-voice-playai-0.10.3.tgz","_from":"file:caleblawson-voice-playai-0.10.3.tgz","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-RmrdTUOwIQwffakKlYaxEItkD+SdjmFHjkIlSchikT1DtD4KFmAtSj+0pnklAEQIRkBWGum1/QbCxgO4B29t3A==","shasum":"160719654028c24d0193c183a1f99d0cb9f730da","tarball":"https://registry.npmjs.org/@caleblawson/voice-playai/-/voice-playai-0.10.3.tgz","fileCount":9,"unpackedSize":25613,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDx5UspienuY4gtDDev/ZrrqVZL/Jv23X0jxAz3lU5dawIhAJvXSMCVUTYtA86pIkMeCdwI1g5NWxddwOwBwB/Z6x4R"}]},"_npmUser":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","actor":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","type":"user"}},"directories":{},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/voice-playai_0.10.3_1750741065022_0.3276744652213519"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-24T04:57:44.933Z","0.10.3":"2025-06-24T04:57:45.203Z","modified":"2025-06-24T04:57:45.495Z"},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"description":"Mastra PlayAI voice integration","license":"Elastic-2.0","readme":"# @mastra/voice-playai\r\n\r\nPlayAI Voice integration for Mastra, providing Text-to-Speech (TTS) capabilities using PlayAI's voice synthesis technology.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @mastra/voice-playai\r\n```\r\n\r\n## Configuration\r\n\r\nThe module requires the following environment variables:\r\n\r\n```bash\r\nPLAYAI_API_KEY=your_api_key\r\nPLAYAI_USER_ID=your_user_id\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { PlayAIVoice } from '@mastra/voice-playai';\r\n\r\n// Initialize with configuration\r\nconst voice = new PlayAIVoice({\r\n  speechModel: {\r\n    name: 'PlayDialog', // Optional, defaults to 'PlayDialog'\r\n    apiKey: 'your-api-key', // Optional, can use PLAYAI_API_KEY env var\r\n    userId: 'your-user-id', // Optional, can use PLAYAI_USER_ID env var\r\n  },\r\n  speaker: 's3://voice-cloning-zero-shot/baf1ef41-36b6-428c-9bdf-50ba54682bd8/original/manifest.json', // Optional, defaults to first available voice\r\n});\r\n\r\n// Or use with defaults (using env vars)\r\nconst defaultVoice = new PlayAIVoice();\r\n\r\n// List available speakers\r\nconst speakers = await voice.getSpeakers();\r\n\r\n// Generate speech from text\r\nconst stream = await voice.speak('Hello from Mastra!');\r\n\r\n// Or generate speech from a text stream\r\nconst textStream = getTextStream(); // Your text stream source\r\nconst audioStream = await voice.speak(textStream);\r\n\r\n// The stream can be piped to a destination\r\nstream.pipe(destination);\r\n```\r\n\r\n## Features\r\n\r\n- High-quality Text-to-Speech synthesis\r\n- Multiple voice options\r\n- Streaming support for both input and output\r\n- Natural and expressive speech output\r\n- Voice customization options\r\n\r\n## Available Voices\r\n\r\nPlayAI offers a diverse selection of voices with different characteristics:\r\n\r\n### Conversational Style\r\n\r\n- Angelo (US, Young Male)\r\n  - ID: `s3://voice-cloning-zero-shot/baf1ef41-36b6-428c-9bdf-50ba54682bd8/original/manifest.json`\r\n- Arsenio (US African American, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/65977f5e-a22a-4b36-861b-ecede19bdd65/original/manifest.json`\r\n- Cillian (Irish, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/1591b954-8760-41a9-bc58-9176a68c5726/original/manifest.json`\r\n- Timo (US, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/677a4ae3-252f-476e-85ce-eeed68e85951/original/manifest.json`\r\n- Dexter (US, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/b27bc13e-996f-4841-b584-4d35801aea98/original/manifest.json`\r\n- Miles (US African American, Young Male)\r\n  - ID: `s3://voice-cloning-zero-shot/29dd9a52-bd32-4a6e-bff1-bbb98dcc286a/original/manifest.json`\r\n- Briggs (US Southern/Oklahoma, Elderly Male)\r\n  - ID: `s3://voice-cloning-zero-shot/71cdb799-1e03-41c6-8a05-f7cd55134b0b/original/manifest.json`\r\n- Deedee (US African American, Middle-aged Female)\r\n  - ID: `s3://voice-cloning-zero-shot/e040bd1b-f190-4bdb-83f0-75ef85b18f84/original/manifest.json`\r\n- Nia (US, Young Female)\r\n  - ID: `s3://voice-cloning-zero-shot/831bd330-85c6-4333-b2b4-10c476ea3491/original/manifest.json`\r\n- Inara (US African American, Middle-aged Female)\r\n  - ID: `s3://voice-cloning-zero-shot/adb83b67-8d75-48ff-ad4d-a0840d231ef1/original/manifest.json`\r\n- Constanza (US Latin American, Young Female)\r\n  - ID: `s3://voice-cloning-zero-shot/b0aca4d7-1738-4848-a80b-307ac44a7298/original/manifest.json`\r\n\r\n### Narrative Style\r\n\r\n- Gideon (British, Elderly Male)\r\n  - ID: `s3://voice-cloning-zero-shot/5a3a1168-7793-4b2c-8f90-aff2b5232131/original/manifest.json`\r\n- Casper (US, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/1bbc6986-fadf-4bd8-98aa-b86fed0476e9/original/manifest.json`\r\n- Mitch (Australian, Middle-aged Male)\r\n  - ID: `s3://voice-cloning-zero-shot/c14e50f2-c5e3-47d1-8c45-fa4b67803d19/original/manifest.json`\r\n- Ava (Australian, Middle-aged Female)\r\n  - ID: `s3://voice-cloning-zero-shot/50381567-ff7b-46d2-bfdc-a9584a85e08d/original/manifest.json`\r\n\r\nEach voice includes metadata about accent, gender, age, and speaking style. Use the voice ID when specifying a speaker.\r\n\r\n## API Reference\r\n\r\n### Constructor\r\n\r\n```typescript\r\nnew PlayAIVoice({\r\n  speechModel?: {\r\n    name?: 'PlayDialog' | 'Play3.0-mini', // Default: 'PlayDialog'\r\n    apiKey?: string,                      // Optional, can use PLAYAI_API_KEY env var\r\n    userId?: string,                      // Optional, can use PLAYAI_USER_ID env var\r\n  },\r\n  speaker?: string                        // Optional, defaults to first available voice ID\r\n})\r\n```\r\n\r\n### Methods\r\n\r\n#### `speak(input: string | NodeJS.ReadableStream, options?: { speaker?: string })`\r\n\r\nConverts text to speech. The speaker option should be a voice ID. Returns a readable stream of audio data.\r\n\r\n#### `getSpeakers()`\r\n\r\nReturns a list of available speakers with their details including voice IDs.\r\n\r\n#### `listen()`\r\n\r\nNot supported - PlayAI does not provide speech recognition.\r\n","readmeFilename":"README.md","_rev":"1-2903b1a6ca2cdd1a5490d9f1c59a82fc"}