Nitro In a Flash is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

/
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
´╗┐package  {

    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;

    use namespace strmInternal;
    use namespace sdatInternal;

    public class SDATTest extends Sprite {

        [Embed(source="sound_data.sdat", mimeType="application/octet-stream")]
        private var sdatClass:Class;

        private var reader:SDATReader;


        public function SDATTest() {
            reader=new SDATReader(new sdatClass());

            //listWaveArchives();
            //listStreams();
            streamTest();
            //swarTest(2,0);

        }

        private function listWaveArchives():void {
            var i:uint;
            for each(var swar:SWAR in reader.waveArchives) {
                var name:String=reader.waveArchiveSymbols[i];
                trace(name,swar.waves.length);
                listWaveArchiveContent(swar);
                i++;
            }
        }

        private function listWaveArchiveContent(swar:SWAR):void {
            var i:uint;
            for each(var wave:Wave in swar.waves) {
                var o:String="  "+i+" "+Wave.encodingAsString(wave.encoding)+" "+wave.duration+" "+wave.loops;
                if(wave.loops) {
                    o+=" "+wave.loopStart+" "+wave.loopLength;
                }
                trace(o);
                ++i;
            }
        }

        private function listStreams():void {
            var i:uint;
            for each(var stream:STRM in reader.streams) {
                var name:String=reader.streamSymbols[i];
                trace(name);
                i++;
            }
        }

        var streamPlayer:STRMPlayer;
        private function streamTest():void {

            var strmData:ByteArray;
            var stream:STRM;

            /*for(var i:uint;i<reader.streams.length;++i) {
                stream=reader.streams[i];
                trace(reader.streamSymbols[i],stream.length,stream.encoding);
            }*/


            stream=reader.streams[8];

            //trace(stream.dataPos,stream.blockLength,stream.nBlock);
            //reader.sdat.position=stream.dataPos;

            //strmData=new ByteArray();
            //strmData.writeBytes(reader.sdat,stream.dataPos,stream.blockLength*stream.nBlock);

            streamPlayer=new STRMPlayer(reader.streams[8]);
            streamPlayer.play();
        }

        var wavePlayer:WavePlayer;
        private function swarTest(swar:uint,sub:uint) {
            var wave:Wave=reader.waveArchives[swar].waves[sub];
            wavePlayer=new WavePlayer(wave);
            wavePlayer.play();
        }
    }

}
Ajax-loader Loading, please wait...