Is there a list of actions for sound.xml?
#1
Question 
Hi guys,

I'm currently playing with sound support in my skin and have found the sound.xml file in the skins /sound directory that allows the playing of a sound file based on a navigation action. Trouble is I can't find the list of allowable actions to assign the sound files to, does anyone know where I can find this list?

Also the sound.xml file allows the playing of a sound based on the display of a window, does anyone know if you can use a custom skin window as a target for the playing of a sound. If so, how would you I go about defining the window in the <name> tag of the windows section of this file (I'm assuming you would use something like <name>foobar.xml</name>)

The point of these questions is that I currently have a 'bump' sound playing when I hit either end of my home menu list (using PlayMedia(special://skin/sounds/bump.wav) ), but there are a number of minor issues that I need to code around that I think would drop away if I could make use of the sound.xml file instead.

Does anyone have any ideas on this, or where I would need to look in the XBMC codebase to find the answers I'm after?

Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#2
(2014-07-23, 16:13)wyrm Wrote: Also the sound.xml file allows the playing of a sound based on the display of a window, does anyone know if you can use a custom skin window as a target for the playing of a sound. If so, how would you I go about defining the window in the <name> tag of the windows section of this file (I'm assuming you would use something like <name>foobar.xml</name>)
Ok, I have been playing with this to see what I can find, it would seem that ONLY standard window names can be used in the windows section. That is <name>foobar.xml</name> comes back with an error in the log that reads

PHP Code:
ERRORWindow TranslatorCan't find window foobar 

I have tried just about every valid way I could think of to name the custom window name without success, so I guess this is not possible.

Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#3
Hello wyrm,

When using windows in the sounds.xml you can use any window by using the window ID.
So for example in my skin I use:
PHP Code:
<windows>
    <
window>
      <
name>0</name>
      <
activate>Home.wav</activate>
    </
window>
  </
windows
This will play the Home.wav when the Home window is opened. (The home ID=0) I have used this with many custom Windows and have had no problems.

Also how did you get the bump sound playing at the end of your list ? I have done loads of testing with the sounds.xml and couldn't get it working. Only solution that i could find is to use something like:
PHP Code:
<onfocus>Playmedia(SoundGoesHere)</onfocus
But this creates lots of problems like stuttering, stopping media playing etc.
Reply
#4
(2014-07-26, 18:02)toyota12303 Wrote: Hello wyrm,

When using windows in the sounds.xml you can use any window by using the window ID.
So for example in my skin I use:
PHP Code:
<windows>
    <
window>
      <
name>0</name>
      <
activate>Home.wav</activate>
    </
window>
  </
windows
This will play the Home.wav when the Home window is opened. (The home ID=0) I have used this with many custom Windows and have had no problems.
Ah, interesting, did not try using id's. Will give that a go and see if it helps.

Quote:Also how did you get the bump sound playing at the end of your list ? I have done loads of testing with the sounds.xml and couldn't get it working. Only solution that i could find is to use something like:
PHP Code:
<onfocus>Playmedia(SoundGoesHere)</onfocus
But this creates lots of problems like stuttering, stopping media playing etc.
Yep, that is exactly what I have done and yes with the same problems. What I was trying to do was use a ActiveWindow to get the sound handled by sounds.xml and hopefully get around some of the problems you mentioned. Will continue to play with this and report back if I manage to get things working.

Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#5
Quote:
Quote:Also how did you get the bump sound playing at the end of your list ? I have done loads of testing with the sounds.xml and couldn't get it working. Only solution that i could find is to use something like:
PHP Code:
<onfocus>Playmedia(SoundGoesHere)</onfocus
But this creates lots of problems like stuttering, stopping media playing etc.
Yep, that is exactly what I have done and yes with the same problems. What I was trying to do was use a ActiveWindow to get the sound handled by sounds.xml and hopefully get around some of the problems you mentioned. Will continue to play with this and report back if I manage to get things working.

Wyrm (xTV-SAF)
toyota12303,

Pretty sure I now have this working. What I did was to have the menu list move focus to a hidden button
PHP Code:
        <control type="button" id="9005"><!-- Play sound if too far left in menu -->
            <
left>-30</left>
            <
top>-30</top>
            <
width>1</width>
            <
height>1</height>
            <
onfocus>SetFocus(9120)</onfocus>
            <
onfocus>ActivateWindow(1157)</onfocus>
        </
control

Then set the focus back to the item user tried to move past and then call a dummy dialog which caused the sounds.xml file to play a sound file. The Dummy dialog looks like this
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog" id="1157">
    <!-- Dummy dialog to get system to play navigation sound when user trys    -->
    <!-- to move beyond the edge of the home menu screen                    -->
    <defaultcontrol always="true">999</defaultcontrol>
    <controls>
        <control type="button" id="999"><!-- Dummy hidden button to close dialog -->
            <left>-10</left>
            <top>-10</top>
            <width>1</width>
            <height>1</height>
            <onfocus>Dialog.Close(1157)</onfocus>
        </control>
    </controls>
</window> 
As you can see the first and only thing the dialog does is to close the dialog.

Will have to test things further to make sure there are no issues (have not seen any as yet) and find a suitable bump type sound file.

Thanks for the heads up on the correct way to access a custom window in the sounds.xml file.

Wyrm (xTV-SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply

Logout Mark Read Team Forum Stats Members Help
Is there a list of actions for sound.xml?0