[gcompris-devel] gnumch localisable "yummy yummy" - filepath

Bruno Coudoin bruno.coudoin at gcompris.net
Mon May 13 18:18:15 UTC 2013


Le 13. 05. 13 14:24, Fòram na Gàidhlig a écrit :
> My question: How to I find out the gcompris install directory in a
> Python module? I expect that something has already been programmed for
> this, but I just can't find it.
>
> I am working on:
>
> / src / gnumch-equality-activity / gnumch.py
>
> And I want to make eat.wav localisable.
>
> I could simply call:
>
> gcompris.sound.play_ogg("voices/$LOCALE/misc/eat.ogg")
>
> However, if the file is not there, it won't play anything. So, I need to
> check if the file is there in order to play the default sound instead if
> it's not.
>
> This can be done with os.path.isfile(), but I need to specify the full
> absolute path for this.
>

Hi,

In this case I suggest to move the file eat.wav from boards/sounds/ to 
boards/voices/en/misc

Keep the file as wav because it is better for sound effects. ogg file 
are slower to start.

Bruno.





More information about the Gcompris-devel mailing list