
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
クロスプラットフォーム対応の日本語/英語音声合成モジュール。Windows、macOS、Linux対応でテキストを音声で読み上げます。
npm install node-talk
グローバルインストール(CLIツールとして使用):
npm install -g node-talk
const { speak, speakTokenized, isJapanese, tokenizeText } = require('node-talk');
// 基本的な使い方
speak('こんにちは!');
speak('Hello world!');
// オプションを指定
speak('ゆっくり話します', { rate: 100 });
speak('This is fast speech', { rate: 300 });
// 別の音声を使用
speak('違う声で話します', { voice: 'Kyoko' });
speak('Different voice', { voice: 'Fred' });
// 混在したテキストをトークンごとに適切な音声で読み上げ
await speakTokenized('Hello世界! This is 日本語 mixed with English.', { tokenize: true });
// カスタム音声を言語別に適用
await speakTokenized('Hello world こんにちは', {
tokenize: true,
voice: 'Fred' // 英語部分のみFredで読み上げ、日本語はデフォルト
});
// 日本語判定機能
console.log(isJapanese('こんにちは')); // true
console.log(isJapanese('Hello')); // false
ntalk こんにちは
ntalk Hello world
ntalk "Hello 世界! This is 日本語 mixed with English."
# カスタム音声を指定
ntalk -v Fred "Hello world"
ntalk -v Kyoko "こんにちは世界"
ntalk -v "Reed (日本語(日本))" "こんにちは" # 括弧付き音声名は引用符で囲む
# 読み上げ速度を指定
ntalk -r 300 "速く読み上げます"
ntalk -r 100 "ゆっくり読み上げます"
# 混在テキストで言語別に音声を適用
ntalk -v Fred "Hello world こんにちは世界" # 英語部分のみFred、日本語はデフォルト
# ヘルプと音声リストを表示
ntalk --help
ntalk --voices
テキストを音声で読み上げます。
text
(string): 読み上げるテキストoptions
(object): オプション設定
voice
(string): 使用する音声の名前rate
(number): 読み上げ速度(1分間あたりの単語数)日本語テキストの場合、デフォルトでkyoto
音声(速度200)が使用されます。
英語テキストの場合、デフォルトでSamantha
音声が使用されます。
混在したテキストをトークンごとに分割し、それぞれ適切な音声で読み上げます。
text
(string): 読み上げるテキストoptions
(object): オプション設定
tokenize
(boolean): トークン分割を有効にする(デフォルト: false)voice
(string): 使用する音声の名前(言語別に適用)rate
(number): 読み上げ速度// 日本語と英語が混在したテキストを適切に読み上げ
await speakTokenized('Hello世界! This is 日本語 mixed with English.', { tokenize: true });
// 英語音声を指定(英語部分のみに適用)
await speakTokenized('Hello world こんにちは', {
tokenize: true,
voice: 'Fred'
});
// 日本語音声を指定(日本語部分のみに適用)
await speakTokenized('Hello world こんにちは', {
tokenize: true,
voice: 'Kyoko'
});
重要: voice
オプションは言語別に適用されます:
テキストに日本語(ひらがな、カタカナ、漢字)が含まれているかを判定します。
text
(string): 判定するテキストtrue
テキストを言語ごとのトークンに分割します。
text
(string): 分割するテキストtext
(string): トークンのテキストisJapanese
(boolean): 日本語かどうかconst tokens = tokenizeText('Hello世界!');
// [
// { text: 'Hello', isJapanese: false },
// { text: '世界', isJapanese: true },
// { text: '!', isJapanese: false }
// ]
利用可能な音声は環境によって異なります。以下のコマンドで確認できます:
ntalk --voices
一般的な音声:
括弧を含む音声名は引用符で囲んでください:
ntalk -v "Reed (日本語(日本))" "こんにちは"
say
コマンド(プリインストール済み)espeak-ng
(推奨)espeak
festival
speech-dispatcher
# 通常は追加インストール不要(PowerShellが標準搭載)
# 日本語音声を使用する場合:
# 設定 > 時刻と言語 > 言語 > 日本語を追加
# Ubuntu/Debian
sudo apt-get install espeak-ng
# CentOS/RHEL/Fedora
sudo yum install espeak-ng
# Arch Linux
sudo pacman -S espeak-ng
# Alpine Linux
sudo apk add espeak-ng
# 追加インストール不要(sayコマンドが標準搭載)
MIT
FAQs
クロスプラットフォーム対応の日本語/英語音声合成モジュール。Windows、macOS、Linux対応。
The npm package node-talk receives a total of 90 weekly downloads. As such, node-talk popularity was classified as not popular.
We found that node-talk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.