Sounds.xml: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
(Fix dead-end page and update content for Matrix)
 
Line 1: Line 1:
'''As of Kodi 15.0 Isengard this file is part of a ui sounds addon and contains the mapping of actions to sounds'''
'''As of Kodi v15 [[Archive:Isengard|Isengard]], this file is part of a class of [[UI sounds add-ons]] and contains the mapping of actions to sounds.'''


The <actions> section contains global mapping
{{Note|Only .wav files are supported.}}


To map an action to a sound, add a block like this to <actions>:
== Global events ==
The <code><actions></code> tags enclose a section containing the global mapping of events to sounds.
 
To map an action to a sound, add a block like this between the <code><actions></code> tags,
<syntaxhighlight lang="xml">
<action>
  <name>left</name>
  <file>cursor.wav</file>
</action>
</syntaxhighlight>
where <code><name></code> specifies the action to map a sound to and <code><file></code> the .wav file to play when the action occurs.
 
Valid values for the <code><name></code> tag can be found on the [[Action IDs]] page.
 
== Window-specific events ==
{{Note|Custom skin files may be used, in which case window ids should be employed.}}
 
Window-specific event sound triggers can also be defined. To map a sound to a window, add a block like this betweens the <code><windows></code> tags,
<syntaxhighlight lang="xml">
<window>
  <name>infodialog</name>
  <activate>notify.wav</activate>
  <deactivate>out.wav</deactivate>
</window>
</syntaxhighlight>
where <code><name></code> specifies the window to map a sound to and <code><activate></code> and <code><deactivate></code> are the events relating to that window which sounds are to be mapped to.
 
Valid values for these <code><name></code> tags can be found on the [[Window IDs]] page.
 
== Defaults ==
{{Note|The current contents of this file are always accessible on [https://github.com/xbmc/xbmc/blob/master/addons/resource.uisounds.kodi/resources/sounds.xml GitHub]}}
 
The default event sounds are packaged in the [[Official add-on repository]] as the [[Add-ons|add-on]] named <code>resource.uisounds.kodi</code>. As of Kodi v19 [[Matrix]], the contents of its <code>sounds.xml</code> file are:
<syntaxhighlight lang="xml">
<sounds>
  <actions>
     <action>
     <action>
       <name>left</name>
       <name>left</name>
       <file>cursor.wav</file>
       <file>cursor.wav</file>
     </action>
     </action>
Where <name> specifies the action to map a sound to and <file> the wav
    <action>
file to play when the action occurs.
      <name>right</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>up</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>down</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>select</name>
      <file>click.wav</file>
    </action>
    <action>
      <name>parentdir</name>
      <file>back.wav</file>
    </action>
    <action>
      <name>previousmenu</name>
      <file>back.wav</file>
    </action>
    <action>
      <name>screenshot</name>
      <file>shutter.wav</file>
    </action>
    <action>
      <name>error</name>
      <file>notify.wav</file>
    </action>
  </actions>


Valid entries for <name> can be found at
  <windows>
http://kodi.wiki/index.php?title=Action_IDs
 
Also window specific sound can be played
 
To map a sound to a window, add a block like this to <windows>:
     <window>
     <window>
       <name>infodialog</name>
       <name>notification</name>
       <activate>notify.wav</activate>
       <activate>notify.wav</activate>
       <deactivate>out.wav</deactivate>
       <deactivate>out.wav</deactivate>
     </window>
     </window>
Where <name> specifies the window to map a sound to
    <window>
<activate> and <deactivate> are the events a sound can be mapped to
      <name>startup</name>
by setting the file to play.
      <activate></activate>
 
    </window>
Valid entries for <name> can be found at
  </windows>
http://kodi.wiki/index.php?title=Window_IDs
</sounds>
 
</syntaxhighlight>
Note: Custom skin files may be used, use windows id in this case
 
Note: Only wav files are supported.
 
 
An example of a sounds addon can be found here: https://github.com/xbmc/xbmc/tree/master/addons/resource.uisounds.kodi




[[Category:Skin_development]]
[[Category:Skin development]]

Latest revision as of 02:07, 23 September 2021

As of Kodi v15 Isengard, this file is part of a class of UI sounds add-ons and contains the mapping of actions to sounds.

Note: Only .wav files are supported.

Global events

The <actions> tags enclose a section containing the global mapping of events to sounds.

To map an action to a sound, add a block like this between the <actions> tags,

<action>
  <name>left</name>
  <file>cursor.wav</file>
</action>

where <name> specifies the action to map a sound to and <file> the .wav file to play when the action occurs.

Valid values for the <name> tag can be found on the Action IDs page.

Window-specific events

Note: Custom skin files may be used, in which case window ids should be employed.

Window-specific event sound triggers can also be defined. To map a sound to a window, add a block like this betweens the <windows> tags,

<window>
  <name>infodialog</name>
  <activate>notify.wav</activate>
  <deactivate>out.wav</deactivate>
</window>

where <name> specifies the window to map a sound to and <activate> and <deactivate> are the events relating to that window which sounds are to be mapped to.

Valid values for these <name> tags can be found on the Window IDs page.

Defaults

Note: The current contents of this file are always accessible on GitHub

The default event sounds are packaged in the Official add-on repository as the add-on named resource.uisounds.kodi. As of Kodi v19 Matrix, the contents of its sounds.xml file are:

<sounds>
  <actions>
    <action>
      <name>left</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>right</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>up</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>down</name>
      <file>cursor.wav</file>
    </action>
    <action>
      <name>select</name>
      <file>click.wav</file>
    </action>
    <action>
      <name>parentdir</name>
      <file>back.wav</file>
    </action>
    <action>
      <name>previousmenu</name>
      <file>back.wav</file>
    </action>
    <action>
      <name>screenshot</name>
      <file>shutter.wav</file>
    </action>
    <action>
      <name>error</name>
      <file>notify.wav</file>
    </action>
  </actions>

  <windows>
    <window>
      <name>notification</name>
      <activate>notify.wav</activate>
      <deactivate>out.wav</deactivate>
    </window>
    <window>
      <name>startup</name>
      <activate></activate>
    </window>
  </windows>
</sounds>