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.81 to 0.0.82

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});
/*

@@ -51,49 +53,68 @@ * 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.81",
"version": "0.0.82",
"description": "Concrete implementation of AbstractTTS",
"author": "Pedro Sanders <sanderspedro@gmail.com>",
"author": "Pedro Sanders <psanders@fonoster.com>",
"homepage": "https://github.com/fonoster/fonos#readme",

@@ -32,4 +32,4 @@ "license": "MIT",

"dependencies": {
"@fonos/logger": "^0.0.81",
"@fonos/tts": "^0.0.81",
"@fonos/logger": "^0.0.82",
"@fonos/tts": "^0.0.82",
"deepmerge": "^4.2.2"

@@ -42,3 +42,3 @@ },

},
"gitHead": "983ae83264743dc9696719ed1ca9c01d6a392ff9"
"gitHead": "a49e32b68668455295898ec4c98cca76a9a5b3c8"
}
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