New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fonos/marytts

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fonos/marytts - npm Package Compare versions

Comparing version 0.0.87 to 0.0.88

52

dist/mary_tts.d.ts

@@ -1,3 +0,3 @@

import {AbstractTTS} from "@fonos/tts";
import {MaryTTSConfig, MarySynthOptions} from "./types";
import { AbstractTTS } from "@fonos/tts";
import { MaryTTSConfig, MarySynthOptions } from "./types";
/**

@@ -25,26 +25,26 @@ * @classdesc The default TTS engine in a Fonos deployment.

export default class MaryTTS extends AbstractTTS {
serviceUrl: string;
/**
* Constructs a new MaryTTS object.
*
* @see module:tts:AbstractTTS
* @param {DefaultConfig} config - Configuration of the marytts
*/
constructor(config: MaryTTSConfig);
/**
* Init of the marytts constructor
*
* @param {DefaultConfig} config - Configuration of the marytts
*/
init(config: MaryTTSConfig): void;
/**
* @inherit
*
* @param {string} text - Text that will be synthesized
* @param {OptionsInterface} options - Options of the marytts, locale and voice
* @return {Promise<String>}
* For more information: http://marytts.phonetik.uni-muenchen.de:59125/documentation.html
* Advice: On windows the command "which" that sox library uses is not the same. In windows is "where" instead
*/
synthesize(text: string, options?: MarySynthOptions): Promise<string>;
serviceUrl: string;
/**
* Constructs a new MaryTTS object.
*
* @see module:tts:AbstractTTS
* @param {DefaultConfig} config - Configuration of the marytts
*/
constructor(config: MaryTTSConfig);
/**
* Init of the marytts constructor
*
* @param {DefaultConfig} config - Configuration of the marytts
*/
init(config: MaryTTSConfig): void;
/**
* @inherit
*
* @param {string} text - Text that will be synthesized
* @param {OptionsInterface} options - Options of the marytts, locale and voice
* @return {Promise<String>}
* For more information: http://marytts.phonetik.uni-muenchen.de:59125/documentation.html
* Advice: On windows the command "which" that sox library uses is not the same. In windows is "where" instead
*/
synthesize(text: string, options?: MarySynthOptions): Promise<string>;
}
"use strict";
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : {default: mod};
};
Object.defineProperty(exports, "__esModule", {value: true});
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/*

@@ -53,68 +51,49 @@ * Copyright (C) 2021 by Fonoster Inc (https://fonoster.com)

class MaryTTS extends tts_1.AbstractTTS {
/**
* Constructs a new MaryTTS object.
*
* @see module:tts:AbstractTTS
* @param {DefaultConfig} config - Configuration of the marytts
*/
constructor(config) {
super("mary-tts");
this.init(config);
}
/**
* Init of the marytts constructor
*
* @param {DefaultConfig} config - Configuration of the marytts
*/
init(config) {
const q = `INPUT_TYPE=TEXT&AUDIO=WAVE_FILE&OUTPUT_TYPE=AUDIO&LOCALE=${config.locale}`;
this.serviceUrl = `http://${config.host}:${config.port}/process?${q}`;
logger_1.default.log(
"debug",
`@fonos/tts.MaryTTS.constructor [initializing with config: ${JSON.stringify(
config
)}]`
);
logger_1.default.log(
"verbose",
`@fonos/tts.MaryTTS.constructor [serviceUrl: ${this.serviceUrl}]`
);
}
/**
* @inherit
*
* @param {string} text - Text that will be synthesized
* @param {OptionsInterface} options - Options of the marytts, locale and voice
* @return {Promise<String>}
* For more information: http://marytts.phonetik.uni-muenchen.de:59125/documentation.html
* Advice: On windows the command "which" that sox library uses is not the same. In windows is "where" instead
*/
synthesize(text, options = {locale: "EN_US", voice: ""}) {
const pathToFile = path_1.default.join(
"/tmp",
tts_1.computeFilename(text, options)
);
logger_1.default.log(
"debug",
`@fonos/tts.MaryTTS.synthesize [text: ${text}, options: ${JSON.stringify(
options
)}]`
);
return new Promise((resolve, reject) => {
const query = tts_1.optionsToQueryString(options);
http_1.default.get(
`${this.serviceUrl}&INPUT_TEXT=${encodeURI(text)}&${query}`,
(response) => {
const {statusCode} = response;
if (statusCode !== 200) {
reject(new Error(`Request failed status code: ${statusCode}`));
return;
}
response.pipe(fs_1.default.createWriteStream(pathToFile));
resolve(pathToFile);
}
);
});
}
/**
* Constructs a new MaryTTS object.
*
* @see module:tts:AbstractTTS
* @param {DefaultConfig} config - Configuration of the marytts
*/
constructor(config) {
super("mary-tts");
this.init(config);
}
/**
* Init of the marytts constructor
*
* @param {DefaultConfig} config - Configuration of the marytts
*/
init(config) {
const q = `INPUT_TYPE=TEXT&AUDIO=WAVE_FILE&OUTPUT_TYPE=AUDIO&LOCALE=${config.locale}`;
this.serviceUrl = `http://${config.host}:${config.port}/process?${q}`;
logger_1.default.log("debug", `@fonos/tts.MaryTTS.constructor [initializing with config: ${JSON.stringify(config)}]`);
logger_1.default.log("verbose", `@fonos/tts.MaryTTS.constructor [serviceUrl: ${this.serviceUrl}]`);
}
/**
* @inherit
*
* @param {string} text - Text that will be synthesized
* @param {OptionsInterface} options - Options of the marytts, locale and voice
* @return {Promise<String>}
* For more information: http://marytts.phonetik.uni-muenchen.de:59125/documentation.html
* Advice: On windows the command "which" that sox library uses is not the same. In windows is "where" instead
*/
synthesize(text, options = { locale: "EN_US", voice: "" }) {
const pathToFile = path_1.default.join("/tmp", tts_1.computeFilename(text, options));
logger_1.default.log("debug", `@fonos/tts.MaryTTS.synthesize [text: ${text}, options: ${JSON.stringify(options)}]`);
return new Promise((resolve, reject) => {
const query = tts_1.optionsToQueryString(options);
http_1.default.get(`${this.serviceUrl}&INPUT_TEXT=${encodeURI(text)}&${query}`, (response) => {
const { statusCode } = response;
if (statusCode !== 200) {
reject(new Error(`Request failed status code: ${statusCode}`));
return;
}
response.pipe(fs_1.default.createWriteStream(pathToFile));
resolve(pathToFile);
});
});
}
}
exports.default = MaryTTS;
export interface MarySynthOptions {
locale: string;
voice?: string;
locale: string;
voice?: string;
}
export interface MaryTTSConfig {
host: string;
port: string | number;
locale: string;
host: string;
port: string | number;
locale: string;
}
"use strict";
Object.defineProperty(exports, "__esModule", {value: true});
Object.defineProperty(exports, "__esModule", { value: true });
{
"name": "@fonos/marytts",
"version": "0.0.87",
"version": "0.0.88",
"description": "Concrete implementation of AbstractTTS",

@@ -32,12 +32,13 @@ "author": "Pedro Sanders <psanders@fonoster.com>",

"dependencies": {
"@fonos/logger": "^0.0.87",
"@fonos/tts": "^0.0.87",
"deepmerge": "^4.2.2"
"@fonos/logger": "^0.0.88",
"@fonos/tts": "^0.0.88"
},
"devDependencies": {
"dotenv": "^8.2.0",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"rimraf": "^3.0.2",
"typescript": "^4.1.5"
"sinon": "^10.0.0",
"sinon-chai": "^3.6.0"
},
"gitHead": "f432bd97cab50bfebfe2be9847cc5e2ff890c750"
"gitHead": "cb5c86eae9d3982c4ec62d0faa33c085eb9141e8"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc