Page 1 of 1

Sound dirs and Portable version

PostPosted: Mon Dec 24, 2012 9:52 pm
by chulai
Anybody (ikm?) knows why Sound dirs are not available in portable version of GoldenDict? Was the reason lack of times back then?
I'm sure this is not a bug but an expected behavior but I don't know the reason behind this decision.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 12:18 am
by chulai
Anyone? I like portable version very much but I'm missing sound dirs feature. Is there any good reason for this to not be available in portable GoldenDict?

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 9:30 am
by Tvangeste
chulai wrote:Anyone? I like portable version very much but I'm missing sound dirs feature. Is there any good reason for this to not be available in portable GoldenDict?

I think the main reason was that it required some additional code that wasn't ready. If you just re-enable the sound dirs feature, it would allow users to provide directories outside of the portable directory, hence making GD nonportable in general sense. And it wasn't possible to specify some predefined and fixed directory (like 'content') since sound dirs by definition are not traversing subdirectories.

I think it is doable to add a little bit of code that looks into, say 'soundDirs' directory, finds all top-level directories there and creates sounddir-dictionaries for all of them.

But, there is better way to use your sound files. Just zip them up into *.zips archive, and put the resulting file into "content" directory. GD now unedrstands such zipped sound files. And it is much more efficient to store all sounds inside a zip file, not just inside a directory. This is especially true for huge sound libraries.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 1:52 pm
by chulai
Good to know that we have the option to zip the files.
Anyhow, I would like to see the same level of features in both portable and non-portable versions. If not it looks like the portable version is crippled in a way.
Shouldn't portable version automatically looks sound dirs inside 'content' folder? Or maybe a harcoded 'content/sounds' path. No need to traverse additional subdirectories with that setup.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 3:32 pm
by Tvangeste
chulai wrote:Anyhow, I would like to see the same level of features in both portable and non-portable versions. If not it looks like the portable version is crippled in a way.

Agreed. Somebody just needs to write that code. :)

chulai wrote:Shouldn't portable version automatically looks sound dirs inside 'content' folder? Or maybe a harcoded 'content/sounds' path. No need to traverse additional subdirectories with that setup.

With that setup you'll end up only with a single sounddir-based dictionary (the one that resides in content/sounds). If users have more than one such dictionary, you'd have to somehow scan for them.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 3:36 pm
by Tvangeste
Just in case, I've filed an Issue #150 to track this.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 4:32 pm
by chulai
Tvangeste wrote:
chulai wrote:Anyhow, I would like to see the same level of features in both portable and non-portable versions. If not it looks like the portable version is crippled in a way.

Agreed. Somebody just needs to write that code. :)

chulai wrote:Shouldn't portable version automatically looks sound dirs inside 'content' folder? Or maybe a harcoded 'content/sounds' path. No need to traverse additional subdirectories with that setup.

With that setup you'll end up only with a single sounddir-based dictionary (the one that resides in content/sounds). If users have more than one such dictionary, you'd have to somehow scan for them.


The way I see it we wouldn't end up with just one single directory:
Suppose we have "content/sounds/AmericanEnglish" and "content/sounds/BritishEnglish". GoldenDict portable should scan "content/sounds" and create automatically 2 entries in "Dictionaries > Sources > Sound Dirs": "AmericanEnglish" and "BritishEnglish".
Inside "content/sounds/AmericanEnglish" and "content/sounds/BritishEnglish" the sound files must not be inside additional sub-folders. I think you mentioned this is a requirement because GoldenDict is not traversing subdirectories to find sound files.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 5:15 pm
by chulai
Tvangeste wrote:I think it is doable to add a little bit of code that looks into, say 'soundDirs' directory, finds all top-level directories there and creates sounddir-dictionaries for all of them.


I just realized you describe the same solution as mine.

Re: Sound dirs and Portable version

PostPosted: Wed Jan 02, 2013 5:56 pm
by Tvangeste
chulai wrote:I just realized you describe the same solution as mine.

Exactly! :)