19 Feb
2008
19 Feb
'08
3:45 p.m.
Ignacy Kasperowicz wrote:
Just write the data to the device.
Ok, but when I just write data to the device I don't really know how long it'll be playing.
But you know how many sample you are writing, and you know the sample rate.
There is no problem when I've infinite loop with writei inside. but I need to change freq of my sound signal with exact 843 us period time.
Assuming a sample rate of 48 kHz, 1/1200 s corresponds to exactly 40 samples. At 44.1 kHz, this would be 36.75 samples, so you'd have to use groups of 37+37+37+36 samples with appropriate phase shifting.
BTW: 1 / 1200 Hz = 833.33... µs
HTH Clemens