Changeset 2072847
- Timestamp:
- 04/23/2019 03:24:16 AM (7 years ago)
- Location:
- amazon-polly/trunk
- Files:
-
- 6 edited
-
README.md (modified) (2 diffs)
-
README.txt (modified) (2 diffs)
-
admin/AmazonAI-Common.php (modified) (2 diffs)
-
admin/AmazonAI-PollyService.php (modified) (3 diffs)
-
admin/AmazonAI-TranslateConfiguration.php (modified) (1 diff)
-
amazonpolly.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
amazon-polly/trunk/README.md
r2064724 r2072847 7 7 | Requires PHP | 5.6 | 8 8 | Tested up to | 5.0 | 9 | Stable tag | 3.0. 3|9 | Stable tag | 3.0.4 | 10 10 | License | GPLv3 ONLY | 11 11 | License URI | https://www.gnu.org/licenses/gpl-3.0.html | … … 237 237 #### Changelog 238 238 239 = 3.0.4 = 240 * Added support for Arabic Language 241 * Bug Fixing 242 239 243 = 3.0.3 = 240 244 * Added detailed logging -
amazon-polly/trunk/README.txt
r2064724 r2072847 5 5 Requires PHP: 5.6 6 6 Tested up to: 5.0 7 Stable tag: 3.0. 37 Stable tag: 3.0.4 8 8 License: GPLv3 ONLY 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 232 232 == Changelog == 233 233 234 = 3.0.4 = 235 * Added support for Arabic Language 236 * Bug Fixing 237 234 238 = 3.0.3 = 235 239 * Added detailed logging -
amazon-polly/trunk/admin/AmazonAI-Common.php
r2047075 r2072847 13 13 // Information about languages supported by the Amazon AI plugin 14 14 private $languages = [ 15 ['code' => 'ar', 'name' => 'Arabic', 'transable' => '1', 'polly' => '1'], 15 16 ['code' => 'da', 'name' => 'Danish', 'transable' => '1', 'polly' => '1'], 16 17 ['code' => 'nl', 'name' => 'Dutch', 'transable' => '1', 'polly' => '1'], … … 1006 1007 // Estimating the total price of convertion of all posts. 1007 1008 1008 $total_price = $amazon_polly_price * $count_posts * $post_chars_count_avg;1009 $total_price = 2 * $amazon_polly_price * $count_posts * $post_chars_count_avg; 1009 1010 $message = 'You are about to convert ' . number_format($count_posts, 0, '.', ',') . ' pieces of text-based content, which totals approximately ' . number_format($number_of_characters, 0, '.', ',') . ' characters. Based on the Amazon Polly pricing ($4 dollars per 1 million characters) it will cost you about $' . $total_price . ' to convert all of your content into to speech-based audio. Some or all of your costs might be covered by the Free Tier (conversion of 5 million characters per month for free, for the first 12 months, starting from the first request for speech). Learn more https://aws.amazon.com/polly/'; 1010 1011 return $message; -
amazon-polly/trunk/admin/AmazonAI-PollyService.php
r2064724 r2072847 15 15 const NONCE_NAME = 'amazon-polly-post-nonce'; 16 16 17 17 18 /** 18 19 * Important. Run whenever new post is being created (or updated). The method generates a background task to generate the audio file. … … 63 64 } 64 65 65 $background_task = new AmazonAI_BackgroundTask(); 66 $background_task->trigger(self::GENERATE_POST_AUDIO_TASK, [ $post_id ]); 66 if( ! ( wp_is_post_revision( $post_id) || wp_is_post_autosave( $post_id ) ) ) { 67 $logger->log(sprintf('%s Starting background task process ( id=%s )', __METHOD__, $post_id)); 68 $background_task = new AmazonAI_BackgroundTask(); 69 $background_task->trigger(self::GENERATE_POST_AUDIO_TASK, [ $post_id ]); 70 } 67 71 } 68 72 … … 285 289 286 290 // Preparing locations and names of temporary files which will be used. 291 $random = rand(5, 10); 287 292 $upload_dir = wp_upload_dir()['basedir']; 288 293 $file_prefix = 'amazon_polly_'; 289 294 $file_name = $file_prefix . $post_id . $lang . '.mp3'; 290 $file_temp_full_name = trailingslashit($upload_dir) . 'temp_' . $file_name ;295 $file_temp_full_name = trailingslashit($upload_dir) . 'temp_' . $file_name . $random; 291 296 $dir_final_full_name = trailingslashit($upload_dir); 292 297 if ( get_option('uploads_use_yearmonth_folders') ) { -
amazon-polly/trunk/admin/AmazonAI-TranslateConfiguration.php
r2020984 r2072847 157 157 echo '<td>'; 158 158 $display_values = [ 'Flag', 'Label', 'Flag + Label' ]; 159 160 //For some languages flags are not supported. 161 if ($lanuage == 'ar') { 162 $display_values = [ 'Label' ]; 163 } 159 164 160 165 echo 'Display: <select name="' . $lan_display . '" id="' . $lan_display . '" >'; -
amazon-polly/trunk/amazonpolly.php
r2064724 r2072847 17 17 * Plugin URI: https://wordpress.org/plugins/amazon-polly/ 18 18 * Description: Create audio version of your posts, translate them into other languages and create podcasts! Amazon Polly is a service that turns text into lifelike speech. With dozens of voices across a variety of languages, you can select the ideal voice and build engaging speech-enabled applications that work in many different countries. The Amazon Polly plugin for WordPress is a sample application that shows how WordPress creators can easily add Text-to-Speech capabilities to written content with Amazon Polly. You can generate an audio feed for text-based content and insert it into an embedded player to increase the accessibility of your WordPress site. The sample code also enables you to publish podcasts directly from your site and make them available for listeners in the form of podcasts. In addition, the plugin allows to translate your text from one language to another using Amazon Translate– which is a neural machine translation service that delivers fast, high-quality, and affordable language translation. Amazon Translate allows you to localize content - such as websites and applications - for international users, and to easily translate large volumes of text efficiently. 19 * Version: 3.0. 319 * Version: 3.0.4 20 20 * Author: AWS Labs, WP Engine 21 21 * Author URI: https://aws.amazon.com/
Note: See TracChangeset
for help on using the changeset viewer.