1 2 3 4 5 6 7 8 9 10 11 12 13 | for (;;) { audio_buf_info info; /* Ask OSS if there is any free space in the buffer. */ if (ioctl(dsp,SNDCTL_DSP_GETOSPACE,&info) != 0) { perror("Unable to query buffer space"); close(dsp); return 1; }; /* Any empty fragments? */ if (info.fragments > 0) break; /* Not enough free space in the buffer. Waste time. */ usleep(100); }; |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |