Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speaker Identification runs forever #39

Open
themoonraker13 opened this issue Oct 9, 2015 · 6 comments
Open

Speaker Identification runs forever #39

themoonraker13 opened this issue Oct 9, 2015 · 6 comments

Comments

@themoonraker13
Copy link

I've developed a Java program that consumes sphinx to perform speaker-clustering using SpeakerIdentification.
The program/algorithm works fine giving outputs in the same amount of time when I test it with small audio files with similar attributes(time duration, bit-rate, mono/stereo, etc.)

The program run into trouble when I supply it with a large audio file i.e. greater than 1-1.5 hour (wav, 16khz, mono, pcm). The program runs for many hours and sometimes runs forever if the file is excessively large.

I do not know if I'm consuming sphinx the right way. Please guide me solve the problem as it would help me optimize my application's performance to a great extent.

@themoonraker13 themoonraker13 changed the title SpeakerIdentification runs forever Speaker Identification runs forever Oct 9, 2015
@cris7M
Copy link

cris7M commented Mar 22, 2017

hi,
did you success on speaker identification, if you got success can you help me to do that.
I m getting error on and please help how to run it.

File voiceFile = new File("output2.wav");
URL url = voiceFile.toURI().toURL();
ArrayList clusters = sd.cluster(url.openStream());

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.math3.linear.EigenDecomposition.(Lorg/apache/commons/math3/linear/RealMatrix;)at edu.cmu.sphinx.speakerid.SpeakerIdentification.getBICValue(SpeakerIdentification.java:171)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.getPoint(SpeakerIdentification.java:126)
edu.cmu.sphinx.speakerid.SpeakerIdentification.getAllChangingPoints(SpeakerIdentification.java:151)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.cluster(SpeakerIdentification.java:195)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.cluster(SpeakerIdentification.java:185)
at com.example.speaker.SpeakerIdentificationDemo.main(SpeakerIdentificationDemo.java:131)

Thanks in advance

@themoonraker13
Copy link
Author

Seems like you are consuming the SpeakerIdentification implementation of CMU Sphinx in a wrong way.

I had implemented a SpeakerID java class long back which used to accept a audio file name as command-line argument and print speaker identification/clustering information on console. Hope this might help you.

public class SpeakerID {
    public static void main(String args[]) {
        try {
            SpeakerIdentification speakerIdentification = new SpeakerIdentification();
            InputStream fin = new FileInputStream(new File(args[0]));
            ArrayList<SpeakerCluster> clusters = speakerIdentification.cluster(fin);

            int clusterid=1;
            for (SpeakerCluster cluster : clusters) {
                ArrayList<Segment> segments = cluster.getSpeakerIntervals();
                System.out.println("########################");
                System.out.println("Cluster: " + clusterid);
                int segmentid = 1;
                for (Segment s : segments) {
	            long startTime = s.getStartTime();
	            long endTime = s.getStartTime() + s.getLength();
	            System.out.println("---------------");
	            System.out.println("Segment: " + segmentid);
	            System.out.println("Start Time: " + startTime);
	            System.out.println("End Time: " + endTime);
	            System.out.println("---------------");
	            segmentid++;
               }
               clusterid++;
               System.out.println("########################");
            }
        } catch (Exception e) {
	    e.printStackTrace();
        }
    }
}

@cris7M
Copy link

cris7M commented Mar 22, 2017

Thanks for reply but again i am getting the same error.

InputStream fin = new FileInputStream(new File("test.wav"));
ArrayList clusters = speakerIdentification.cluster(fin);

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.math3.linear.EigenDecomposition.(Lorg/apache/commons/math3/linear/RealMatrix;)at edu.cmu.sphinx.speakerid.SpeakerIdentification.getBICValue(SpeakerIdentification.java:171)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.getPoint(SpeakerIdentification.java:126)
edu.cmu.sphinx.speakerid.SpeakerIdentification.getAllChangingPoints(SpeakerIdentification.java:151)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.cluster(SpeakerIdentification.java:195)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.cluster(SpeakerIdentification.java:185)
at com.example.speaker.SpeakerIdentificationDemo.main(SpeakerIdentificationDemo.java:131)

@cris7M
Copy link

cris7M commented Mar 22, 2017

Dear Sir,

Actually i want to make an application in java where if user voice authenticate then it should print welcome else it should say invalid credential, if you have something like this can share with me and that will be great help for me.

Thanks in advance

@themoonraker13
Copy link
Author

themoonraker13 commented Mar 22, 2017

@cris7M please read the following to understand about this type of exception in general:
http://stackoverflow.com/questions/35186/how-do-i-fix-a-nosuchmethoderror
http://stackoverflow.com/questions/5407250/causes-of-java-lang-nosuchmethoderror-main-exception-in-thread-main

Check the Apache Commons Math API used by CMU Sphinx and verify that the method actually exist. If not, try changing the API version.

@sandeep06
Copy link

@themoonraker13 --while running speakerIdentification I am getting the following error..
please help me out.
Exception in thread "main" Property Exception component:'plpFrequencyFilterBank' property:'minimumFrequency' - minimumFrequency is not an annotated sphinx property of 'edu.cmu.sphinx.frontend.frequencywarp.PLPFrequencyFilterBank' !
edu.cmu.sphinx.util.props.InternalConfigurationException: java.lang.ClassCastException: Cannot cast com.sun.proxy.$Proxy1 to edu.cmu.sphinx.util.props.S4Double
at edu.cmu.sphinx.util.props.PropertySheet.getProperty(PropertySheet.java:91)
at edu.cmu.sphinx.util.props.PropertySheet.getDouble(PropertySheet.java:198)
at edu.cmu.sphinx.frontend.frequencywarp.PLPFrequencyFilterBank.newProperties(PLPFrequencyFilterBank.java:82)
at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:163)
at edu.cmu.sphinx.util.props.PropertySheet.getComponentList(PropertySheet.java:372)
at edu.cmu.sphinx.frontend.FrontEnd.newProperties(FrontEnd.java:152)
at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:163)
at edu.cmu.sphinx.speakerid.SpeakerIdentification.(SpeakerIdentification.java:45)
at com.voice.sentimentanalysis.demo.speech.diarizarion.TestSpeakerIdentification.testSpeakerIdentification(TestSpeakerIdentification.java:24)
at com.voice.sentimentanalysis.demo.speech.diarizarion.TestSpeakerIdentification.main(TestSpeakerIdentification.java:17)
Caused by: java.lang.ClassCastException: Cannot cast com.sun.proxy.$Proxy1 to edu.cmu.sphinx.util.props.S4Double
at java.lang.Class.cast(Class.java:3369)
at edu.cmu.sphinx.util.props.PropertySheet.getProperty(PropertySheet.java:89)
... 11 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants