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: 2005-11-01

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 Tue Nov 1 08:56:32 2005


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa