Голосовой переводчик для mac os

Голосовой переводчик для Mac OS X

В недалёком прошлом лишь в фантастических фильмах можно было видеть «чудо коробочки», в которые говоришь, а в результате слышишь перевод сказанного на другом языке. Но прогресс идёт…

Я очень давно ждал, когда Google откроет API своего сервиса распознавания речи (в своих продуктах компания его использует). Несколько месяцев назад я перевернул «этот ваш ёнтернет», но безрезультатно. И вот на днях я вижу топик на Хабре Используем Google Voice Search в своем приложении .NET! Я был неимоверно счастлив. Топик ссылается на оригинальную статью Accessing Google speech API / Chrome 11. Всё внимательно изучил и «расковырял» исходники Chrome.

Google Speech Recognition API пока неофициальный и стал доступен общественности благодаря браузеру Chrome.

Варианты его использования поистине безграничны. А если объединить это с морфологическими модулями, то может наворотить просто чумовых дел в сфере управления голосом.

Для демонстрации и создания «каркасного движка» (для своих дальнейших нужд) я сделал «Голосовой переводчик» для Mac OS X за пару дней. Это симбиоз технологий Google, Microsoft (произношение) и открытого проекта ffmpeg (конвертация во flac). Это именно голосовой переводчик — никакого набора текста. Просто произносите фразу и слушаете её перевод. Да, качество распознавания может быть не идеальным, но на коротких чётких фразах вполне приемлемо.

Вот видео работы программы:

Как обычно, этот топик я разделю на две части. Одна для обычных пользователей, кто захочет «побаловаться» этой программой. Другая для разработчиков (я предоставлю исходные коды базового проекта).

ДЛЯ ПОЛЬЗОВАТЕЛЕЙ

Загрузить программу можно по ссылке (Mac OS X 10.6+).

Интерфейс программы очень простой. Выбираете нужное языковое направление (в этом демонстрационном проекте я сделал лишь два направления, но сервисы поддерживают намного большее количество языков). Нажимаете кнопку «Записать» и произнесите фразу. Запись автоматически прекратится через 5 секунд или вы можете самостоятельно ее остановить. Всё — слушаем перевод :).



ДЛЯ РАЗРАБОТЧИКОВ

Исходный код на github.

В проекте используется уже собранный бинарный конвертер ffmpeg для конвертации записанного звука во flac. Если вы захотите перенести проект на iOS, то можно использовать статическую библиотеку из проекта libFlac.

Для HUD интерфейс в проекте используется уже собранный BGHUDAppKit framework.

Для обработки JSON используется JSON framework.

Дополнительно (для упрощения) используются некоторые классы из Google Data API.

ЗАПИСЬ ЗВУКА

Звук записывается с помощью стандартной библиотеки QTKit (QuickTime Kit).

Вот код инициализации сессии захвата звуковых данных:

mCaptureSession = [ [ QTCaptureSession alloc ] init ] ;

Читайте также:  Кнопка меню для загрузки windows

QTCaptureDevice * audioDevice = [ QTCaptureDevice defaultInputDeviceWithMediaType : QTMediaTypeSound ] ;

[ mCaptureSession release ] , mCaptureSession = nil ;

[ textLabel setStringValue : NSLocalizedString ( @ «AudioError» , @ «» ) ] ;

[ button setHidden : YES ] ;

[ popUp setHidden : YES ] ;

[ textLabel setHidden : NO ] ;

success = [ audioDevice open : NULL ] ;

[ mCaptureSession release ] , mCaptureSession = nil ;

[ textLabel setStringValue : NSLocalizedString ( @ «AudioError» , @ «» ) ] ;

[ button setHidden : YES ] ;

[ popUp setHidden : YES ] ;

[ textLabel setHidden : NO ] ;

mCaptureAudioDeviceInput = [ [ QTCaptureDeviceInput alloc ] initWithDevice : audioDevice ] ;

success = [ mCaptureSession addInput : mCaptureAudioDeviceInput error : NULL ] ;

[ mCaptureSession release ] , mCaptureSession = nil ;

[ mCaptureAudioDeviceInput release ] , mCaptureAudioDeviceInput = nil ;

[ textLabel setStringValue : NSLocalizedString ( @ «AudioError» , @ «» ) ] ;

[ button setHidden : YES ] ;

[ popUp setHidden : YES ] ;

[ textLabel setHidden : NO ] ;

mCaptureMovieFileOutput = [ [ QTCaptureMovieFileOutput alloc ] init ] ;

success = [ mCaptureSession addOutput : mCaptureMovieFileOutput error : NULL ] ;

[ mCaptureSession release ] , mCaptureSession = nil ;

[ mCaptureAudioDeviceInput release ] , mCaptureAudioDeviceInput = nil ;

[ mCaptureMovieFileOutput release ] , mCaptureMovieFileOutput = nil ;

[ mCaptureMovieFileOutput setDelegate : self ] ;

[ mCaptureMovieFileOutput setCompressionOptions : [ QTCompressionOptions compressionOptionsWithIdentifier : @ «QTCompressionOptionsHighQualityAACAudio» ] forConnection : [ [ mCaptureMovieFileOutput connections ] objectAtIndex : 0 ] ] ;

[ mCaptureMovieFileOutput recordToOutputFileURL : path ] ;

[ mCaptureMovieFileOutput recordToOutputFileURL : nil ] ;

КОНВЕРТАЦИЯ

NSTask * aTask = [ [ NSTask alloc ] init ] ;

NSMutableArray * args = [ NSMutableArray array ] ;

[ args addObject : @ «-i» ] ;

[ args addObject : @ «record.m4a» ] ;

[ args addObject : @ «-acodec» ] ;

[ args addObject : @ «flac» ] ;

[ args addObject : @ «-ac» ] ;

[ args addObject : @ «1» ] ;

[ args addObject : @ «-ar» ] ;

[ args addObject : @ «16000» ] ;

[ args addObject : @ «record.flac» ] ;

[ aTask setCurrentDirectoryPath : recordPath ] ;

[ aTask setLaunchPath : [ [ [ NSBundle mainBundle ] resourcePath ] stringByAppendingPathComponent : @ «ffmpeg» ] ] ;

[ aTask setArguments : args ] ;

ОБЩЕНИЕ С СЕТЕВЫМИ СЕРВИСАМИ

— ( void ) speechRecognition : ( NSString * ) flacPath language : ( NSString * ) language

Далее передаем распознанный текст объекту класса GoogleTranslate. Он переводит текст и сообщает делегату результат перевода или информирует об ошибке. Основной метод:

— ( void ) translate : ( NSString * ) text from : ( NSString * ) inLanguage to : ( NSString * ) outLanguage

Далее в ход вступает объект класса MicrosoftTTS. Он получает аудио данные и передаёт их делегату или информирует об ошибке. Основной метод:

— ( void ) textToSpeech : ( NSString * ) text language : ( NSString * ) language

Не забудьте получить свой Bing AppID у Microsoft (это делается бесплатно) и вставить его в класса MicrosoftTTS, в SpeechURL.

Источник

Хороший переводчик под Mac OS X?

TranslateIt! может переводить не только отдельные слова и словосочетания, но и тексты целиком. Эта функция работает используя Google Translation, поэтому вам необходимо соединение с интернетом.

Я использую Google переводчик: просто открываю сайт, вставляю текст и получаю перевод.

Правда у такого подхода есть один недостаток — когда переключаешься на окно браузера, приходится тратить лишнее действие на выбор окошка, куда текст вставляется. Лечится это легко — открываем js-консоль (⌘⌥C — Safari, ⌘⌥J — Chrome и ⌘⌥K — Firefox) и вставляем код:

Данный код фокусируется на окне ввода каждые 5 секунд — таким образом, можно получить перевод просто переключившись на окно браузера и нажав ⌘V

Источник

iText — OCR & Translator 4+

Recognize text in images

JINGSEN ZHENG

    • 4.4 • 138 Ratings
    • Free
    • Offers In-App Purchases

Screenshots

Description

iText could recognize and translate text from any image.

It’s so easy to take image.

— Use iText’s built-in tool to capture any screen.
— Drag an image to iText’s icon in menu bar.
— Select an image file.
— Auto merge text when continuously recognize.

Читайте также:  Media creation tools обновление windows 10

The recognition result is very accurate.

— Powered by Google online OCR service, support 50+ languages.
— Auto detect paragraphs, optimize layout.
— Could preview the original picture for easy proofing.

Auto translate the recognition result.

— Powered by Google Translate service, support 100+ languages.

Simple and efficient:

— No Dock needed, only exists in the menu bar.
— Support a variety of shortcuts, easy to operate.

