|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavaclient.PlayerDevice
javaclient.AudioDSPInterface
public class AudioDSPInterface
The audiodsp interface is used to control sound hardware, if equipped.
Field Summary | |
---|---|
static short |
PLAYER_AUDIODSP_GET_CONFIG
|
static short |
PLAYER_AUDIODSP_PLAY_CHIRP
|
static short |
PLAYER_AUDIODSP_PLAY_TONE
|
static short |
PLAYER_AUDIODSP_REPLAY
|
static short |
PLAYER_AUDIODSP_SET_CONFIG
|
Fields inherited from class javaclient.PlayerDevice |
---|
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec |
Constructor Summary | |
---|---|
AudioDSPInterface(PlayerClient pc,
short indexOfDevice)
Constructor for AudioDSPInterface. |
Method Summary | |
---|---|
void |
command(byte subtype,
int freq,
int amp,
int duration,
char[] bitString,
int bitStringLen)
The audiodsp interface accepts commands to produce fixed-frequency tones or binary phase shift keyed(BPSK) chirps through /dev/dsp (which is assumed to be associated with a sound card to which a speaker is attached). |
int[] |
getAmplitudes()
Returns the five highest amplitudes. |
void |
getAudioProperties()
Configuration request : Get audio properties. |
byte |
getChannels()
Returns the number of channels to use (1=mono, 2=stereo). |
int[] |
getFrequencies()
Returns the five highest frequencies. |
int |
getSampleFormat()
Returns the format with which to sample. |
int |
getSampleRate()
Returns the sample rate in Hertz. |
void |
handleResponse(int size)
Handle acknowledgement response messages (threaded mode). |
void |
readData()
The audiodsp interface reads the audio stream from /dev/dsp (which is assumed to be associated with a sound card connected to a microphone) and performs some analysis on it. |
void |
setAudioProperties(int sampleFormat,
int sampleRate,
byte channels)
Configuration request : Set audio properties. |
Methods inherited from class javaclient.PlayerDevice |
---|
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, readHeader, sendHeader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short PLAYER_AUDIODSP_SET_CONFIG
public static final short PLAYER_AUDIODSP_GET_CONFIG
public static final short PLAYER_AUDIODSP_PLAY_TONE
public static final short PLAYER_AUDIODSP_PLAY_CHIRP
public static final short PLAYER_AUDIODSP_REPLAY
Constructor Detail |
---|
public AudioDSPInterface(PlayerClient pc, short indexOfDevice)
pc
- a reference to the PlayerClient objectindexOfDevice
- the index of the deviceMethod Detail |
---|
public void readData()
readData
in class PlayerDevice
public int[] getFrequencies()
public int[] getAmplitudes()
public void command(byte subtype, int freq, int amp, int duration, char[] bitString, int bitStringLen)
subtype
- The packet subtype. Set to PLAYER_AUDIODSP_PLAY_TONE to play
a single frequency; bitString and bitStringLen do not need to be set. Set to
PLAYER_AUDIODSP_PLAY_CHIRP to play a BPSKeyed chirp; bitString should contain
the binary string to encode, and bitStringLen set to the length of the
bitString. Set to PLAYER_AUDIODSP_REPLAY to replay the last sound.freq
- Frequency to play (Hz)amp
- Amplitude to play (dB?)duration
- Duration to play (msec)bitString
- BitString to encode in sine wavebitStringLen
- Length of the bit stringpublic void getAudioProperties()
public void setAudioProperties(int sampleFormat, int sampleRate, byte channels)
sampleFormat
- Format with which to samplesampleRate
- Sample rate in Hertzchannels
- Number of channels to use. 1=mono, 2=stereopublic void handleResponse(int size)
handleResponse
in class PlayerDevice
size
- size of the payloadpublic int getSampleFormat()
public int getSampleRate()
public byte getChannels()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |