Help us understand the problem. What is going on with this article?

[python]pdf からテキストを抽出して、Open-Jtalkで文字を読み上げる

PDFのテキストを抽出する
PythonのpdfminerでPDFのテキストを抽出する方法を現役エンジニアが解説【初心者向け】

$pip install pdfminer.six
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage

input_path = '抽出したPDFのパス'
output_path = 'result.txt'

manager = PDFResourceManager()

with open(output_path, "wb") as output:
    with open(input_path, 'rb') as input:
        with TextConverter(manager, output, codec='utf-8', laparams=LAParams()) as conv:
            interpreter = PDFPageInterpreter(manager, conv)
            for page in PDFPage.get_pages(input):
                interpreter.process_page(page)

Open JTalkのインストール

Pythonで音声を操作する方法
Pythonでテキストを読み上げる方法
以上2つのサイトを参考にさせて頂きました(というかほぼそのままです...)ありがとうございます。

Open JTalkのversionを1.11に書き換えました。

より人間っぽく読み上げるには以下のような記事を参考にすると良さそうです。
読み上げBotが感情を持ちました

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした