org.xiph.speex.player

Class Recorder

Implemented Interfaces:
ActionListener

public class Recorder
extends Player

JavaSound Recorder.
Version:
$Revision: 1.2 $
Author:
Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)

Nested Class Summary

protected class
Recorder.Capture
Capture thread

Nested classes/interfaces inherited from class org.xiph.speex.player.Player

Player.Playback

Field Summary

static String
CHANNELS_MONO
Mono Audio (1 channel).
static String
CHANNELS_STEREO
Stereo Audio (2 channels).
static String
REVISION
Revision Number
static String
SAMPLERATE_11KHZ
Audio sampled at 11 kHz.
static String
SAMPLERATE_16KHZ
Audio sampled at 16 kHz (wideband).
static String
SAMPLERATE_22KHZ
Audio sampled at 22 kHz (FM radio quality).
static String
SAMPLERATE_32KHZ
Audio sampled at 32 kHz (ultra-wideband).
static String
SAMPLERATE_44KHZ
Audio sampled at 44 kHz (CD quality).
static String
SAMPLERATE_8KHZ
Audio sampled at 8 kHz (telephone quality).
protected static int
STATE_RECORDING
Finite State Machine State: Recording
protected static int
STATE_REC_PAUSED
Finite State Machine State: Recording Paused
protected byte[]
audio
protected Recorder.Capture
capture
protected JButton
recordButton
Record Button

Fields inherited from class org.xiph.speex.player.Player

BUILD, REVISION, STATE_BUFFERING, STATE_ERROR, STATE_INIT, STATE_PAUSED, STATE_PLAYING, STATE_STOPPED, VERSION, audioFile, audioFilename, audioLength, oldstate, pauseButton, playButton, playback, playerButtonPane, playerScrollPane, progressBar, state, stopButton, timer

Constructor Summary

Recorder(String file)
Build a Recorder.

Method Summary

void
actionPerformed(ActionEvent e)
Process Actions when button are pressed.
protected void
createButtonPanel()
Create the ButtonPanel for the recorder.
protected InputStream
getAudioStream()
Returns an InputSteam containing the Audio to playback.
protected int
getProgress()
Return the progress of the playback.
void
init()
Initialize the Player Component.
static void
main(String[] args)
Command Line entrance.
void
pauseIt()
void
playIt()
void
recordIt()
void
stopIt()

Methods inherited from class org.xiph.speex.player.Player

actionPerformed, buildButton, createButtonPanel, createGUI, createImageIcon, createScrollPanel, getAudioStream, getProgress, init, main, pauseIt, playIt, start, stop, stopIt

Field Details

CHANNELS_MONO

public static final String CHANNELS_MONO
Mono Audio (1 channel).

CHANNELS_STEREO

public static final String CHANNELS_STEREO
Stereo Audio (2 channels).

REVISION

public static final String REVISION
Revision Number

SAMPLERATE_11KHZ

public static final String SAMPLERATE_11KHZ
Audio sampled at 11 kHz.

SAMPLERATE_16KHZ

public static final String SAMPLERATE_16KHZ
Audio sampled at 16 kHz (wideband).

SAMPLERATE_22KHZ

public static final String SAMPLERATE_22KHZ
Audio sampled at 22 kHz (FM radio quality).

SAMPLERATE_32KHZ

public static final String SAMPLERATE_32KHZ
Audio sampled at 32 kHz (ultra-wideband).

SAMPLERATE_44KHZ

public static final String SAMPLERATE_44KHZ
Audio sampled at 44 kHz (CD quality).

SAMPLERATE_8KHZ

public static final String SAMPLERATE_8KHZ
Audio sampled at 8 kHz (telephone quality).

STATE_RECORDING

protected static final int STATE_RECORDING
Finite State Machine State: Recording
Field Value:
6

STATE_REC_PAUSED

protected static final int STATE_REC_PAUSED
Finite State Machine State: Recording Paused
Field Value:
7

audio

protected byte[] audio

capture

protected Recorder.Capture capture

recordButton

protected JButton recordButton
Record Button

Constructor Details

Recorder

public Recorder(String file)
Build a Recorder.
Parameters:
file -

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)
Process Actions when button are pressed. Implemented from ActionListener interface.
Overrides:
actionPerformed in interface Player

createButtonPanel

protected void createButtonPanel()
Create the ButtonPanel for the recorder. The recorder button panel that should look something like this:
 
 +--------------------------------+
 | +------+ +----+ +-----+ +----+ |
 | |record| |play| |pause| |stop| |  Button Panel
 | +------+ +----+ +-----+ +----+ |
 +--------------------------------+
 
Overrides:
createButtonPanel in interface Player

getAudioStream

protected InputStream getAudioStream()
            throws IOException
Returns an InputSteam containing the Audio to playback.
Overrides:
getAudioStream in interface Player
Returns:
an InputSteam containing the Audio to playback.

getProgress

protected int getProgress()
Return the progress of the playback.
Overrides:
getProgress in interface Player
Returns:
the progress of the playback.

init

public void init()
Initialize the Player Component.
Overrides:
init in interface Player

main

public static void main(String[] args)
Command Line entrance.
Overrides:
main in interface Player
Parameters:
args -

pauseIt

public void pauseIt()
Overrides:
pauseIt in interface Player

playIt

public void playIt()
Overrides:
playIt in interface Player

recordIt

public void recordIt()

stopIt

public void stopIt()
Overrides:
stopIt in interface Player

Copyright © 1999-2004 Wimba S.A. All Rights Reserved.