=== Speakable ===
Contributors: themeshape, shagors
Tags: text-to-speech, tts, accessibility, audio, speech
Requires at least: 6.0
Tested up to: 6.9
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a text-to-speech player to your posts and pages using the browser's built-in Web Speech API. Free, no API keys required.

== Description ==

Speakable adds a play button to your articles that reads the content aloud using the browser's built-in speech synthesis engine. No external API keys, no usage costs, no third-party services.

**Features:**

* Play / Pause / Stop controls
* Adjustable playback speed (0.75x - 2x)
* Progress bar with sentence counter
* Voice, pitch, volume, and speed settings from the admin dashboard
* Enable/disable per post type (Posts, Pages, Products, etc.)
* Customizable button color with live preview
* Gutenberg block — place the player anywhere in your content
* Sticky mini-player that follows users while scrolling
* Mobile-optimized with large touch targets
* Accessible: ARIA labels, roles, keyboard navigation, and live regions
* Zero external dependencies — no third-party scripts, fonts, or services

**Gutenberg Block:**

Search for "Speakable Player" in the block inserter to place the player at any position in your content. The block automatically disables global auto-insertion for that post to prevent duplicates.

**How It Works:**

1. The plugin filters post content to inject a player bar (or use the Gutenberg block)
2. JavaScript extracts article text and splits it into sentences
3. Each sentence is spoken using the Web Speech API
4. Sentence-by-sentence playback avoids Chrome's known timeout bug

== Installation ==

1. Upload the `speakable` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Speakable > Settings to configure voice and display options
4. Visit any single post to see the player

== Frequently Asked Questions ==

= Does this plugin require an API key? =

No. It uses the browser's built-in Web Speech API which is completely free.

= Which browsers are supported? =

Chrome 33+, Safari 7+, Firefox 49+, Edge 14+, and most modern mobile browsers.

= Can I place the player anywhere I want? =

Yes. Use the "Speakable Player" Gutenberg block to place the player at any position within your content. When the block is used, global auto-insertion is automatically skipped for that post.

= Why do voices sound different on different devices? =

Voices are provided by the operating system, not the plugin. Available voices vary by OS (macOS uses Siri voices, Windows uses Microsoft voices, Android uses Google TTS, etc.).

= Can I choose which post types show the player? =

Yes. Go to Speakable > Settings > Display tab and select which post types should show the player.

= Does the player appear on archive pages? =

No. The player only appears on single post/page views, never on archives, search results, or the homepage.

= Will this slow down my site? =

No. The plugin only loads its small CSS and JS files on singular pages where TTS is enabled. On all other pages the frontend class is not even loaded. No external scripts, fonts, or services are used.

== Source Code and Development ==

This plugin is fully GPL. The maintained development location is:

https://github.com/devshagor/speakable

The human-readable source for every shipped file is also bundled inside the plugin itself:

* Block editor source: `src/blocks/speakable-player/index.js` and `src/blocks/speakable-player/editor.css`
* Block render template (server-side): `src/blocks/speakable-player/render.php`
* Block metadata: `src/blocks/speakable-player/block.json`
* All PHP classes are unminified and live under `includes/`
* All admin/frontend CSS and JS are unminified and live under `assets/`

The contents of `build/blocks/speakable-player/` are produced from `src/blocks/speakable-player/` using `@wordpress/scripts`.

To regenerate the build output:

`npm install`
`npm run build`

This runs `wp-scripts build --webpack-src-dir=src/blocks --output-path=build/blocks`. The `npm run start` command provides a development watch mode.

== Screenshots ==

1. The player bar on a published article, ready to read the post aloud
2. Active playback with progress bar and sentence counter
3. Voice settings — choose voice and adjust speed, pitch, and volume
4. Display settings — post types, button color, and player position
5. Live preview — test the current voice settings before saving
6. Analytics overview — TTS-enabled posts and player feature status

== Changelog ==

= 1.0.1 =
* Fix: player no longer reads related-post titles or meta — content extraction is now scoped to the player's own article container.
* Improvement: the post title is now read before the article body.
* Docs: added a Source Code and Development section to the readme pointing to the public GitHub repository.

= 1.0.0 =
* Initial release
* Browser-based TTS using Web Speech API
* Admin settings dashboard under Speakable menu
* Voice, speed, pitch, and volume controls
* Enable/disable per post type
* Customizable button color and position (before/after content)
* Progress bar and speed control toggles
* Sticky mini-player during playback
* Gutenberg block for manual player placement
* Analytics and Help submenu pages
* Mobile-optimized touch interface
* Accessible markup with ARIA attributes and keyboard navigation
* Performance-optimized: frontend assets only loaded where needed

== Upgrade Notice ==

= 1.0.1 =
Fixes the player reading related-post content. Recommended upgrade.

= 1.0.0 =
Initial release.
