Text-To-Speechで音声が聞こえてきません。
英語にしてみても。日本語にしてみても聞こえません。
別にこれといってエラーで止まっているわけでもないようです。。。
Playというコンソールはでるので通っていると思うのですが、音が聞こえてこない
Windows 10です。
ナレータの設定かな?とおもいナレータの設定をいろいろ変えてみたもののダメでした、
なにかコードにおかしいとか設定があるなどありましたら、ご教授お願い致します。
C#
1using System; 2using System.IO; 3using Google.Cloud.TextToSpeech.V1; 4 5namespace Sirius.Library 6{ 7 class Speech 8 { 9 10 public void TextSpeech(string text) 11 { 12 13 TextToSpeechClient client = TextToSpeechClient.Create(); 14 15 SynthesisInput input = new SynthesisInput 16 { 17 Text = text 18 }; 19 20 VoiceSelectionParams voice = new VoiceSelectionParams 21 { 22 LanguageCode = "ja-JP", 23 SsmlGender = SsmlVoiceGender.Female 24 }; 25 26 AudioConfig config = new AudioConfig 27 { 28 AudioEncoding = AudioEncoding.Linear16, 29 30 }; 31 32 var response = client.SynthesizeSpeech( 33 input, 34 voice, 35 config 36 ); 37 38 using (var memoryStream = new MemoryStream(response.AudioContent, true)) 39 { 40 var player = new System.Media.SoundPlayer(memoryStream); 41 Console.Write("Play"); 42 player.Play(); 43 } 44 45 } 46 47 } 48} 49
C#
1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Text; 5using System.Threading.Tasks; 6using Sirius.Library; 7 8namespace Sirius 9{ 10 class Program 11 { 12 static void Main(string[] args) 13 { 14 15 var cls_sp = new Sirius.Library.Speech(); 16 Console.WriteLine("Hello"); 17 cls_sp.TextSpeech("HELLO"); 18 19 20 } 21 } 22} 23
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。