Reduce the number of fragments, to get smoother output.
[pitch] / pitch.cpp
index 1f639d6..4e0e3eb 100644 (file)
--- a/pitch.cpp
+++ b/pitch.cpp
@@ -93,6 +93,9 @@ int get_dsp_fd()
        int rate = SAMPLE_RATE;
        ioctl(fd, SOUND_PCM_WRITE_RATE, &rate);
 
+       int fragments = 0x00020002;
+        ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fragments);
+       
        ioctl(3, SNDCTL_DSP_SYNC, 0);
        
        return fd;