Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
text-to-speech-quick-example-with-azure-in-japanese.js
// cf. https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/quickstart/javascript/node/text-to-speech/index.js
var subscriptionKey = "99999999999999999999999999999999"; // Your Subscription Key.
var serviceRegion = "japaneast"; // "westus"
var filename = "output.mp3";
var audioConfig = sdk.AudioConfig.fromAudioFileOutput(filename);
var speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);
// https://docs.microsoft.com/en-us/javascript/api/microsoft-cognitiveservices-speech-sdk/speechsynthesisoutputformat?view=azure-node-latest
speechConfig.speechSynthesisOutputFormat = 5; // Audio16Khz64KBitRateMonoMp3;
// https://docs.microsoft.com/ja-jp/azure/cognitive-services/speech-service/language-support
speechConfig.speechSynthesisVoiceName = 'ja-JP-Ayumi'; // 'ja-JP-HarukaRUS','ja-JP-Ichiro'
// Example Result: https://audio.hyuki.net/20210612092121-780f03380bf2910f-output.mp3
@hyuki
Copy link
Author

hyuki commented Jun 12, 2021

こんにちは。これはアジュールを使った音声合成のテストです。よろしくお願いします。

https://audio.hyuki.net/20210612092121-780f03380bf2910f-output.mp3

@hyuki
Copy link
Author

hyuki commented Jun 12, 2021

@hyuki
Copy link
Author

hyuki commented Jun 12, 2021

ここにあるサンプルのままだと英語でWAVファイルになっちゃうので、config情報を書き換えたということです。

@hyuki
Copy link
Author

hyuki commented Jun 12, 2021

やったことは、

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment