com.getflourish.stt
Class TranscriptionThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.getflourish.stt.TranscriptionThread
All Implemented Interfaces:
java.lang.Runnable

public class TranscriptionThread
extends java.lang.Thread

Each transcription is handled in a separate thread to ensure that the program remains responsive while the thread is waiting for a response from the server.

Author:
Florian Schulz

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 boolean debug
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TranscriptionThread(java.lang.String lang)
           
 
Method Summary
 float getConfidence()
           
 int getStatus()
           
 java.lang.String getUtterance()
           
 boolean isAvailable()
           
 boolean isRunning()
           
 void run()
           
 void startTranscription(java.lang.String _record)
           
 java.lang.String transcribe(java.lang.String _path)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public boolean debug
Constructor Detail

TranscriptionThread

public TranscriptionThread(java.lang.String lang)
Method Detail

startTranscription

public void startTranscription(java.lang.String _record)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isRunning

public boolean isRunning()

transcribe

public java.lang.String transcribe(java.lang.String _path)
Parameters:
_path - location of the audio file encoded as FLAC
Returns:
transcription of the audio file as String

getConfidence

public float getConfidence()

getUtterance

public java.lang.String getUtterance()

getStatus

public int getStatus()

isAvailable

public boolean isAvailable()
Returns:
true if audio processing was successfull