Help:Extension:Phonos/es

La extensión  facilita la incorporación de fragmentos de audio de texto a voz en las páginas de wiki.

Uso
Phonos agrega una etiqueta de analizador que renderizará un icono del altavoz y el texto IPA. Hacer clic en ellos reproducirá el audio apropiado.

La etiqueta del analizador tiene la siguiente estructura; Todos los parámetros son opcionales pero se debe proporcionar al menos uno distinto de :


 * — La notación AFI (no disponible en español) para renderizar la notación de IPA. Algunos motores pueden funcionar mejor con o sin paréntesis alrededor de la cuerda. Si no puedes conseguir que el motor haga el renderizado IPA que desea, puede especificar  y luego usar   (ver abajo) para proporcionar el texto plano de lo que desea hacer.
 * — La representación de texto plano de la cadena, utilizada como un retroceso por algunos motores cuando no pueden renderizar las notas de uso IPA, y también se utilizará como el botón de etiqueta si no se proporciona contenido de.
 * — El código de idioma, utilizado para ayudar al motor a tener una mejor pronunciación y/o para elegir la información correcta de Wikidata. Esto se hace por defecto en el idioma de contenido de la página en la que se utiliza la etiqueta del parser.
 * Si se utiliza en combinación con  esto debe ser igual al valor de  del calificador  para  y/o.
 * — ID del elemento o lexema de Wikidata del que obtener (si no se utiliza  ) y/o  (si no utiliza  ). Al proporcionar un lexema, también debe ser proporcionardo el parámetro   y coincidir exactamente con la representación del lexema.
 * — El nombre del archivo de un archivo de audio de Commons para usar en lugar de cualquier audio generado por el motor o recuperado por Wikidata. Este debe ser el nombre de archivo base sin incluir, por ejemplo.
 * (optional, NOT an attribute, usually empty) — La etiqueta que se mostrará, superando cualquier . Esto puede contener texto wiki.



Notas de uso
Some voice models used by text-to-speech engines do not support every available phoneme — if an unrecognised phoneme is passed in the, engines which support reading the   parameter will do so instead. To ensure only the IPA is rendered, do not pass the  parameter.



Modo de reproductor de audio en línea
Phonos se puede colocar en  por wiki. En este modo, solo se reproducirán archivos de audio suministrados, ya sea especificados con el parámetro, o un elemento referido por un elemento especificado por el parámetro. La representación IPA no está disponible en el modo de reproductor de audio en línea.

Despliegue
Las wikis establecidas pueden ya tener una plantilla que se utiliza para renderizar IPA. En tales casos, puede ser deseable que utilice Phonos para que todo el uso existente de IPA utilice automáticamente Phonos. Una lista de la mayoría de estas plantillas en Wikimedia se puede encontrar en los enlaces de sitios en. Aquí se cubrirán algunos ejemplos básicos sobre cómo cambiar estas plantillas para usar Phonos.

Precautionary notes
Check how many transclusions the template has. If there are a lot (several hundred or more), you may wish to do some testing before editing a live template, such as using TemplateSandbox. If the template has hundreds of thousands or millions of transclusions, extreme caution should be used, with thorough testing before editing the live template. Alternatively, a safer route might be to introduce a new template and have the community slowly start using that, ensuring Phonos acts as it should along the way. Later, the main template can be updated, and the newer one simply redirect to it.

In addition, some wikis have multiple IPA templates that may call each other. Template editors should be cautious to edit these templates in the right order so that calls to Phonos aren't duplicated.

Lastly, if your wiki wishes to customize the tracking categories used by Phonos, do so before updating any templates that would cause a large-scale deployment. The following tracking categories are used by Phonos:

Simple example
Let's consider a typical IPA template, which only applies styling: In this case, we replace the entire template with the Phonos syntax, something like: Note we need to use the   parser function since this is in a template, but it will render the same as: We also added the lang attribute, since that is required for Phonos. We also made it a parameter to the template in case the IPA is something different than the page language.

Taking it a step further, we can expand the template to include any of the other features Phonos provides, such as a custom label, and pulling audio from a file or Wikidata. The template now has the additional parameters label (which is the same as the unnamed 1 parameter), text, wikidata, and file. It's OK if current transclusions don't make use of these options, but now they are there so your community can take advantage of these features Phonos offers.

Complex example
English Wikipedia has several more language-specific versions of IPA templates, such as along with other language variants. These are implemented through a Lua module at Module:IPAc-en. Instructions on how to implement this in Lua is outside the scope of this documentation, but we will still explain what needs to be done on a high-level, as if it were implemented in wikitext like normal templates.

Each argument passed to is an individual diaphoneme. Phonos does not support this natively, so the Lua module must concatenate the diaphonemes into a single string like  and call the parser tag from the Lua module. Additionally, this template links to a IPA help page. It may not be necessary to have this link anymore since Phonos produces actual audio, so you don't need to link to a guide on how to read IPA. However, let's assume we want to keep the link. In such a case we can't utilize the label of the tag, since that is always a link to play the audio. Instead, you'll want to put the link adjacent to the Phonos tag. The resulting wikitext (with all other available Phonos features) would look something like: Notice the double pipes  at the beginning, which is where the label for the  tag normally goes. Here we leave it blank, and put the link to the IPA help page adjacent to the Phonos tag, so you have a playable icon followed by the link.

Inline audio templates
As explained in the last example, it's possible to make Phonos render only a icon that plays the audio when clicked. You don't have to use IPA either, instead you can link to an existing file or Wikidata item (assuming the item has the property). This is useful if you already have human-recorded audio for the word, and there's no need to render it through the Phonos engine.

On English Wikipedia, such a template exists as Template:Audio (see cross-wiki usage at ). However without Phonos, when you click on the play icon the user is brought to a separate page to listen to the audio. Phonos allows you to play the file without leaving the page.

A basic implementation for this would be similar to the following: Similarly there is, which is the same except it is meant to display IPA as well. On English Wikipedia, this ends up using both Template:Audio and Template:IPA. Assuming Template:IPA now supports the file parameter as we implemented in the simple example above, you could simply change the entire Audio-IPA template to use Template:IPA, something like: Some wikis have yet another similar template,. The implementation there would be similar to the one just above where you call the newly changed Template:IPA that accepts a filename.

Styling
Phonos provides its own styling in an effort to keep IPA rendering consistent across all wikis, but you can still override the styling in your template using TemplateStyles if you wish.

Getting help
If you need help deploying Phonos to your wiki's templates, please feel free to reach out to us at meta:Talk:Community Wishlist Survey 2022/Generate Audio for IPA.

JavaScript integration
Phonos provides a front-end hook to mutate the Audio object created by Phonos. This can for example be used to control playblack speed with a gadget or user script, such as with the following: