亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1567 | 回復(fù): 0
打印 上一主題 下一主題

這個(gè)alsa的演示程序怎么沒有聲音出來.應(yīng)該有雜聲的 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2007-03-18 12:49 |只看該作者 |倒序?yàn)g覽
http://www.alsa-project.org/alsa ... min_8c-example.html
0001 /*
00002  *  This extra small demo sends a random samples to your speakers.
00003  */
00004
00005 #include "../include/asoundlib.h"
00006
00007 static char *device = "default";                        /* playback device */
00008
00009 snd_output_t *output = NULL;
00010 unsigned char buffer[16*1024];                          /* some random data */
00011
00012 int main(void)
00013 {
00014         int err;
00015         unsigned int i;
00016         snd_pcm_t *handle;
00017         snd_pcm_sframes_t frames;
00018
00019         for (i = 0; i < sizeof(buffer); i++)
00020                 buffer = random() & 0xff;
00021
00022         if ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
00023                 printf("Playback open error: %s\n", snd_strerror(err));
00024                 exit(EXIT_FAILURE);
00025         }
00026         if ((err = snd_pcm_set_params(handle,
00027                                       SND_PCM_FORMAT_U8,
00028                                       SND_PCM_ACCESS_RW_INTERLEAVED,
00029                                       1,
00030                                       48000,
00031                                       1,
00032                                       500000)) < 0) {   /* 0.5sec */
00033                 printf("Playback open error: %s\n", snd_strerror(err));
00034                 exit(EXIT_FAILURE);
00035         }
00036
00037         for (i = 0; i < 16; i++) {
00038                 frames = snd_pcm_writei(handle, buffer, sizeof(buffer));
00039                 if (frames < 0)
00040                         frames = snd_pcm_recover(handle, frames, 0);
00041                 if (frames < 0) {
00042                         printf("snd_pcm_writei failed: %s\n", snd_strerror(err));
00043                         break;
00044                 }
00045                 if (frames > 0 && frames < (long)sizeof(buffer))
00046                         printf("Short write (expected %li, wrote %li)\n", (long)sizeof(buffer), frames);
00047         }
00048
00049         snd_pcm_close(handle);
00050         return 0;
00051 }http://www.alsa-project.org/alsa ... min_8c-example.html
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP