{"id":763,"date":"2023-03-13T21:30:18","date_gmt":"2023-03-13T12:30:18","guid":{"rendered":"https:\/\/fukugyouhistory.tokyo\/?p=763"},"modified":"2023-03-28T11:26:37","modified_gmt":"2023-03-28T02:26:37","slug":"pyopenjtalk-tacotron2%e3%80%80%e9%9f%b3%e5%a3%b0%e5%90%88%e6%88%90ai%e3%82%92%e7%b0%a1%e5%8d%98%e3%81%ab%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/fukugyouhistory.tokyo\/?p=763","title":{"rendered":"pyopenjtalk , Tacotron2 , gTTS\u3000\u97f3\u58f0\u5408\u6210AI\u3092\u7c21\u5358\u306b\u4f7f\u3063\u3066\u307f\u305f"},"content":{"rendered":"\n<p>\u4eca\u56de\u306f\u3001<a rel=\"noreferrer noopener\" href=\"https:\/\/fukugyouhistory.tokyo\/?p=179\" target=\"_blank\">Whisper\uff08\u97f3\u58f0\u30fb\u52d5\u753b\u306e\u81ea\u52d5\u66f8\u304d\u8d77\u3053\u3057AI\uff09<\/a>\u3068\u306f\u9006\u306b\u3001\u6587\u7ae0\u304b\u3089\u97f3\u58f0\u3092\u4f5c\u6210\u3059\u308b<br>\u5408\u6210\u97f3\u58f0AI\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>2\u3064\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\u3001\u6bd4\u8f03\u3082\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/r9y9\/pyopenjtalk\" target=\"_blank\">pyopenjtalk<\/a>\u3000\uff1a\u3000OpenJTalk\u3092\u30d9\u30fc\u30b9\u3068\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9<br>\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u307e\u3055\u306bAI\u304c\u8a71\u3057\u3066\u3044\u308b\u3068\u5206\u304b\u308b\u97f3\u58f0\u5408\u6210AI<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/NVIDIA\/tacotron2\" target=\"_blank\">Tacotron2<\/a>\u3000\uff1a\u3000\u304b\u306a\u308a\u81ea\u7136\u3002\u305f\u3060\u3001\u97f3\u58f0\u5408\u6210\u306e\u51e6\u7406\u6642\u9593\u304c\u304b\u306a\u308a\u9577\u3044\u3002<br>\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u81ea\u5206\u306e\u58f0\u306a\u3069\u3092\u8ffd\u52a0\u3067\u5b66\u7fd2\u3059\u308b\u3053\u3068\u3067\u304d\u308b\u3089\u3057\u3044\u3002<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/gtts.readthedocs.io\/en\/latest\/index.html\" target=\"_blank\">gTTS<\/a>\u3000\uff1a\u3000Google\u304c\u63d0\u4f9b\u3059\u308bText-to-Speech<br>\u3000\u3000\u3000\u3000\u3000 Google Translate\u306e\u97f3\u58f0\u5408\u6210API\u3068\u9023\u643a\u3059\u308b\u305f\u3081\u306ePython\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n<\/ul>\n\n\n\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u305d\u3053\u307e\u3067\u8907\u96d1\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u30b5\u30af\u30c3\u3068\u8aac\u660e\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">pyopenjtalk<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/r9y9\/pyopenjtalk\" target=\"_blank\">pyopenjtalk<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u97f3\u58f0\u5408\u6210AI\u3067\u3059\u3002<br>\u65e9\u901f\u3001<a rel=\"noreferrer noopener\" href=\"https:\/\/colab.research.google.com\/?hl=ja\" target=\"_blank\">Google Colaboratory<\/a>\u4e0a\u3067\u52d5\u304b\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6700\u521d\u306b\u3001\u300c\u7de8\u96c6\u300d\u2192\u300c\u30ce\u30fc\u30c8\u30d6\u30c3\u30af\u306e\u8a2d\u5b9a\u300d\u304b\u3089\u3001<br>\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30c8\u3092\u300cGPU\u300d\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" sizes=\"(max-width: 880px) 100vw, 880px\" src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-35.png\" alt=\"\" class=\"wp-image-182\" width=\"420\" height=\"164\" srcset=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-35.png 880w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-35-300x117.png 300w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-35-768x299.png 768w\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3001Shift+Enter\u3092\u62bc\u3057\u3066\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<br>GPU\u306e\u60c5\u5831\u304c\u51fa\u3066\u304f\u308c\u3070\u3001\u6b63\u5e38\u306b\u8a2d\u5b9a\u5909\u66f4\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!nvidia-smi<\/code><\/pre>\n\n\n\n<p>\u7d9a\u3051\u3066\u3001\u30bd\u30fc\u30b9\u3092\u8a18\u8ff0\u3057\u3066\u5b9f\u884c\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install pyopenjtalk<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import pyopenjtalk\nimport numpy as np\nfrom scipy.io import wavfile\n\ntext = \"\u526f\u696d\u30d2\u30b9\u30c8\u30ea\u30fc\u3092\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>x, sr = pyopenjtalk.tts(text)\nwavfile.write(\"test_pyopenjtalk.wav\", sr, x.astype(np.int16))\n\n!rm \"test_pyopenjtalk.mp3\"\n!ffmpeg -i \"test_pyopenjtalk.wav\" \"test_pyopenjtalk.mp3\"\n!rm \"test_pyopenjtalk.wav\"<\/code><\/pre>\n\n\n\n<p>\u4e00\u77ac\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002\u65e9\u3044\u3067\u3059\u3002<br>\u5de6\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306b\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-181-1024x296.png\" alt=\"\" class=\"wp-image-768\" width=\"405\" height=\"116\" srcset=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-181-1024x296.png 1024w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-181-300x87.png 300w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-181-768x222.png 768w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-181.png 1125w\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002\u3044\u304b\u306b\u3082\u6a5f\u68b0\u97f3\u58f0\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_pyopenjtalk.mp3\"><\/audio><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Tacotron2<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/NVIDIA\/tacotron2\" target=\"_blank\">Tacotron2<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u97f3\u58f0\u5408\u6210AI\u3067\u3059\u3002<br>\u3053\u3061\u3089\u3082\u3001<a rel=\"noreferrer noopener\" href=\"https:\/\/colab.research.google.com\/?hl=ja\" target=\"_blank\">Google Colaboratory<\/a>\u4e0a\u3067\u52d5\u304b\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install ttslearn<\/code><\/pre>\n\n\n\n<p>\u5143\u3005\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u305f\u30e9\u30f3\u30bf\u30a4\u30e0\u3088\u308a\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u305f\u3081\u3001<br>\u30e9\u30f3\u30bf\u30a4\u30e0\u306e\u30ea\u30b9\u30bf\u30fc\u30c8\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u3002\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" sizes=\"(max-width: 668px) 100vw, 668px\" src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-182.png\" alt=\"\" class=\"wp-image-770\" width=\"404\" height=\"194\" srcset=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-182.png 668w, https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/image-182-300x144.png 300w\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>from ttslearn.tacotron import Tacotron2TTS\nimport numpy as np\nfrom scipy.io import wavfile\n\ntext = \"\u526f\u696d\u30d2\u30b9\u30c8\u30ea\u30fc\u3092\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>engine = Tacotron2TTS()\nx, sr = engine.tts(text)\nwavfile.write(\"test_tacotron2.wav\", sr, x.astype(np.int16))\n\n!rm \"test_tacotron2.mp3\"\n!ffmpeg -i \"test_tacotron2.wav\" \"test_tacotron2.mp3\"\n!rm \"test_tacotron2.wav\"<\/code><\/pre>\n\n\n\n<p>\u5148\u307b\u3069\u3068\u6253\u3063\u3066\u5909\u308f\u3063\u3066\u3001\u51e6\u7406\u306b5\u5206\u304f\u3089\u3044\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5de6\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306b\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<br>\u5148\u307b\u3069\u4f5c\u6210\u3055\u308c\u305f\u97f3\u58f0\u3068\u6bd4\u3079\u3066\u3001\u304b\u306a\u308a\u81ea\u7136\u306a\u4ed5\u4e0a\u304c\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_tacotron2.mp3\"><\/audio><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">gTTS<\/h2>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u5f8c\u65e5\u3001\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/mark><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/gtts.readthedocs.io\/en\/latest\/index.html\" target=\"_blank\">gTTS<\/a>\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u3053\u308c\u307e\u3067\u306e2\u3064\u3068\u7570\u306a\u308a\u3001\u76f4\u63a5MP3\u3067\u51fa\u529b\u53ef\u80fd\u3067\u3059\u3002<br>\u307e\u305f\u3001API\u51e6\u7406\u306a\u306e\u3067\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u3082\u7c21\u5358\u306b\u51e6\u7406\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install gtts<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>from gtts import gTTS\n\ntext = \"\u526f\u696d\u30d2\u30b9\u30c8\u30ea\u30fc\u3092\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002\"\ntts = gTTS(text=text, lang='ja')\ntts.save('gtts.mp3')<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p>pyopenjtalk\u3088\u308a\u306f\u81ea\u7136\u306b\u805e\u3053\u3048\u307e\u3059\u304c\u3001Tacotron2\u3088\u308a\u306f\u6a5f\u68b0\u7684\u306b\u805e\u3053\u3048\u307e\u3059\u3002<br>\u30b3\u30fc\u30c9\u3082\u77ed\u304f\u6e08\u3093\u3067\u51e6\u7406\u3082\u65e9\u3044\u306e\u3067\u3001\u4e00\u756a\u30d0\u30e9\u30f3\u30b9\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/gtts.mp3\"><\/audio><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u97f3\u58f0\u5408\u6210\u3059\u308b<\/h2>\n\n\n\n<p>\u4e00\u6587\u305a\u3064\u5165\u529b\u3059\u308b\u306e\u306f\u624b\u9593\u3067\u3059\u306e\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u307e\u3068\u3081\u3066\u51e6\u7406\u3057\u307e\u3059\u3002<br>\u51e6\u7406\u304c\u8efd\u3044\u306e\u3067\u3001pyopenjtalk\u3092\u4f7f\u7528\u3057\u305f\u30b3\u30fc\u30c9\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u97f3\u58f0\u5408\u6210\u3057\u305f\u3044\u6587\u7ae0\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3001test.txt\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<br>\u6587\u5b57\u30b3\u30fc\u30c9\u306fUTF-8\u3067\u3059\u3002\u30e1\u30e2\u5e33\u3067\u958b\u3044\u305f\u3068\u304d\u306b\u306f\u3001\u53f3\u4e0b\u306b\u6587\u5b57\u30b3\u30fc\u30c9\u304c\u51fa\u308b\u306e\u3067\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<br>\u5de6\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306b\u30c9\u30e9\u30c3\u30af\uff06\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ChatGPT\u306f\u3001OpenAI\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u5927\u898f\u6a21\u306a\u8a00\u8a9e\u30e2\u30c7\u30eb\u306e1\u3064\u3067\u3059\u3002\nChatGPT\u306f\u3001\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u306b\u304a\u3051\u308b\u4f1a\u8a71\u3084\u6587\u7ae0\u751f\u6210\u306a\u3069\u306e\u30bf\u30b9\u30af\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\nChatGPT\u306f\u3001\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u5b66\u7fd2\u3057\u3001\u4eba\u9593\u306e\u3088\u3046\u306a\u5fdc\u7b54\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\nChatGPT\u306f\u3001\u8cea\u554f\u306b\u7b54\u3048\u308b\u3001\u6587\u66f8\u751f\u6210\u3001\u6587\u7ae0\u306e\u8981\u7d04\u3001\u6587\u7ae0\u306e\u7ffb\u8a33\u306a\u3069\u3001\u69d8\u3005\u306a\u81ea\u7136\u8a00\u8a9e\u51e6\u7406\u30bf\u30b9\u30af\u306b\u5fdc\u7528\u3055\u308c\u307e\u3059\u3002<\/code><\/pre>\n\n\n\n<p>\u3055\u3066\u3001\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3057\u3066\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install pyopenjtalk<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import pyopenjtalk\nimport numpy as np\nfrom scipy.io import wavfile<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>i = 0\nwith open('test.txt', 'r', encoding=\"utf-8\") as f:\n    for line in f:\n        line = line.rstrip()  # \u8aad\u307f\u8fbc\u3093\u3060\u884c\u306e\u672b\u5c3e\u306b\u306f\u6539\u884c\u6587\u5b57\u304c\u3042\u308b\u306e\u3067\u524a\u9664\n        x, sr = pyopenjtalk.tts(line)\n\n        wav_file_name = \"test_pyopenjtalk_\" + format(i, '02') + \".wav\"\n        mp3_file_name = \"test_pyopenjtalk_\" + format(i, '02') + \".mp3\"\n\n        wavfile.write(wav_file_name, sr, x.astype(np.int16))\n\n        !rm $mp3_file_name\n        !ffmpeg -i $wav_file_name $mp3_file_name\n        !rm $wav_file_name\n\n        i = i + 1<\/code><\/pre>\n\n\n\n<p>test_pyopenjtalk_00.mp3\uff5etest_pyopenjtalk_XX.mp3\u307e\u3067\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br>\u884c\u6570\u304c\u591a\u304f\u3066100\u3092\u8d85\u3048\u308b\u5834\u5408\u3001format(i, &#8217;02&#8217;)\u2192format(i, &#8217;03&#8217;)\u3068\u9069\u5b9c\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_pyopenjtalk_00.mp3\"><\/audio><\/figure>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_pyopenjtalk_01.mp3\"><\/audio><\/figure>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_pyopenjtalk_02.mp3\"><\/audio><\/figure>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/fukugyouhistory.tokyo\/wp-content\/uploads\/2023\/03\/test_pyopenjtalk_03.mp3\"><\/audio><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e00\u5fdc\u3001Tacotron2\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30b3\u30fc\u30c9\u3082\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install ttslearn<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>from ttslearn.tacotron import Tacotron2TTS\nimport numpy as np\nfrom scipy.io import wavfile<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>engine = Tacotron2TTS()\n\ni = 0\nwith open('test.txt', 'r', encoding=\"utf-8\") as f:\n    for line in f:\n        line = line.rstrip()  # \u8aad\u307f\u8fbc\u3093\u3060\u884c\u306e\u672b\u5c3e\u306b\u306f\u6539\u884c\u6587\u5b57\u304c\u3042\u308b\u306e\u3067\u524a\u9664\n        x, sr = engine.tts(line)\n\n        wav_file_name = \"test_tacotron2_\" + format(i, '02') + \".wav\"\n        mp3_file_name = \"test_tacotron2_\" + format(i, '02') + \".mp3\"\n\n        wavfile.write(wav_file_name, sr, x.astype(np.int16))\n\n        !rm $mp3_file_name\n        !ffmpeg -i $wav_file_name $mp3_file_name\n        !rm $wav_file_name\n\n        i = i + 1<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u5f8c\u65e5\u3001\u8ffd\u52a0\u5206\u3002<\/mark>gTTS\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30b3\u30fc\u30c9\u3082\u8f09\u305b\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install gtts<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>from gtts import gTTS\n\ni = 0\nwith open('test.txt', 'r', encoding=\"utf-8\") as f:\n    for line in f:\n        line = line.rstrip()  # \u8aad\u307f\u8fbc\u3093\u3060\u884c\u306e\u672b\u5c3e\u306b\u306f\u6539\u884c\u6587\u5b57\u304c\u3042\u308b\u306e\u3067\u524a\u9664\n        tts = gTTS(text=line, lang='ja')\n\n        mp3_file_name = \"test_gtts_\" + format(i, '02') + \".mp3\"\n\n        tts.save(mp3_file_name)\n\n        i = i + 1<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u3053\u3053\u307e\u3067\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u3001Whisper\uff08\u97f3\u58f0\u30fb\u52d5\u753b\u306e\u81ea\u52d5\u66f8\u304d\u8d77\u3053\u3057AI\uff09\u3068\u306f\u9006\u306b\u3001\u6587\u7ae0\u304b\u3089\u97f3\u58f0\u3092\u4f5c\u6210\u3059\u308b\u5408\u6210\u97f3\u58f0AI\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002 2\u3064\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\u3001\u6bd4\u8f03\u3082\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u305d\u3053\u307e\u3067\u8907\u96d1\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u30b5\u30af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":{"0":"post-763","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-ai"},"_links":{"self":[{"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=763"}],"version-history":[{"count":26,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":1407,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions\/1407"}],"wp:attachment":[{"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fukugyouhistory.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}