Skip to content

Commit

Permalink
Store recognition listeners in a set.
Browse files Browse the repository at this point in the history
Use set rather than array to avoid duplicates.

git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/pocketsphinx-android@12389 94700074-3cef-4d97-a70e-9c8c206c02f5
  • Loading branch information
mbait committed Mar 25, 2014
1 parent eae1c0f commit 505fc49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edu/cmu/pocketsphinx/SpeechRecognizer.java
Expand Up @@ -2,7 +2,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.HashSet;

import android.media.AudioFormat;
import android.media.AudioRecord;
Expand Down Expand Up @@ -35,7 +35,7 @@ public class SpeechRecognizer {

private final Handler mainLoopHandler = new Handler(Looper.getMainLooper());
private Collection<RecognitionListener> listeners =
new ArrayList<RecognitionListener>();
new HashSet<RecognitionListener>();

private final short[] buffer = new short[1024];
private boolean vadState = false;
Expand Down

0 comments on commit 505fc49

Please sign in to comment.