Created
June 12, 2021 00:30
-
-
Save hyuki/c56227c71999d0a0d388a2761db8199a to your computer and use it in GitHub Desktop.
text-to-speech-quick-example-with-azure-in-japanese.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
やったことは、
という感じです。