[mary-dev] Error: Save the output as a file.

Paulo Levi i30817 at gmail.com
Mon Sep 7 20:30:42 CEST 2009


I'm confused too.

Seems MaryServer prints (sends to client) the available formats
seperated by \n like this (567):
clientOut.println(t.getExtension() + " " + t.toString());

Which then get used in MarySocketClient (557):
        String audioFormatInfo =  getServerInfo("MARY LIST
AUDIOFILEFORMATTYPES");
        data.audioOutTypes = new
Vector<String>(Arrays.asList(StringUtils.toStringArray(audioFormatInfo)));
        data.audioFileFormatTypes = new Vector<String>();
        for (String af : data.audioOutTypes) {
            if (af.endsWith("_FILE")) {
                String typeName = af.substring(0, af.indexOf("_"));
                try {
                    AudioFileFormat.Type type =
MaryAudioUtils.getAudioFileFormatType(typeName);
                    data.audioFileFormatTypes.add(typeName+"
"+type.getExtension());
                } catch (Exception e) {}
            }
        }

Seems like the wrong order and inner separator (in fact i don't think
that the String _FILE and _STREAM get added in MaryServer at all?) in
mary server. I swear i am not guilty even though i refactored mary
server. Speaking of that, the httpserver looks like it needs it too.


MaryHttpServer is like this (from getAudioFileFormatTypes() in
BaseHttpRequestHandler (278)):
        StringBuilder output = new StringBuilder();
        AudioFileFormat.Type[] audioTypes = AudioSystem.getAudioFileTypes();
        for (int t=0; t<audioTypes.length; t++) {
            AudioFileFormat.Type audioType = audioTypes[t];
            String typeName = audioType.toString();
            boolean isSupported = true;
            if (typeName.equals("MP3")) isSupported =
MaryAudioUtils.canCreateMP3();
            else if (typeName.equals("Vorbis")) isSupported =
MaryAudioUtils.canCreateOgg();
            try {
                audioType = MaryAudioUtils.getAudioFileFormatType(typeName);
            } catch (Exception e) {
                isSupported = false;
            }

            if (isSupported && audioType!=null &&
AudioSystem.isFileTypeSupported(audioType))
            {
                output.append(typeName).append("_FILE\n");

                if (typeName.equals("MP3") || typeName.equals("Vorbis"))
                    output.append(typeName).append("_STREAM\n");
            }
        }

Here it is adds the _FILE and _STREAM strings correctly, so maybe
MaryServer is just deprecated.

And the whole MaryHTTPClient method is:
        String audioFormatInfo = serverInfoRequest("audioformats", null);
        data.audioOutTypes = new
Vector<String>(Arrays.asList(StringUtils.toStringArray(audioFormatInfo)));
        data.audioFileFormatTypes = new Vector<String>();
        for (String af : data.audioOutTypes) {
            if (af.endsWith("_FILE")) {
                String typeName = af.substring(0, af.indexOf("_"));
                try {
                    AudioFileFormat.Type type =
MaryAudioUtils.getAudioFileFormatType(typeName);
                    data.audioFileFormatTypes.add(typeName+"
"+type.getExtension());
                } catch (Exception e) {}
            }
        }
So that is the right order and it's probably MaryGUIClient that needs
to change. I'm going to wait for someone that knows what he is doing
to comment / possibly fix things since i'm not confident of things.
BTW is MaryServer deprecated?

Also would it be possible to refactor the protocol into something that
doesn't use a strings? String gymnastics are better left behind IMO.

On Mon, Sep 7, 2009 at 9:20 AM, Marc Freixes
Guerreiro<si09344 at salle.url.edu> wrote:
> Hello,
> my name is Marc Freixes and I'm working in my Telecomunications
> Engineering Final Project, about voice synthesis.
>
> I'm working with the last revision of repositories source (2084), and I
> think that I've found a little bug that avoids the saveOutput operation.
>
> In marytts.client.http MaryHttpClient.java, ln 144 we have:
> data.audioFileFormatTypes.add(typeName+" "+type.getExtension());
>
> In marytts.client MaryGUIClient.java, in lns 115 - 116 we have:
> extensions[i] = knownAudioTypes.get(i).substring(0, iSpace);
> typeNames [i] = knownAudioTypes.get(i).substring(iSpace+1);
>
> We should change the order of typeName and extension in one of the two
> files but I don't know where.
>
> Thank you. Best regards,
>
> Marc.
>
> _______________________________________________
> Mary-dev mailing list
> Mary-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/mary-dev
>


More information about the Mary-dev mailing list