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

Marc Schroeder schroed at dfki.de
Mon Sep 14 10:38:54 CEST 2009


Thanks Marc, Paulo,

I have added your comments to the ticket that already documented the 
problem:
http://mary.opendfki.de/ticket/227

We'll try to fix this before releasing the 4.0 beta later this month.

Regards,
Marc

Paulo Levi schrieb:
> 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
>>
> _______________________________________________
> Mary-dev mailing list
> Mary-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/mary-dev

-- 
Dr. Marc Schröder, Senior Researcher at DFKI GmbH
Coordinator EU FP7 Project SEMAINE http://www.semaine-project.eu
Portal Editor http://emotion-research.net
Team Leader DFKI Speech Group http://mary.dfki.de

Homepage: http://www.dfki.de/~schroed
Email: schroed at dfki.de
Phone: +49-681-302-5303
Postal address: DFKI GmbH, Campus D3_2, Stuhlsatzenhausweg 3, D-66123 
Saarbrücken, Germany
--
Official DFKI coordinates:
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
Geschaeftsfuehrung:
Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313


More information about the Mary-dev mailing list