Пример #1
0
func testTimeFunction(fun string) {
	sps := 22050
	dur := 34.0
	tf := timefunction.Create(fun)
	s := sound.LoadData("tf", tf.ToFloats(sps, dur, 0.0), sps)
	s.Play(-1)
	util.Wait(dur)
	s.Halt()
}
Пример #2
0
func testSoundData() {
	sps := 22050
	dur := 34.0
	l := int(float64(sps) * dur)
	data := make([]float64, l)
	linv := 1.0 / float64(l-1)
	for i := 0; i < l; i++ {
		f := float64(i) * linv * dur
		data[i] = 0.31 * math.Sin(f*888.0)
	}
	sound.LoadData("data", data, sps)
	testSound(sound.Get("data"))
}