예제 #1
0
        [MethodImpl(MethodImplOptions.AggressiveInlining)] // CalcAmplitudeとdBToAmplitudeをinlineで呼び出したい
        public byte[] CreateKhoomiiSound(uint wavelen, uint sampleRate, KhoomiiData khoomiiData)
        {
            byte[] wave      = new byte[wavelen];
            var    freqInfos = khoomiiData.FrequencyInfos;
            int    num_freq  = freqInfos.Count;

            //CreateSimpleWave(ref wave, freqInfos, sampleRate);
            CreateWaveWithBeat(ref wave, freqInfos, sampleRate);
            return(wave);
        }
예제 #2
0
 public double CalcAmplitude(double t, float volume)
 {
     return(128 + Math.Sin(2 * Math.PI * t) * KhoomiiData.dBToAmplitude(volume, (float)0.001 * 2));
 }