jAER project on SourceForge

net.sf.jaer.util
Class SpikeSound

java.lang.Object
  extended by net.sf.jaer.util.SpikeSound

public class SpikeSound
extends java.lang.Object

Plays a spike sound on the speaker. Use it by constructing a new SpikeSound, then calling the play() method.

Version:
$Revision: 1.8 $
Author:
tobi

Field Summary
static javax.sound.sampled.AudioFormat audioFormat
           
static float SAMPLE_RATE
          sample rate in Hz
static byte SPIKE_AMPLITUDE
          amplitude of spike sound.
static int SPIKE_BUFFER_LENGTH
          length of spike sound sample in samples.
static int SPIKE_DURATION_MS
          duration of spike sound in ms
 
Constructor Summary
SpikeSound()
          Creates a new instance of SpikeSound
 
Method Summary
static void main(java.lang.String[] args)
           
 void play()
          plays the spike sound once.
 void play(int leftRight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPIKE_DURATION_MS

public static final int SPIKE_DURATION_MS
duration of spike sound in ms

See Also:
Constant Field Values

SAMPLE_RATE

public static final float SAMPLE_RATE
sample rate in Hz

See Also:
Constant Field Values

SPIKE_BUFFER_LENGTH

public static int SPIKE_BUFFER_LENGTH
length of spike sound sample in samples. Duration of spike sound is BUFFER_LENGTH/SAMPLE_RATE. e.g., with a sample rate of 4kHz, 8 sample spikes make the spikes 2ms long. This seems about right.


SPIKE_AMPLITUDE

public static final byte SPIKE_AMPLITUDE
amplitude of spike sound.

See Also:
Constant Field Values

audioFormat

public static javax.sound.sampled.AudioFormat audioFormat
Constructor Detail

SpikeSound

public SpikeSound()
Creates a new instance of SpikeSound

Method Detail

play

public void play()
plays the spike sound once. Has a problem that it seems to recirculate the sound forever...


play

public void play(int leftRight)
Parameters:
leftRight - 0 to play left, 1 to play right

main

public static void main(java.lang.String[] args)

jAER project on SourceForge