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 useCaptureinstead.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 voidclose()Deprecated.Close the engine.javax.sound.sampled.AudioFormatgetAudioFormat()Deprecated.Get current used audio format.longgetFramePosition()Deprecated.Gets number of already recorded frames.floatgetLatencyTime()Deprecated.float[]getLevels()Deprecated.Get current normalized (0.0 - 1.0) level for each channel.intgetPreferredBufferSize()Deprecated.voidmain(java.lang.String[] args)Deprecated.voidopen(javax.sound.sampled.AudioFormat af)Deprecated.Initialize the engine and open the capture lines.voidprepareToRecord(java.io.File recFile)Deprecated.Prepare file to record to.voidprepareToRecord(java.io.OutputStream os)Deprecated.Prepare the stream to which the recording data (including file header) will be writtenvoidrun()Deprecated.voidsetLatencyTime(float f)Deprecated.voidsetPreferredBufferSize(int i)Deprecated.voidsetUseTempFile(boolean useTempFile)Deprecated.Force the use of temporary files.voidstartCapturing()Deprecated.Start capturing.voidstartRecording()Deprecated.Starts recording.voidstopCapturing()Deprecated.Stops capturing.voidstopRecording()Deprecated.Stops recording.voidupdate(java.lang.Object source, int event)Deprecated.voidupdate(javax.sound.sampled.LineEvent le)Deprecated.LineListenerimplementation.
-
-
-
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, AudioFormatNotSupportedExceptionDeprecated.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.IOExceptionjavax.sound.sampled.LineUnavailableExceptionAudioFormatNotSupportedException
-
prepareToRecord
public void prepareToRecord(java.io.File recFile) throws java.io.IOExceptionDeprecated.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.IOExceptionDeprecated.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.IOExceptionDeprecated.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.LineListenerimplementation.- Specified by:
updatein interfacejavax.sound.sampled.LineListener
-
run
public void run()
Deprecated.- Specified by:
runin 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:
updatein 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.
-
-