PDF 中的演讲?

发布于 2024-09-08 15:40:09 字数 155 浏览 3 评论 0原文

我想在 PDF 文档中添加语音/旁白。

因此,句子会突出显示(背景颜色或文本颜色发生变化),并且会播放同步音频(不是计算机语音,而是录制的音频剪辑)。我该怎么做?是否有现成的软件(最好是在 Mac 上)可以实现此目的?

我将不胜感激任何帮助。

谢谢

I'd like to add speech-over/narration to a PDF document.

So a sentence is highlighted (background color or text color changes) and the synced audio (not a computer voice but a recorded audio clip) plays. How do I do it? Are there readymade software available (on mac preferably) to achieve this?

I'd appreciate any help.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猛虎独行 2024-09-15 15:40:10

棘手的问题。
几年前,我想说,做到这一点的唯一方法是使用 Acrobat 插件,因为这确实是唯一可以管理此操作的 API。

今天,我认为您想要执行此操作的方法是为每个句子创建突出显示注释。然后创建一个小部件注释,它具有一系列 JavaScript 操作,这些操作可以更改句子的不透明度,然后触发播放声音注释。

伪代码中类似的东西

foreach sentenceAnnot,sentenceSoundAnnot do
    set sentenceAnnot.opacity to 1
    play sentenceSoundAnnot
    set sentenceAnnot.opacity to 0

现在这将是一个很糟糕的过程 - 为注释操作编写任何类型的脚本都很糟糕,因为编辑器和调试器都是残酷的笑话。首先获取 acrobat javascript api 参考的副本。没有它你就会死。

然后你必须弄清楚如何创作你想要的动作。下面是一个脚本,我将其放入链接上的操作中,以将第 0 页上所有突出显示的不透明度更改为一半:

var annots = this.getAnnots({nPage:0});

for (var i =0; i < annots.length; i++) {
   if (annots[i].type = "Highlight")

   annots[i].opacity = 0.5;
}

可以轻松修改此脚本以在页面上查找特定注释。您应该能够通过 getAnnot 方法按名称找到它们,但我没有看到任何内容表明如何在 Acrobat UI 中设置注释的名称属性 - 祝您创作顺利。您可能必须通过将突出显示主题设置为您可以识别的内容来获得。您还可以将声音放在页面上,然后播放它们。

Tricky problem.
A few years ago, I'd say that the only way to do this is with a plug-in to Acrobat as that was really the only API that could manage this.

Today, I think the way you want to do this is to create highlight annotations for each sentence. Then create a widget annot that has a series of javascript actions that change the opacity of the sentences then trigger a sound annot to play.

Something like this in pseudo-code

foreach sentenceAnnot,sentenceSoundAnnot do
    set sentenceAnnot.opacity to 1
    play sentenceSoundAnnot
    set sentenceAnnot.opacity to 0

Now this is going to stink as a process - writing any kind of scripts for annotation actions stinks since the editor and debugger are cruel jokes. Start by getting a copy of the acrobat javascript api reference. You'll be dead without it.

Then you have to figure out how to author the action that you want. Here is a script that I put into an action on a link to change the opacity of all highlights on page 0 to half:

var annots = this.getAnnots({nPage:0});

for (var i =0; i < annots.length; i++) {
   if (annots[i].type = "Highlight")

   annots[i].opacity = 0.5;
}

This can be easily modified to find a specific annotation on the page. You're supposed to be able to find them by name via the getAnnot method, but I saw nothing that would indicate how to set the name property of an annot in the Acrobat UI - so good luck authoring that. You'll probably have to get by setting the highlight subject to something identifiable that you can then get. You would also put sounds on the page and then play those.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文