Cosmos/source/DokuTest/SampleSounds/SoundSamples.cs
Dokugogagoji_cp 5cad5cf670 Various audio advanced (now I'm stopping on it because I need float)
Starting implemeting SIMD Is (WIP)
2008-08-09 13:01:08 +00:00

34 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DokuTest.SampleSounds
{
public static class SoundSamples
{/*
private const double PI=3.14159;
public const double maxPhase= PI* 2;
public static Cosmos.Hardware.Audio.PCMStream generateSineWaveForm(double freq, int rate, double phase, int periodSize)
{
double maxPhase = 1.0 / freq;
double step = 1.0 / (double)rate;
List<char> frames = new List<char>();
//int bps = width / 8;
char elem;
//if ((width % 8) != 0) return null;
while (periodSize-- > 0)
{
elem = (char)(Math.Sin(phase) * maxPhase);
frames.Add(elem);
phase += step;
if (phase > maxPhase)
phase -= maxPhase;
}
//return new Cosmos.Hardware.Audio.PCMStream(freq, frames.ToArray<char>());
return null;
}
*/
}
}