You can recognize 20 images for free each month, or subscribe iText Pro to unlimitedly recognize. The subscription will be auto-renew which can be stopped 1 day before the end of the current period.

Learn more: https://en.toolinbox.net/iText/

If you feel that iText saves time for you, welcome to leave a review. Any problem or suggestion, feel free to contact us at iToolinbox@gmail.com

Terms and Conditions: https://en.toolinbox.net/html/terms.html
Privacy Policy: https://en.toolinbox.net/html/privacy.html
* The image will be uploaded to Google’s server to recognize.

What’s New

Performance improvement and bug fixing.

Ratings and Reviews

Works Better Than Google Tranlator

When I try using Google Translate to translate a web page with a link inn it, Google say that the linked page is not valid. But, when I use the iText to translathe same page, it will translate the whole page and the also translates the link on the page also. Works Very Well!! Love it.

Developer Response ,

Glad to know you like iText. Welcome recommend to your friends who also need it, thanks in advance. 🤝

Wonderful ORC Product!

Conclusion: Recognition is good in general but need tiny adjustment. Handwriting recognition should be improved.

To be frank, I’m a loyal user of Mr. Zheng’s product family. And this new product “iText» really amaze me.
To back it firmly, I did some test. From easy to hard are word typed in onenote, image from google image and handwriting in onenote.
It performs English recognition outstandingly. I just tried using it in my onenote notes, with Helvetica Neue as well as times new roman. the result is good but it could be better. quite often the app mis-recognized the case of the word like “Modeling a project” to “MOdeling a project”. Besides, it fails to recognize return symbol “\n” and space symbol.

As for image recognition, that’s perfect, except you have to do some little revise manually. And the “little” is really “little” within human’s scale lol.

However, when it comes to handwriting recognition, the test result is far from satisifying… It even recognized some symbols as Chinese characters, that’s funny. But I still can see its potentiality.

Anyway, it is still a good app, as before, as always.

Developer Response ,

Hi, glad to know you like iText 🙂

To be honest, the recognition work is done by Google. iText mainly work on optimizing the result from Google, e.g., remove extra space, capitalize the first letter, etc. And you’re right, Google’s handwriting ability isn’t that good now.

Читайте также:  Линукс минт какая версия лучше

Super useful

I get a lot of letters in German which I can’t understand, and since they’re images I couldn’t select them. until I found this app 😊 Now it’s as easy as selecting, and I get the text instantly scanned AND translated. Hooray!

The only thing I’d like is for the UI to share the translated text differently (like Google Translate does) so it’s easier to tell them apart.

Developer Response ,

Hi, glad to know iText is helpful for you 😀Get your point for the UI.

Welcome recommend to your friends who also need it, thanks in advance 🤝

App Privacy

The developer, JINGSEN ZHENG , indicated that the app’s privacy practices may include handling of data as described below. For more information, see the developer’s privacy policy.

Data Not Linked to You

The following data may be collected but it is not linked to your identity:

Privacy practices may vary, for example, based on the features you use or your age. Learn More

Information

English, German, Japanese, Simplified Chinese, Spanish, Traditional Chinese

Источник

iTranslate Translator 4+

iTranslate

Screenshots

Description

iTranslate, the most popular translator tool on the App Store, now also on your Mac.

iTranslate for Mac puts 100+ languages at your fingertips. It is designed as a status bar app that is always just one click or keystroke away to help you solve any translation problem.

100+ LANGUAGES
With iTranslate you can translate words, phrases, and text in over 100 languages.

VOICE OUTPUT
Ever wanted to know what an Australian English female sounds like? With iTranslate you can select between lots of different dialects, choose a male or female voice, and even control the speech rate.

DICTIONARIES
Most translator apps give you only 1 result per translation. However, if you are translating words and phrases there are often different meanings, depending on the context. iTranslate gives you dictionaries for many languages so you can find the exact solution to your problem.

ROMANIZATION
Romanization lets you turn «你好» into «Nǐ hǎo», transforming non-Latin languages into Latin characters. Available for many languages including Chinese, Japanese, Korean, Greek, Hindi, Russian, and Thai.

TYPE FASTER
iTranslate is optimized for fast text input. Open the App with a customizable keystroke, get suggestions while you’re typing and quickly switch between languages.

iTranslate is available for a wide range of platforms and devices. Visit our website to learn more about iTranslate: http://www.itranslate.com

Please note: iTranslate requires an Internet connection.

Источник

Оцените статью