The ability to place buttons that play audio inline (T229169) has little to do with the ability to generate and store text-to-speech, and benefits not just those who want to install a text-to-speech extension but everyone who wants to have audio on their wiki, which might not be for pronunciation but for music, narration, dialogue, animal communication, or anything that can be heard. Those who want this ability shouldn't have to install an entire extension that's not just about the button but about text-to-speech generation and storage. It should be integrated into TimedMediaHandler or be a separate extension.
Description
Related Objects
Event Timeline
Can you even upload or play audio without TimedMediaHandler? Unless you can, TimedMediaHandler seems like the obvious place.
We used to use TMH to play audio in Score, but I got rid of it in cf8a4f2133cb6a0f9fa4266ed93acea4f0729667 and just used <audio> instead, because TMH was too tightly integrated with file uploads to reliably play a thing that wasn't an uploaded file, and its audio support was very poor.
I see it's an OOUI widget (PhonosButton). Maybe a base class could be factored out of it, and the base class could be in OOUI. Then TMH, Score and Phonos could have their own subclasses.
TMH is a good place to put the UI glue to let you play uploaded audio files, but you wouldn't want Phonos to depend on TMH.
But PhonosInlineAudioPlayerMode is all about playing uploaded files.
We used to use TMH to play audio in Score, but I got rid of it in cf8a4f2133cb6a0f9fa4266ed93acea4f0729667 and just used <audio> instead, because TMH was too tightly integrated with file uploads to reliably play a thing that wasn't an uploaded file, and its audio support was very poor.
You didn't get rid of it completely. TMH still hijacks Score's <audio> if the page has other (uploaded) media (T295514).
Phonos only uses TimedMediaHandler to fetch the MP3 source if available, otherwise falling back to the original MIME type. TMH is not used for audio playback. So I wouldn't say there's a hard dependency between Phonos and TMH, but for InlineAudioPlayer mode specifically, it might as well go in TMH since we're basically mimicking the same logic.
That sounds like a great approach, but wouldn't we then need to make the UI consistent between the three? Maybe that's a good thing, anyway.
This proposal is sound, but a bit untimely as we're in the middle of rolling out PhonosInlineAudioPlayerMode everywhere. We've already informed communities of the functionality, though I'm unsure how widely it has been adopted. I suppose if/when this refactor happens, the file= parameter of Phonos would need to continue to function as it does now.
Migrating the TTS generation/storage out of the Phonos extension is another option. Whatever the solution, the inline player and TTS should be decoupled.
In your opinion @Nardog ... please give space for others to have opinions as well. Your comments are appreciated, but at times come across as if you are running this operation and you are not.