feat: #3634447 Add an Audio generator: speech read from the text with the text to speech provider

Issue: https://www.drupal.org/project/ai_media/issues/3634447

A new audio generator: the text is read aloud by the text to speech provider and saved into a media type with the Audio file source, in a voice the model lists; mp3, wav or aac. Off by default, like Video.

Also in this MR, because the generator needs them: a generator may name its text field (field_title, field_help on the attribute: "Text to speak"); a sound or video result shows a player and its link reads "Open in a new tab"; only an image is asked for alt and title, so other types make one AI call less.

Checked: phpcs, phpstan, the kernel suite (91 tests, 4 new), and a real generation with OpenAI tts-1 on the dev site: a 67 KB MP3 in 15 seconds, played, saved. The e2e scenario runs on Add media with the Echo provider, which speaks too.

Add Audio after a generation: the AI name, the text, the player and the facts line

The Options with Format and Voice shown

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release

🤖 Generated with Claude Code

Edited by Rajab Natshah

Merge request reports

Loading
Loading