Package ipsk.audio
Interface AudioController
-
- All Known Implementing Classes:
J2AudioController
public interface AudioController
Deprecated.Please useAudioController2
instead.Manages audio recording and playback. This interface allows easy recording of playback and recording auf audio. It supports simultanous recording/playback of more than one line. Implementations should try to synchronize this lines. Audio lines and channels are sometimes confused: A line is a way for an audio stream. The audio stream can have one or more channels, determined by the audio format setting. After the number of lines (usingsetNumLines(int)
) and the audio format (usingsetAudioFormat(AudioFormat)
) are set, you must configure (configure()
) the controller. If the controller is not able to find matching audio lines it will throw an exception. Before starting playback or recording (or capturing) you have to open the controller.
Summary of features:- looks for matching audio mixers and lines
- configures and opens the lines
- handles synchronized starting and stopping
A typical scenario for a session:
- Set audio format for the session.
- Optionally set the mixer and/or number of lines to use.
- Configure the session.
- Open the session.
- Prepare recording.
- Start recording.
- Stop recording.
- Prepare playback.
- Optionally set start/stop position.
- Start playback.
- Pause playback.
- Start playback.
- Stop playback or the playback finishes at the end of file(s)
- Repeat several times from Nr. 5.
- Close session.
- Version:
- $Id: AudioController.java,v 1.15 2011/04/07 19:49:01 klausj Exp $
- Author:
- Klaus Jänsch, klausj@phonetik.uni-muenchen.de
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AudioController.CaptureStatus
Deprecated.Represents status of the capture engine.static class
AudioController.PlaybackStatus
Deprecated.Represents status of the playback engine.
-
Field Summary
Fields Modifier and Type Field Description static long
AUDIO_END
Deprecated.static long
DISABLE_CAPTURE
Deprecated.static long
FULLDUPLEX
Deprecated.static long
HOLD_OPEN
Deprecated.static long
OPEN_ON_DEMAND
Deprecated.static long
POS_UNKNOWN
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addAudioControllerListener(AudioControllerListener acl)
Deprecated.Adds controller listener.void
close()
Deprecated.Closes this session.void
configure()
Deprecated.Configures a session.javax.sound.sampled.AudioFormat
getAudioFormat()
Deprecated.Get audio format.AudioController.CaptureStatus
getCaptureStatus()
Deprecated.Gets current status of the capturer.float[]
getLevels()
Deprecated.Gets levels of all channels. maximum level is 1.0 representing 0dB
minimum level is 0
array has channels * numLines entrieslong
getMode()
Deprecated.int
getNumLines()
Deprecated.Get number of lines.javax.sound.sampled.AudioFormat
getPlaybackAudioFormat()
Deprecated.Get audio format for playback.java.io.File[]
getPlaybackFiles()
Deprecated.Gets playback files.long
getPlaybackFrameLength()
Deprecated.Gets length of largest playback file in frames, -1 if not availablelong
getPlaybackFramePosition()
Deprecated.Get playback position.long
getPlaybackStartFramePosition()
Deprecated.Gets the start position.AudioController.PlaybackStatus
getPlaybackStatus()
Deprecated.Gets current status of playback.long
getPlaybackStopFramePosition()
Deprecated.Gets the stop position.java.lang.String
getProperty(java.lang.String propertyName)
Deprecated.Get an implementation specific property.java.lang.String
getPropertyDescription(java.lang.String propertyName)
Deprecated.Get a description of the property.java.lang.String[]
getPropertyNames()
Deprecated.Get an implementation specific property names.java.io.File[]
getRecordingFiles()
Deprecated.Gets recording files.long
getRecordingFramePosition()
Deprecated.Get recording position.javax.sound.sampled.Mixer.Info
getSourceMixerInfo()
Deprecated.Get current used source mixer (playback) info.javax.sound.sampled.Mixer.Info
getTargetMixerInfo()
Deprecated.Get current used target mixer (recording) info.boolean
isOverwrite()
Deprecated.Gets overwrite flag.boolean
isPlaybackRandomPositioningSupported()
Deprecated.Get random positioning capability of the playback engine.void
open()
Deprecated.Opens the session.void
pausePlayback()
Deprecated.Pauses playback.void
preparePlayback()
Deprecated.Prepares playback.void
prepareRecording()
Deprecated.Prepares recording.void
removeAudioControllerListener(AudioControllerListener acl)
Deprecated.Removes controller listener.void
setAudioFormat(javax.sound.sampled.AudioFormat audioFormat)
Deprecated.Use audio format audioFormat..void
setMode(long modeBits)
Deprecated.void
setNumLines(int numLines)
Deprecated.Use numLines lines.void
setOverwrite(boolean overwrite)
Deprecated.Sets overwrite flag.void
setPlaybackAudioSources(AudioSource[] sources)
Deprecated.void
setPlaybackFiles(java.io.File[] playbackFiles)
Deprecated.Sets playback files to use.long
setPlaybackFramePosition(long newPosition)
Deprecated.Sets the new frame position of playback.void
setPlaybackInputStreams(java.io.InputStream[] inputStreams)
Deprecated.Sets playback Inputstreams to use.long
setPlaybackStartFramePosition(long startPosition)
Deprecated.Sets the start position.long
setPlaybackStopFramePosition(long stopPosition)
Deprecated.Sets the stop position.void
setPlaybackURLs(java.net.URL[] urls)
Deprecated.Sets playback URL's to use.void
setProperty(java.lang.String propertyName, java.lang.String value)
Deprecated.Set a property for a specific implementation.void
setRecordingFiles(java.io.File[] recordingFiles)
Deprecated.Sets recording files to use.void
setRecordingOutputStreams(java.io.OutputStream[] streams)
Deprecated.Sets recording OutputStreams to use.void
setSettings()
Deprecated.Call the graphical user interface of the controller implementation to set the configuration.void
setSourceMixer(javax.sound.sampled.Mixer.Info mixerInfo)
Deprecated.Use the source mixer (playback) described by mixerInfo.void
setSourceMixerName(java.lang.String mixerName)
Deprecated.Use the source mixer (playback) with the given name.void
setTargetMixer(javax.sound.sampled.Mixer.Info mixerInfo)
Deprecated.Use the target mixer (recording) described by mixerInfo.void
setTargetMixerName(java.lang.String mixerName)
Deprecated.Use the target mixer (recording) with the given name.void
startCapture()
Deprecated.Starts the capturing of data.void
startPlayback()
Deprecated.Starts the playback.void
startRecording()
Deprecated.Starts recording to the given files.void
stopCapture()
Deprecated.Stops capturing.void
stopPlayback()
Deprecated.Stops playback.void
stopRecording()
Deprecated.Stops recording. the method blocks until all files are written
-
-
-
Field Detail
-
AUDIO_END
static final long AUDIO_END
Deprecated.- See Also:
- Constant Field Values
-
POS_UNKNOWN
static final long POS_UNKNOWN
Deprecated.- See Also:
- Constant Field Values
-
FULLDUPLEX
static final long FULLDUPLEX
Deprecated.- See Also:
- Constant Field Values
-
OPEN_ON_DEMAND
static final long OPEN_ON_DEMAND
Deprecated.- See Also:
- Constant Field Values
-
DISABLE_CAPTURE
static final long DISABLE_CAPTURE
Deprecated.- See Also:
- Constant Field Values
-
HOLD_OPEN
static final long HOLD_OPEN
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
setSourceMixerName
void setSourceMixerName(java.lang.String mixerName)
Deprecated.Use the source mixer (playback) with the given name.- Parameters:
mixerName
- the name of the source mixer
-
setSourceMixer
void setSourceMixer(javax.sound.sampled.Mixer.Info mixerInfo)
Deprecated.Use the source mixer (playback) described by mixerInfo.- Parameters:
mixerInfo
- the info (name) of the mixer
-
getSourceMixerInfo
javax.sound.sampled.Mixer.Info getSourceMixerInfo()
Deprecated.Get current used source mixer (playback) info.- Returns:
- mixerInfo the info of the source mixer
-
setTargetMixerName
void setTargetMixerName(java.lang.String mixerName)
Deprecated.Use the target mixer (recording) with the given name.- Parameters:
mixerName
- the name of the target mixer
-
setTargetMixer
void setTargetMixer(javax.sound.sampled.Mixer.Info mixerInfo)
Deprecated.Use the target mixer (recording) described by mixerInfo.- Parameters:
mixerInfo
- the info of the target mixer
-
getTargetMixerInfo
javax.sound.sampled.Mixer.Info getTargetMixerInfo()
Deprecated.Get current used target mixer (recording) info.- Returns:
- mixerInfo the info (name) of the target mixer
-
setMode
void setMode(long modeBits)
Deprecated.
-
getMode
long getMode()
Deprecated.
-
setNumLines
void setNumLines(int numLines)
Deprecated.Use numLines lines. For each line a recording file will be created.- Parameters:
numLines
- number of lines to use
-
getNumLines
int getNumLines()
Deprecated.Get number of lines.- Returns:
- number of lines to use
-
setAudioFormat
void setAudioFormat(javax.sound.sampled.AudioFormat audioFormat)
Deprecated.Use audio format audioFormat..- Parameters:
audioFormat
- audio format
-
getAudioFormat
javax.sound.sampled.AudioFormat getAudioFormat()
Deprecated.Get audio format.- Returns:
- audio format
-
getPlaybackAudioFormat
javax.sound.sampled.AudioFormat getPlaybackAudioFormat()
Deprecated.Get audio format for playback. The controller sets the audio format according to the set playback files. So it can differ from the chosen foprmat.- Returns:
- audio format
-
configure
void configure() throws AudioControllerException
Deprecated.Configures a session.- Throws:
AudioControllerException
-
open
void open() throws AudioControllerException
Deprecated.Opens the session.- Throws:
AudioControllerException
-
close
void close() throws AudioControllerException
Deprecated.Closes this session.- Throws:
AudioControllerException
-
setPlaybackFiles
void setPlaybackFiles(java.io.File[] playbackFiles)
Deprecated.Sets playback files to use.the size of the array must equal the number of lines opened.
- Parameters:
playbackFiles
- the file array to play
-
getPlaybackFiles
java.io.File[] getPlaybackFiles()
Deprecated.Gets playback files.the size of the array is equal the number of lines opened.
- Returns:
- the file array of playbackfiles set
-
setPlaybackURLs
void setPlaybackURLs(java.net.URL[] urls)
Deprecated.Sets playback URL's to use.the size of the array must equal the number of lines opened.
- Parameters:
urls
- the URL array to play
-
setPlaybackInputStreams
void setPlaybackInputStreams(java.io.InputStream[] inputStreams)
Deprecated.Sets playback Inputstreams to use.the size of the array must equal the number of lines opened.
- Parameters:
inputStreams
- the inputstream array to play
-
setPlaybackAudioSources
void setPlaybackAudioSources(AudioSource[] sources)
Deprecated.
-
setOverwrite
void setOverwrite(boolean overwrite)
Deprecated.Sets overwrite flag. If the overwrite flag is set, existing recording files are overwritten without any exception or warning.- Parameters:
overwrite
- overwrite flag
-
isOverwrite
boolean isOverwrite()
Deprecated.Gets overwrite flag. If the overwrite flag is set, existing recording files are overwritten without any exception or warning.- Returns:
- overwrite flag
-
setRecordingFiles
void setRecordingFiles(java.io.File[] recordingFiles)
Deprecated.Sets recording files to use.the size of the array must equal the number of lines opened.
- Parameters:
recordingFiles
-
-
getRecordingFiles
java.io.File[] getRecordingFiles()
Deprecated.Gets recording files.the size of the array is equal the number of lines opened.
- Returns:
- recordingFiles
-
setRecordingOutputStreams
void setRecordingOutputStreams(java.io.OutputStream[] streams)
Deprecated.Sets recording OutputStreams to use.the size of the array must equal the number of lines opened.
- Parameters:
streams
- recording OutputStreams
-
preparePlayback
void preparePlayback() throws AudioControllerException
Deprecated.Prepares playback.- Throws:
AudioControllerException
-
prepareRecording
void prepareRecording() throws AudioControllerException
Deprecated.Prepares recording.- Throws:
AudioControllerException
-
startPlayback
void startPlayback() throws AudioControllerException
Deprecated.Starts the playback.- Throws:
AudioControllerException
-
startCapture
void startCapture() throws AudioControllerException
Deprecated.Starts the capturing of data. Can be used to capture data from the line without writing to files- Throws:
AudioControllerException
-
startRecording
void startRecording() throws AudioControllerException
Deprecated.Starts recording to the given files.- Throws:
AudioControllerException
- See Also:
prepareRecording()
-
pausePlayback
void pausePlayback() throws AudioControllerException
Deprecated.Pauses playback.- Throws:
AudioControllerException
-
stopPlayback
void stopPlayback() throws AudioControllerException
Deprecated.Stops playback.- Throws:
AudioControllerException
-
stopCapture
void stopCapture() throws AudioControllerException
Deprecated.Stops capturing.- Throws:
AudioControllerException
-
stopRecording
void stopRecording() throws AudioControllerException
Deprecated.Stops recording. the method blocks until all files are written- Throws:
AudioControllerException
-
getLevels
float[] getLevels()
Deprecated.Gets levels of all channels. maximum level is 1.0 representing 0dB
minimum level is 0
array has channels * numLines entries- Returns:
- current audio levels
-
isPlaybackRandomPositioningSupported
boolean isPlaybackRandomPositioningSupported()
Deprecated.Get random positioning capability of the playback engine.- Returns:
- random positioning capability
-
getPlaybackFrameLength
long getPlaybackFrameLength()
Deprecated.Gets length of largest playback file in frames, -1 if not available- Returns:
- length of largest playback file in frames
-
setPlaybackFramePosition
long setPlaybackFramePosition(long newPosition)
Deprecated.Sets the new frame position of playback.- Parameters:
newPosition
- the requested position- Returns:
- the actually set position or POS_UNKNOWN (-1) if not supported
-
getPlaybackFramePosition
long getPlaybackFramePosition()
Deprecated.Get playback position.- Returns:
- current playback position in audio frames or POS_UNKNOWN (-1) if not supported
-
setPlaybackStartFramePosition
long setPlaybackStartFramePosition(long startPosition)
Deprecated.Sets the start position. Used to play only a segment of an audio file.- Parameters:
startPosition
- position in audio frames from where to start- Returns:
- the actually set start position
-
getPlaybackStartFramePosition
long getPlaybackStartFramePosition()
Deprecated.Gets the start position.- Returns:
- start position
-
setPlaybackStopFramePosition
long setPlaybackStopFramePosition(long stopPosition)
Deprecated.Sets the stop position. Used to play only a segment of an audio file. To play the whole audio file set the position to AUDIO_END (-1).- Parameters:
stopPosition
- position in audio frames to stop- Returns:
- the actually set stop position
-
getPlaybackStopFramePosition
long getPlaybackStopFramePosition()
Deprecated.Gets the stop position.- Returns:
- stop position
-
getRecordingFramePosition
long getRecordingFramePosition()
Deprecated.Get recording position.- Returns:
- current recording position in audio frames or -1 if not supported
-
getPropertyNames
java.lang.String[] getPropertyNames()
Deprecated.Get an implementation specific property names.- Returns:
- property names
-
getPropertyDescription
java.lang.String getPropertyDescription(java.lang.String propertyName)
Deprecated.Get a description of the property.- Parameters:
propertyName
-- Returns:
- description
-
setProperty
void setProperty(java.lang.String propertyName, java.lang.String value)
Deprecated.Set a property for a specific implementation.- Parameters:
propertyName
-value
-
-
getProperty
java.lang.String getProperty(java.lang.String propertyName)
Deprecated.Get an implementation specific property.- Parameters:
propertyName
-- Returns:
- value of the property or null if there is no such property
-
setSettings
void setSettings()
Deprecated.Call the graphical user interface of the controller implementation to set the configuration.
-
getCaptureStatus
AudioController.CaptureStatus getCaptureStatus()
Deprecated.Gets current status of the capturer.- Returns:
- capture status
-
getPlaybackStatus
AudioController.PlaybackStatus getPlaybackStatus()
Deprecated.Gets current status of playback.- Returns:
- playback status
-
addAudioControllerListener
void addAudioControllerListener(AudioControllerListener acl)
Deprecated.Adds controller listener.- Parameters:
acl
- controller listener
-
removeAudioControllerListener
void removeAudioControllerListener(AudioControllerListener acl)
Deprecated.Removes controller listener.- Parameters:
acl
- controller listener
-
-