BowlerKernel
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.neuronrobotics.bowlerstudio.AudioPlayer Class Reference
Inheritance diagram for com.neuronrobotics.bowlerstudio.AudioPlayer:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.bowlerstudio.AudioPlayer:
Collaboration graph
[legend]

Classes

enum  Status
 

Public Member Functions

 AudioPlayer (String tts)
 
 AudioPlayer (File audioFile) throws IOException, UnsupportedAudioFileException
 
 AudioPlayer (AudioInputStream ais)
 
 AudioPlayer (File audioFile, LineListener lineListener) throws IOException, UnsupportedAudioFileException
 
 AudioPlayer (AudioInputStream ais, LineListener lineListener)
 
 AudioPlayer (File audioFile, SourceDataLine line, LineListener lineListener) throws IOException, UnsupportedAudioFileException
 
 AudioPlayer (AudioInputStream ais, SourceDataLine line, LineListener lineListener)
 
 AudioPlayer (File audioFile, SourceDataLine line, LineListener lineListener, int outputMode) throws IOException, UnsupportedAudioFileException
 
 AudioPlayer (AudioInputStream ais, SourceDataLine line, LineListener lineListener, int outputMode)
 
void setAudio (AudioInputStream audio)
 
void cancel ()
 
SourceDataLine getLine ()
 
float getGainValue ()
 
void setGain (float fGain)
 
void run ()
 
void setLine (SourceDataLine line)
 
ISpeakingProgress getSpeakProgress ()
 
void setSpeakProgress (ISpeakingProgress speakProgress)
 

Static Public Member Functions

static double getThreshhold ()
 
static void setThreshhold (double t)
 
static double getLowerThreshhold ()
 
static void setLowerThreshhold (double lt)
 
static int getIntegralDepth ()
 
static void setIntegralDepth (int integralDepth)
 
static double getIntegralGain ()
 
static void setIntegralGain (double integralGain)
 
static double getDerivitiveGain ()
 
static void setDerivitiveGain (double derivitiveGain)
 
static IAudioProcessingLambda getLambda ()
 
static void setLambda (IAudioProcessingLambda lambda)
 

Static Public Attributes

static final int MONO = 0
 
static final int STEREO = 3
 
static final int LEFT_ONLY = 1
 
static final int RIGHT_ONLY = 2
 

Private Member Functions

double[] getIntegralBuffer ()
 

Private Attributes

AudioInputStream ais
 
LineListener lineListener
 
ISpeakingProgress speakProgress
 
SourceDataLine line
 
int outputMode
 
Status status = Status.WAITING
 
boolean exitRequested = false
 
float gain = 1.0f
 
String TTSString
 

Static Private Attributes

static double threshhold = 600 / 65535.0
 
static double lowerThreshhold = 100 / 65535.0
 
static int integralDepth = 30
 
static double integralGain = 1.0
 
static double derivitiveGain = 1.0
 
static IAudioProcessingLambda lambda
 

Detailed Description

A single Thread Audio Player Once used it has to be initialised again

Author
GOXR3PLUS

Definition at line 26 of file AudioPlayer.java.

Constructor & Destructor Documentation

◆ AudioPlayer() [1/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( String  tts)

AudioPlayer which can be used if audio stream is to be set separately, using setAudio().

Definition at line 127 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.TTSString.

◆ AudioPlayer() [2/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( File  audioFile) throws IOException, UnsupportedAudioFileException
Parameters
audioFile
Exceptions
IOException
UnsupportedAudioFileException

Definition at line 136 of file AudioPlayer.java.

◆ AudioPlayer() [3/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( AudioInputStream  ais)
Parameters
ais

Definition at line 143 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.ais.

◆ AudioPlayer() [4/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( File  audioFile,
LineListener  lineListener 
) throws IOException, UnsupportedAudioFileException
Parameters
audioFile
lineListener
Exceptions
IOException
UnsupportedAudioFileException

Definition at line 153 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener.

◆ AudioPlayer() [5/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( AudioInputStream  ais,
LineListener  lineListener 
)

◆ AudioPlayer() [6/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( File  audioFile,
SourceDataLine  line,
LineListener  lineListener 
) throws IOException, UnsupportedAudioFileException
Parameters
audioFile
line
lineListener
Exceptions
IOException
UnsupportedAudioFileException

Definition at line 174 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener, and com.neuronrobotics.bowlerstudio.AudioPlayer.setLine().

Here is the call graph for this function:

◆ AudioPlayer() [7/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( AudioInputStream  ais,
SourceDataLine  line,
LineListener  lineListener 
)
Parameters
ais
line
lineListener

Definition at line 186 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.ais, com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener, and com.neuronrobotics.bowlerstudio.AudioPlayer.setLine().

Here is the call graph for this function:

◆ AudioPlayer() [8/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( File  audioFile,
SourceDataLine  line,
LineListener  lineListener,
int  outputMode 
) throws IOException, UnsupportedAudioFileException
Parameters
audioFileaudiofile
lineline
lineListenerlineListener
outputModeif MONO, force output to be mono; if STEREO, force output to be STEREO; if LEFT_ONLY, play a mono signal over the left channel of a stereo output, or mute the right channel of a stereo signal; if RIGHT_ONLY, do the same with the right output channel.
Exceptions
IOExceptionIOException
UnsupportedAudioFileExceptionUnsupportedAudioFileException

Definition at line 205 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener, com.neuronrobotics.bowlerstudio.AudioPlayer.outputMode, and com.neuronrobotics.bowlerstudio.AudioPlayer.setLine().

Here is the call graph for this function:

◆ AudioPlayer() [9/9]

com.neuronrobotics.bowlerstudio.AudioPlayer.AudioPlayer ( AudioInputStream  ais,
SourceDataLine  line,
LineListener  lineListener,
int  outputMode 
)
Parameters
aisais
lineline
lineListenerlineListener
outputModeif MONO, force output to be mono; if STEREO, force output to be STEREO; if LEFT_ONLY, play a mono signal over the left channel of a stereo output, or mute the right channel of a stereo signal; if RIGHT_ONLY, do the same with the right output channel.

Definition at line 224 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.ais, com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener, com.neuronrobotics.bowlerstudio.AudioPlayer.outputMode, and com.neuronrobotics.bowlerstudio.AudioPlayer.setLine().

Here is the call graph for this function:

Member Function Documentation

◆ cancel()

void com.neuronrobotics.bowlerstudio.AudioPlayer.cancel ( )

◆ getDerivitiveGain()

static double com.neuronrobotics.bowlerstudio.AudioPlayer.getDerivitiveGain ( )
static
Returns
the derivitiveGain

Definition at line 551 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.derivitiveGain.

Referenced by com.neuronrobotics.bowlerstudio.AudioPlayer.run().

◆ getGainValue()

float com.neuronrobotics.bowlerstudio.AudioPlayer.getGainValue ( )

Returns the GainValue

Definition at line 261 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.gain.

Referenced by com.neuronrobotics.bowlerstudio.AudioPlayer.run().

◆ getIntegralBuffer()

double [] com.neuronrobotics.bowlerstudio.AudioPlayer.getIntegralBuffer ( )
private
Returns
the integralBuffer

Definition at line 529 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.getIntegralDepth().

Referenced by com.neuronrobotics.bowlerstudio.AudioPlayer.run().

Here is the call graph for this function:

◆ getIntegralDepth()

static int com.neuronrobotics.bowlerstudio.AudioPlayer.getIntegralDepth ( )
static

◆ getIntegralGain()

static double com.neuronrobotics.bowlerstudio.AudioPlayer.getIntegralGain ( )
static
Returns
the integralGain

Definition at line 537 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.integralGain.

Referenced by com.neuronrobotics.bowlerstudio.AudioPlayer.run().

◆ getLambda()

static IAudioProcessingLambda com.neuronrobotics.bowlerstudio.AudioPlayer.getLambda ( )
static
Returns
the lambda

Definition at line 565 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lambda.

◆ getLine()

SourceDataLine com.neuronrobotics.bowlerstudio.AudioPlayer.getLine ( )

◆ getLowerThreshhold()

static double com.neuronrobotics.bowlerstudio.AudioPlayer.getLowerThreshhold ( )
static
Returns
the lowerThreshhold

Definition at line 500 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lowerThreshhold.

◆ getSpeakProgress()

ISpeakingProgress com.neuronrobotics.bowlerstudio.AudioPlayer.getSpeakProgress ( )
Returns
the speakProgress

Definition at line 471 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.speakProgress.

◆ getThreshhold()

static double com.neuronrobotics.bowlerstudio.AudioPlayer.getThreshhold ( )
static
Returns
the threshhold

Definition at line 485 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.threshhold.

◆ run()

void com.neuronrobotics.bowlerstudio.AudioPlayer.run ( )

◆ setAudio()

void com.neuronrobotics.bowlerstudio.AudioPlayer.setAudio ( AudioInputStream  audio)

◆ setDerivitiveGain()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setDerivitiveGain ( double  derivitiveGain)
static
Parameters
derivitiveGainthe derivitiveGain to set

Definition at line 558 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.derivitiveGain.

◆ setGain()

void com.neuronrobotics.bowlerstudio.AudioPlayer.setGain ( float  fGain)

Sets Gain value. Line should be opened before calling this method. Linear scale 0.0 1.0 Threshold Coef. : 1/2 to avoid saturation.

Parameters
fGain

Definition at line 271 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.gain, and com.neuronrobotics.bowlerstudio.AudioPlayer.getLine().

Referenced by com.neuronrobotics.bowlerstudio.AudioPlayer.run(), com.neuronrobotics.bowlerstudio.CoquiDockerManager.speak(), and com.neuronrobotics.bowlerstudio.TextToSpeech.speak().

Here is the call graph for this function:

◆ setIntegralDepth()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setIntegralDepth ( int  integralDepth)
static
Parameters
integralDepththe integralDepth to set

Definition at line 522 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.integralDepth.

◆ setIntegralGain()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setIntegralGain ( double  integralGain)
static
Parameters
integralGainthe integralGain to set

Definition at line 544 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.integralGain.

◆ setLambda()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setLambda ( IAudioProcessingLambda  lambda)
static
Parameters
lambdathe lambda to set

Definition at line 572 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lambda.

◆ setLine()

void com.neuronrobotics.bowlerstudio.AudioPlayer.setLine ( SourceDataLine  line)

◆ setLowerThreshhold()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setLowerThreshhold ( double  lt)
static
Parameters
lowerThreshholdthe lowerThreshhold to set

Definition at line 507 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.lowerThreshhold.

◆ setSpeakProgress()

void com.neuronrobotics.bowlerstudio.AudioPlayer.setSpeakProgress ( ISpeakingProgress  speakProgress)

◆ setThreshhold()

static void com.neuronrobotics.bowlerstudio.AudioPlayer.setThreshhold ( double  t)
static
Parameters
threshholdthe threshhold to set

Definition at line 492 of file AudioPlayer.java.

References com.neuronrobotics.bowlerstudio.AudioPlayer.threshhold.

Member Data Documentation

◆ ais

AudioInputStream com.neuronrobotics.bowlerstudio.AudioPlayer.ais
private

◆ derivitiveGain

double com.neuronrobotics.bowlerstudio.AudioPlayer.derivitiveGain = 1.0
staticprivate

◆ exitRequested

boolean com.neuronrobotics.bowlerstudio.AudioPlayer.exitRequested = false
private

◆ gain

float com.neuronrobotics.bowlerstudio.AudioPlayer.gain = 1.0f
private

◆ integralDepth

int com.neuronrobotics.bowlerstudio.AudioPlayer.integralDepth = 30
staticprivate

◆ integralGain

double com.neuronrobotics.bowlerstudio.AudioPlayer.integralGain = 1.0
staticprivate

◆ lambda

IAudioProcessingLambda com.neuronrobotics.bowlerstudio.AudioPlayer.lambda
staticprivate

◆ LEFT_ONLY

final int com.neuronrobotics.bowlerstudio.AudioPlayer.LEFT_ONLY = 1
static

Definition at line 30 of file AudioPlayer.java.

◆ line

SourceDataLine com.neuronrobotics.bowlerstudio.AudioPlayer.line
private

◆ lineListener

LineListener com.neuronrobotics.bowlerstudio.AudioPlayer.lineListener
private

◆ lowerThreshhold

double com.neuronrobotics.bowlerstudio.AudioPlayer.lowerThreshhold = 100 / 65535.0
staticprivate

◆ MONO

final int com.neuronrobotics.bowlerstudio.AudioPlayer.MONO = 0
static

Definition at line 28 of file AudioPlayer.java.

◆ outputMode

int com.neuronrobotics.bowlerstudio.AudioPlayer.outputMode
private

◆ RIGHT_ONLY

final int com.neuronrobotics.bowlerstudio.AudioPlayer.RIGHT_ONLY = 2
static

Definition at line 31 of file AudioPlayer.java.

◆ speakProgress

ISpeakingProgress com.neuronrobotics.bowlerstudio.AudioPlayer.speakProgress
private

◆ status

Status com.neuronrobotics.bowlerstudio.AudioPlayer.status = Status.WAITING
private

◆ STEREO

final int com.neuronrobotics.bowlerstudio.AudioPlayer.STEREO = 3
static

Definition at line 29 of file AudioPlayer.java.

◆ threshhold

double com.neuronrobotics.bowlerstudio.AudioPlayer.threshhold = 600 / 65535.0
staticprivate

◆ TTSString

String com.neuronrobotics.bowlerstudio.AudioPlayer.TTSString
private

The documentation for this class was generated from the following file: