Package ipsk.audio.impl.j2audio
Class Capture
- java.lang.Object
-
- ipsk.audio.impl.j2audio.Capture
-
- All Implemented Interfaces:
FileWriterListener
,java.lang.Runnable
,java.util.EventListener
,javax.sound.sampled.LineListener
public class Capture extends java.lang.Object implements java.lang.Runnable, javax.sound.sampled.LineListener, FileWriterListener
Deprecated.Please useCapture
instead.Captures/records audio data from audio source lines.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Constructor Summary
Constructors Constructor Description Capture(CaptureListener cl, javax.sound.sampled.TargetDataLine tdl)
Deprecated.Creates a capture engine for the given input line
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.Close the engine.javax.sound.sampled.AudioFormat
getAudioFormat()
Deprecated.Get current used audio format.long
getFramePosition()
Deprecated.Gets number of already recorded frames.float
getLatencyTime()
Deprecated.float[]
getLevels()
Deprecated.Get current normalized (0.0 - 1.0) level for each channel.int
getPreferredBufferSize()
Deprecated.void
main(java.lang.String[] args)
Deprecated.void
open(javax.sound.sampled.AudioFormat af)
Deprecated.Initialize the engine and open the capture lines.void
prepareToRecord(java.io.File recFile)
Deprecated.Prepare file to record to.void
prepareToRecord(java.io.OutputStream os)
Deprecated.Prepare the stream to which the recording data (including file header) will be writtenvoid
run()
Deprecated.void
setLatencyTime(float f)
Deprecated.void
setPreferredBufferSize(int i)
Deprecated.void
setUseTempFile(boolean useTempFile)
Deprecated.Force the use of temporary files.void
startCapturing()
Deprecated.Start capturing.void
startRecording()
Deprecated.Starts recording.void
stopCapturing()
Deprecated.Stops capturing.void
stopRecording()
Deprecated.Stops recording.void
update(java.lang.Object source, int event)
Deprecated.void
update(javax.sound.sampled.LineEvent le)
Deprecated.LineListener
implementation.
-
-
-
Constructor Detail
-
Capture
public Capture(CaptureListener cl, javax.sound.sampled.TargetDataLine tdl)
Deprecated.Creates a capture engine for the given input line- Parameters:
cl
- caputure listenertdl
- input line
-
-
Method Detail
-
setUseTempFile
public void setUseTempFile(boolean useTempFile)
Deprecated.Force the use of temporary files.- Parameters:
useTempFile
-
-
open
public void open(javax.sound.sampled.AudioFormat af) throws java.io.IOException, javax.sound.sampled.LineUnavailableException, AudioFormatNotSupportedException
Deprecated.Initialize the engine and open the capture lines. NOTE: The latency time parameter is currently IGNORED !!- Parameters:
af
- audio format to use- Throws:
java.io.IOException
javax.sound.sampled.LineUnavailableException
AudioFormatNotSupportedException
-
prepareToRecord
public void prepareToRecord(java.io.File recFile) throws java.io.IOException
Deprecated.Prepare file to record to.- Parameters:
recFile
- the file to record to.- Throws:
java.io.IOException
-
prepareToRecord
public void prepareToRecord(java.io.OutputStream os) throws java.io.IOException
Deprecated.Prepare the stream to which the recording data (including file header) will be written- Parameters:
os
- the recording stream- Throws:
java.io.IOException
-
startCapturing
public void startCapturing()
Deprecated.Start capturing. Capturing does not store any audio data. It is intended to get peak levels of the incoming audio signal to adjust gain control by the user.
-
startRecording
public void startRecording()
Deprecated.Starts recording.
-
stopRecording
public void stopRecording() throws java.io.IOException
Deprecated.Stops recording. This method blocks until the audio line is stopped, audio data is written and the engine thread has finished.- Throws:
java.io.IOException
-
stopCapturing
public void stopCapturing()
Deprecated.Stops capturing.
-
getLevels
public float[] getLevels()
Deprecated.Get current normalized (0.0 - 1.0) level for each channel.- Returns:
- array of levels
-
close
public void close()
Deprecated.Close the engine. The engine is stopped before.
-
update
public void update(javax.sound.sampled.LineEvent le)
Deprecated.LineListener
implementation.- Specified by:
update
in interfacejavax.sound.sampled.LineListener
-
run
public void run()
Deprecated.- Specified by:
run
in interfacejava.lang.Runnable
-
getAudioFormat
public javax.sound.sampled.AudioFormat getAudioFormat()
Deprecated.Get current used audio format.- Returns:
- audio format
-
getFramePosition
public long getFramePosition()
Deprecated.Gets number of already recorded frames.- Returns:
- current frame position
-
main
public void main(java.lang.String[] args)
Deprecated.
-
update
public void update(java.lang.Object source, int event)
Deprecated.- Specified by:
update
in interfaceFileWriterListener
-
getPreferredBufferSize
public int getPreferredBufferSize()
Deprecated.
-
setPreferredBufferSize
public void setPreferredBufferSize(int i)
Deprecated.
-
getLatencyTime
public float getLatencyTime()
Deprecated.
-
setLatencyTime
public void setLatencyTime(float f)
Deprecated.
-
-