ShareShortcuts

Make Audio of Document Text

blue
Создать форк «Make Audio of Document Text»

Создали что-то новое на основе этой команды? Поделитесь ей как форком: она станет вашей собственной командой, которой вы управляете, а обе страницы будут ссылаться друг на друга, чтобы blue получил(а) признание.

  1. 1Получите команду и измените её в приложении «Быстрые команды». Дайте ей собственное название.
  2. 2Поделись ею из приложения «Быстрые команды» и скопируй ссылку iCloud.
  3. 3Вернись сюда, вставь ссылку и опиши, что изменилось, например: «Добавлен шаг, который использует Apple Intelligence для персонализации текста».
Загрузки
48K
Сохранено
2
Действия
10
Категория
Utilities
Версия
1.0
Язык
EN

Make Audio from Document Text Creates an audio file of text identified in a document read aloud by Siri (Text to Speech.) • RoutineHub Page • iCloud Share Link  Siri TTS About Note: this shortcut requires iOS 15 Developer or Public Beta 6 This shortcut utilizes 4 new Actions coming with iOS 15. The first - “Extract Text From Image” - is used to transcribe the text present in a given file/document via OCR. According to the Action’s description, it is capable of reading text from the following input types: Evernote notes, App Store apps, Bar codes, Images, Podcasts, Rich text, iTunes products, Giphy items, Podcast episodes, PDFs, iTunes media, Media, Contacts, Photo media, Shazam media, Locations, iTunes artists This shortcut is primarily configured for PDF input, but obviously, your particular needs should be customized for. Because the output of Extract Text From Image is a list of single lines, this shortcut uses Combine Text to convert them to single spaces, the result of which is particularly suited for Siri to read. The plain text result is then passed to “Make Audio From Text” (the second) action arriving in iOS 15 (which has finally been fixed as of Developer Beta 6) to generate an .m4a audio file of Siri Voice 2 (by default) reading the document’s text aloud (rather than just speaking it aloud on your handset/iPad, as the original does.) The 3rd and 4th new actions are used to capture and crop a 1000 x 1000 thumbnail image of the inputted document for use as the output file’s cover art. After the raw audio has been synthesized, it is passed to an Encode Media action, which converts it to an .m4a file with metadata (that I highly encourage you customize.) By default, the shortcut is configured to save the .m4a file to iCloud Drive in /audio/TTS/ as [the original file’s name].m4a. A full explanation/detailed guide can be found on my blog, and the full text of the latter portion (in first draft form) has been posted beneath the contact details in the description of a sister shortcut. Contact • Contact Card • Email • Twitter • Mastodon • Discord • Everywhere…

Что нового

Версия 1.0

First release

История версий
1.0 30 авг 2021 г.

First release

Что делает

Действий: 10
  1. Comment
    ## About **Note: this shortcut requires iOS 15 Developer or Public Beta 6** This shortcut utilizes 4 new Actions coming with iOS 15. The first - “**Extract Text From Image**” - is used to transcribe the text present in a given file/document via OCR.…
  2. Select File
  3. Get Details of Files
  4. Make Image from PDF Page
  5. Crop Image
  6. Extract Text from Image
  7. Combine Text
  8. Make Spoken Audio
  9. Encode Media
  10. Save File

Посмотреть как код
Бета

Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.

#include 'actions/text'
#include 'actions/pdf'
#include 'actions/documents'
#define color green
#define glyph newsArticle

/*
## About

**Note: this shortcut requires iOS 15 Developer or Public Beta 6**

This shortcut utilizes 4 new Actions coming with iOS 15. The first - “**Extract Text From Image**” - is used to transcribe the text present in a given file/document via OCR. 

According to the Action’s description, it is capable of reading text from the following input types:

> Evernote notes, App Store apps, Bar codes, Images, Podcasts, Rich text, iTunes products, Giphy items, Podcast episodes, PDFs, iTunes media, Media, Contacts, Photo media, Shazam media, Locations, iTunes artists

This shortcut is primarily configured for PDF input, but obviously, your particular needs should be customized for.

Because the output of `Extract Text From Image` is a list of single lines, this shortcut uses `Combine Text` to convert them to single spaces, the result of which is particularly suited for Siri to read.

The plain text result is then passed to “Make Audio From Text”  (the second) action arriving in iOS 15 (which has finally been fixed as of Developer Beta 6) to generate an .m4a audio file of Siri Voice 2 (by default) reading the document’s text aloud (rather than just speaking it aloud on your handset/iPad, as the original does.)

The 3rd and 4th new actions are used to capture and crop a 1000 x 1000 thumbnail image of the inputted document for use as the output file’s cover art.

After the raw audio has been synthesized, it is passed to an `Encode Media` action, which converts it to an .m4a file with metadata (that I highly encourage you customize.)

By default, the shortcut is configured to save the .m4a file to iCloud Drive in /audio/TTS/ as [the original file’s name].m4a.

A full explanation/detailed guide can be found [**on my blog**](https://bilge.world/siri-tts), and the full text of the latter portion (in first draft form) has been posted beneath the contact details in [the description of a sister shortcut](https://routinehub.co/shortcut/9953).

***

## Contact

* [Contact Card](https://bit.ly/whoisdavidblue)
* [Email](mailto:[email protected]) 
* [Twitter](https://twitter.com/NeoYokel)
* [Mastodon](https://mastodon.social/@DavidBlue)
* [Discord](https://discord.gg/0b9KQUKP858b0iZF)
* [*Everywhere*](https://www.notion.so/rotund/9fdc8e9610b34b8f991ebc148b760055?v=c170b58650c04fbdb7adc551a73d16a7)...
*/
const File = selectFile()
getFileDetail(nil, "Name")
const Image = makeImageFromPDFPage(File, "RGB", "300")
const CroppedImage = cropImage(Image, "1000", "1000")
const TextFromImage = extractImageText(File)
joinText(TextFromImage, " ")
const SpokenAudio = makeSpokenAudio()
const EncodedMedia = setMetadata(SpokenAudio, CroppedImage, "Siri Voice 2", "", "TTS", "2021")
saveFile("{}TTS.m4a", EncodedMedia)
Открыть в Cherri Playground Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.

Оценки и отзывы

Написать отзыв
–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Пока нет отзывов. Поделись мнением первым!

Реклама

Ещё от blue

См. все

Вам также может понравиться

См. все
Реклама