public class Record
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
_rate
sampling frequency
|
java.nio.DoubleBuffer |
avgNoiseBuffer
averaged sound level
|
java.util.Calendar |
endRecordingTime
end the recording
|
static int |
HAS_CANCELLED
recording state
|
static int |
HAS_COMPLETED
recording state
|
java.nio.DoubleBuffer |
noiseBuffer
noise buffer
|
java.nio.DoubleBuffer |
rawNoiseBuffer
raw noise buffer
|
long |
startRecord |
java.util.Calendar |
startRecordingTime
time at which the recording is started
|
static int |
STILL_ADDING
recording state
|
float[] |
subwindowing_raw_values
raw values obtained during the subwindowing
|
float[] |
subwindowing_values
values obtained during the subwindowing
|
java.nio.ShortBuffer |
totalBuffer
to be used in the future to access each PCM value (not just averages),
|
Constructor and Description |
---|
Record(long sensingDuration)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNoiseListener(NoiseListener toadd)
add a noise listener
|
double |
convolutionSum(double[] factors,
double[] vals,
int n,
int startIndex)
compute the convuolution sum
|
MeasurementsHelper |
getMeasurement(int duration)
Measurement for predefined duration
|
double |
getSubwindowDuration()
get the subwindowing duration
|
void |
loadAudioSettings()
Loads the specified audio settings
|
void |
removeMeasurementsHelper(Record helper)
remove a measurement helper
|
void |
removeNoiseListener(NoiseListener toremove)
listener that is removed
|
void |
start()
Starts measurement (new), resets variables and calls for new values to MeasurementsService
|
void |
startContinuous()
start the continuous recording
|
void |
stop()
Terminates current measurement.
|
public static final int STILL_ADDING
public static final int HAS_COMPLETED
public static final int HAS_CANCELLED
public long startRecord
public java.util.Calendar startRecordingTime
public java.util.Calendar endRecordingTime
public float[] subwindowing_values
public float[] subwindowing_raw_values
public java.nio.ShortBuffer totalBuffer
public java.nio.DoubleBuffer noiseBuffer
public java.nio.DoubleBuffer rawNoiseBuffer
public java.nio.DoubleBuffer avgNoiseBuffer
public static int _rate
public Record(long sensingDuration)
sensingDuration
- sensing durationpublic void addNoiseListener(NoiseListener toadd)
toadd
- listener that is addedpublic void removeNoiseListener(NoiseListener toremove)
toremove
- removed listenerpublic double getSubwindowDuration()
public double convolutionSum(double[] factors, double[] vals, int n, int startIndex)
factors
- vals
- measurementsn
- startIndex
- index pointing where to startpublic void stop()
public void start() throws java.lang.Exception
java.lang.Exception
- recording impossiblepublic MeasurementsHelper getMeasurement(int duration)
duration
- The sensing durationpublic void removeMeasurementsHelper(Record helper)
helper
- measurementhelper to removepublic void loadAudioSettings()
public void startContinuous() throws java.lang.Exception
java.lang.Exception