|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSciLib.SP.Sound
public class Sound
This class contains some useful methods to handle Sound file.
| Field Summary | |
|---|---|
protected vector |
audioData
|
protected sun.audio.AudioDataStream |
audioDataStream
|
protected byteVector |
byteSignal
|
protected int |
sampleRate
|
| Constructor Summary | |
|---|---|
Sound()
Make an empty Sound object |
|
Sound(byte[] s)
Make an Sound object from a signal array s |
|
Sound(byteVector s)
Make an Sound object from a signal vector s |
|
Sound(double[] s)
Make an Sound object from a signal array s |
|
Sound(vector s)
Make an Sound object from a signal vector s |
|
| Method Summary | |
|---|---|
double |
duration()
compute the duration |
vector |
getAudioData()
get the whole audio Data |
vector |
getAudioData(int n)
get n point audio Data from the beginning |
vector |
getAudioData(int i,
int j)
get audio Data from index i to index j |
byteVector |
getByteData()
get audio Data |
int |
getSampleRate()
get sample rate |
double |
max()
compute the maximum signal |
double |
min()
compute the minimum signal |
void |
normalize()
normalize the audio signal |
void |
play()
Plays the audio data synchronously, i.e. it blocks the thread it is being called from. |
int |
size()
get the size of the audio signal |
void |
stop()
Stop playing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byteVector byteSignal
protected int sampleRate
protected vector audioData
protected sun.audio.AudioDataStream audioDataStream
| Constructor Detail |
|---|
public Sound()
public Sound(byteVector s)
s - A vector that contains the audio signalpublic Sound(byte[] s)
s - An array that contains the audio signalpublic Sound(double[] s)
s - An array that contains the audio signalpublic Sound(vector s)
s - A vector that contains the audio signal| Method Detail |
|---|
public byteVector getByteData()
public vector getAudioData(int i,
int j)
i - the start indexj - the stop index
public vector getAudioData(int n)
n - the number of data points
public vector getAudioData()
public int getSampleRate()
public int size()
public double duration()
public double min()
public double max()
public void normalize()
public void play()
public void stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||