anki.sound
==========

.. py:module:: anki.sound

.. autoapi-nested-parse::

   Sound/TTS references extracted from card text.

   These can be accessed via eg card.question_av_tags()



Attributes
----------

.. autoapisummary::

   anki.sound.AVTag
   anki.sound.AV_REF_RE


Classes
-------

.. autoapisummary::

   anki.sound.TTSTag
   anki.sound.SoundOrVideoTag


Functions
---------

.. autoapisummary::

   anki.sound.strip_av_refs


Module Contents
---------------

.. py:class:: TTSTag

   Records information about a text to speech tag.

   See tts.py for more information.


   .. py:attribute:: field_text
      :type:  str


   .. py:attribute:: lang
      :type:  str


   .. py:attribute:: voices
      :type:  list[str]


   .. py:attribute:: speed
      :type:  float


   .. py:attribute:: other_args
      :type:  list[str]


.. py:class:: SoundOrVideoTag

   Contains the filename inside a [sound:...] tag.

   Video files also use [sound:...].

   SECURITY: We should only ever construct this with basename(filename),
   as passing arbitrary paths to mpv from a shared deck is a security issue.

   Anki add-ons can supply an absolute file path to play any file on disk
   using the built-in media player.


   .. py:attribute:: filename
      :type:  str


   .. py:method:: path(media_folder: str) -> str

      Prepend the media folder to the filename.



.. py:data:: AVTag

.. py:data:: AV_REF_RE

.. py:function:: strip_av_refs(text: str) -> str

