Menu

Use an InputStream for the audio source?

Help
2009-04-09
2012-09-22
  • Clifton C. Craig

    I'm trying to pull audio off of an input stream for a quick prototype. I'm brand new to Sphinx and I'm having trouble finding a good example of how this is done. So far I've modified the wavfile example to begin using StreamDataSource from 1.0-BETA2. However I need help in creating a propertysheet to feed the StreamDataSource. I see the StreamDataSource has defaults but I'd like to modify these settings at runtime. can somebody help?

     
    • Clifton C. Craig

      I got that much already. What I was really asking about was the newPropertySheet method. How do I go about creating one of these things so that I can customize the properties of the input audio at runtime? Does anyone have a good examples?

       
      • Nickolay V. Shmyrev

        > Does anyone have a good examples?

        Did you have a chance to look into sources? Almost everything there is configurable:

        public class EnergyPlotter implements Configurable {

        /** The maximum level of energy for which a plot string will be preconstructed. */
        @S4Integer(defaultValue = 20)
        public static final String PROP_MAX_ENERGY = "maxEnergy";
        
        private int maxEnergy;
        
        public void newProperties(PropertySheet ps) throws PropertyException {
            super.newProperties(ps);
            maxEnergy = ps.getInt(PROP_MAX_ENERGY);
        }
        

        }

        That's all what you need. Javadoc also have more or less precise description:

        http://cmusphinx.sourceforge.net/sphinx4/javadoc/edu/cmu/sphinx/util/props/Configurable.html

         
    • Nickolay V. Shmyrev

      Isn't

      setInputStream(InputStream inputStream, String streamName)

      the method you want? It can be any input stream you like.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.