|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--MainFrame4k.AudioInput
This class takes care of everything regarding audio. It has a simple sine-samplegenerator and a player for a format which works kind of like xm.
Let me tell you a little about how the format works. First I wrote a converter to convert between xm and this format. It loaded up the xm and then splitted the patterndata between the 5 channels so that one channel only had to care about it's own patterns. That program then analyzed the patterns for each channel to find out which patterns where the same. Then each channel created it's own pattern order table.
Voila! done.
If you do not understand how it works yet, I am sure you can figure it out.. I mean, you have the source code :)
Look further down how to read in the songdata. Here it is if you are to lazy to scroll down:
for (int chn = 0; chn < 5; chn++) {
// read patternTable for channel
CHANNELpatternTable[chn] = new byte[in.read()];
in.read(CHANNELpatternTable[chn]);
// read patterndata for channel
CHANNELpatternData[chn] = new byte[in.read()][];
for (int j = 0; j < CHANNELpatternData[chn].length; j++) {
// read all the patterns
CHANNELpatternData[chn][j] = new byte[in.read()];
in.read(CHANNELpatternData[chn][j]);
}
}
Fields inherited from class java.io.InputStream |
SKIP_BUFFER_SIZE, skipBuffer |
Methods inherited from class java.io.InputStream |
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
|
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |