Beispiel #1
0
        public static JAIDSPSoundBuffer SetupSoundBuffer(byte[] pcm, int cn, int sr, int bs)
        {
            v1++;

            var rt = new JAIDSPSoundBuffer()
            {
                format = new JAIDSPFormat()
                {
                    channels   = cn,
                    sampleRate = sr,
                },
                buffer = pcm,
                looped = false,
            };

            rt.generateFileBuffer();
            //File.WriteAllBytes("test/" + v1.ToString() + ".wav", rt.fileBuffer);
            return(rt);
        }
Beispiel #2
0
        public static JAIDSPSoundBuffer SetupSoundBuffer(byte[] pcm, int cn, int sr, int bs, int ls, int le)
        {
            v1++;
            var rt = new JAIDSPSoundBuffer()
            {
                format = new JAIDSPFormat()
                {
                    channels   = cn,
                    sampleRate = sr,
                },
                buffer    = pcm,
                loopStart = (int)Math.Floor((ls / 8f) * 16f), // 16 samples = 8 bytes
                loopEnd   = (int)Math.Floor((le / 8f) * 16f),
                looped    = true,
            };

            rt.generateFileBuffer();
            //File.WriteAllBytes("test/" + v1.ToString() + ".wav", rt.fileBuffer) ;
            return(rt);
        }