Ejemplo n.º 1
0
        /// <summary>
        /// Create a RIFF wave from a vibration.
        /// </summary>
        /// <param name="v">Vibration file.</param>
        /// <returns>The RIFF wave as a vibration.</returns>
        public static RiffWave CreateRiffWave(Vibration v)
        {
            //New wave.
            RiffWave r = new RiffWave();

            //Not looped.
            if (!v.Loops)
            {
                r = RiffWaveFactory.CreateRiffWave(200, 1, EncoderFactory.SignedPcm8ToPcm8(new sbyte[][] { v.pcm8 }));
            }

            //Looped.
            else
            {
                r = RiffWaveFactory.CreateRiffWave(200, 1, EncoderFactory.SignedPcm8ToPcm8(new sbyte[][] { v.pcm8 }), v.LoopStart, v.LoopEnd);
            }

            return(r);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Make a RIFF Wave from a FISP.
        /// </summary>
        /// <param name="f"></param>
        /// <returns></returns>
        public static RiffWave CreateRiffWave(FISP f)
        {
            //New wave.
            RiffWave r = new RiffWave();

            //Not looped.
            if (!f.stream.isLoop)
            {
                r = RiffWaveFactory.CreateRiffWave(f.stream.sampleRate, 2, f.data.data.ToArray());
            }

            //Looped.
            else
            {
                r = RiffWaveFactory.CreateRiffWave(f.stream.sampleRate, 2, f.data.data.ToArray(), f.stream.loopStart, f.stream.loopEnd);
            }

            return(r);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a stream from a binary wave.
 /// </summary>
 /// <param name="b">The binary wave.</param>
 /// <param name="version">Version of the output stream.</param>
 /// <returns></returns>
 public static b_stm CreateStream(BinaryWave b, byte vMajor, byte vMinor, byte vRevision)
 {
     //Simple hack, but doesn't hurt optimization since SEEK must be recreated anyway.
     return(CreateStream(RiffWaveFactory.CreateRiffWave(b), true, vMajor, vMinor, vRevision));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a stream from wave.
 /// </summary>
 /// <param name="b">The b_wav.</param>
 /// <param name="version">Version of the output stream.</param>
 /// <returns></returns>
 public static b_stm CreateStream(b_wav b, byte vMajor, byte vMinor, byte vRevision)
 {
     //Simple hack, but doesn't hurt optimization since SEEK must be recreated anyway.
     return(CreateStream(RiffWaveFactory.CreateRiffWave(b), b.info.encoding >= EncodingTypes.DSP_ADPCM, vMajor, vMinor, vRevision));
 }