コード例 #1
0
        /// <summary>
        /// Converts a BNS audio file to Wave format.
        /// </summary>
        /// <param name="inputFile"></param>
        /// <param name="outputFile"></param>
        /// <returns></returns>
        public static Wave BnsToWave(Stream inputFile)
        {
            BNS b = new BNS();

            byte[] samples = b.Read(inputFile);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);

            if (b.bnsInfo.HasLoop == 1)
            {
                wave.AddLoop((int)b.bnsInfo.LoopStart);
            }
            return(wave);
        }
コード例 #2
0
        public static Wave BnsToWave(byte[] bnsFile)
        {
            BNS b = new BNS();

            byte[] samples;

            using (MemoryStream ms = new MemoryStream(bnsFile))
                samples = b.Read(ms);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);

            if (b.bnsInfo.HasLoop == 1)
            {
                wave.AddLoop((int)b.bnsInfo.LoopStart);
            }
            return(wave);
        }
コード例 #3
0
        public static Wave BnsToWave(string pathToFile)
        {
            BNS b = new BNS();

            byte[] samples;

            using (FileStream fs = new FileStream(pathToFile, FileMode.Open))
                samples = b.Read(fs);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);

            if (b.bnsInfo.HasLoop == 1)
            {
                wave.AddLoop((int)b.bnsInfo.LoopStart);
            }
            return(wave);
        }
コード例 #4
0
ファイル: BNS.cs プロジェクト: Chris230291/sma-wii
        public static Wave BnsToWave(byte[] bnsFile)
        {
            BNS b = new BNS();
            byte[] samples;

            using (MemoryStream ms = new MemoryStream(bnsFile))
                samples = b.Read(ms);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);
            if (b.bnsInfo.HasLoop == 1) wave.AddLoop((int)b.bnsInfo.LoopStart);
            return wave;
        }
コード例 #5
0
ファイル: BNS.cs プロジェクト: Chris230291/sma-wii
        public static Wave BnsToWave(string pathToFile)
        {
            BNS b = new BNS();
            byte[] samples;

            using (FileStream fs = new FileStream(pathToFile, FileMode.Open))
                samples = b.Read(fs);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);
            if (b.bnsInfo.HasLoop == 1) wave.AddLoop((int)b.bnsInfo.LoopStart);
            return wave;
        }
コード例 #6
0
ファイル: BNS.cs プロジェクト: Chris230291/sma-wii
        /// <summary>
        /// Converts a BNS audio file to Wave format.
        /// </summary>
        /// <param name="inputFile"></param>
        /// <param name="outputFile"></param>
        /// <returns></returns>
        public static Wave BnsToWave(Stream inputFile)
        {
            BNS b = new BNS();
            byte[] samples = b.Read(inputFile);

            Wave wave = new Wave(b.bnsInfo.ChannelCount, 16, b.bnsInfo.SampleRate, samples);
            if (b.bnsInfo.HasLoop == 1) wave.AddLoop((int)b.bnsInfo.LoopStart);
            return wave;
        }