Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Voice Box updates

Re: Voice Box updates

From: Jens Arnold <arnold-j_at_t-online.de>
Date: Tue, 01 Nov 2005 08:55:02 +0100

On 01.11.2005, Brian Wolven wrote:

> extension = LCase(Right(Name,3))

> If ((extension="mp3") or _
> (extension="m3u") or _
> (extension="flac") or _
> (extension="ogg") or _
> (extension="wav") or _
> (extension="m4a") or _
> (extension="mp4") or _
> (extension="cfg")) Then

> isVoiced = true

> End If

That'll never match .flac files, because "extension" will be "lac"
for these ;) On a related note, I think it's better to include
the dot when checking for extension. Furthermore some extensions
are missing, even for the archos.

My suggestion would be as follows:


extpos = InStrRev(Name, ".")

If (extpos > 0 and extpos < Len(Name)) Then

    extension = LCase(Mid(Name, extpos + 1))

    If ((extension = "mp2") or _
        (extension = "mp3") or _
        (extension = "mpa") or _
        (extension = "m3u") or _
        (extension = "cfg") or _

        (extension = "mp1") or _
        (extension = "ogg") or _
        (extension = "mpc") or _
        (extension = "a52") or _
        (extension = "ac3") or _
        (extension = "mp4") or _
        (extension = "wav") or _
        (extension = "flac") or _
        (extension = "m4a") or _
        (extension = "wv")) Then

        isVoiced = true
    End If
End If


Ideally, the script should also be configurable for archos or iriver.
The extensions valid for both cases are clearly separated from
the ones only valid for iriver in my suggestion.


Hth, Jens
Received on 2005-11-01

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy