亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? sndplay.c

?? vxworks下windml的一些demo程序
?? C
字號(hào):
/* sndplay.c - Audio file playing demonstration *//* Copyright 2000 Wind River Systems, Inc. *//*modification history--------------------01h,14nov01,jlb  Fix fragment size setting (SPR 69972)01g,20dec00,gav  Missed change to variable name.01f,20dec00,gav  Entry point identical to filename w/o extension.01e,06dec00,jlb  Open sound device read/write, fix compile warnings01d,22nov00,gav  Added entry point using same form as other examples.01c,14nov00,jlb  Changed name of wavplay.c to sndPlay.c and added                 support for au (Sun) type of audio files01b,11sep00,jlb  Use soundcard.h verses sound.h01a,15mar00,jlb  written*//*DESCRIPTIONThis file provides a demonstration of the use of the audio devicedriver.  An audio file formatted as a wav or an au  file is played onthe audio device.This program demonstrates the method to open the audio and mixerdevices and to:\is\i  set the volume\i  select the number of audio channels\i  select the sample rate for the audio stream\i  select the size of a sample\ieIn addition this demonstration program may be used with or withoutthe <select> functionality.*//* Includes */#include <vxWorks.h>#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <ioLib.h>#include <unistd.h>#include <string.h>#include <selectLib.h>#include <ugl/ugl.h>#include <ugl/uglos.h>#include <ugl/audio/soundcard.h>#include <ugl/audio/sndWave.h>#include <ugl/audio/sndAu.h>#define AUDIO_DEVICE "/sound/dsp"#define MIXER_DEVICE "/sound/mixer"#define USE_SELECTSTATUS soundPlay (char *);/******************************************************************************* wexSndPlay - start task to play audio file ** This routine spawns a task to play an aduio stream conatined in the file* specified by <filename>.** RETURNS: OK ** ERRNO: N/A*** SEE ALSO: **/int sndPlay     (    char *filename          /* Name of audio file to play */    )    {    uglOSTaskCreate("tWindMLSnd", (UGL_FPTR)soundPlay, 110, 0, 10240, 		    (int)filename, 0,0,0,0);    return (OK);    }/******************************************************************************* soundPlay - play a sound file ** This routine plays the sound file <filename> on an audio device.  The audio* file is read to obtain the header information. The audio stream is checked* to see if the file is formated as a wav or an au file.   Using the header* information the audio device is placed in the proper mode and then the* audio stream is sent to the audio device .** RETURNS: OK when the audio file was successfully played; otherwise ERROR** ERRNO: N/A*** SEE ALSO: **/STATUS soundPlay     (    char *filename              /* Audio file */    )    {    unsigned char *buffer;    int buffer_size, samplebits, i, blockSize;    int size = 0;    int fd, sd, md;    int channels;    int format;    UINT32 samplerate, samples, datastart;    audio_buf_info     info;    int maxVol = (100 << 8) | 100;#ifdef USE_SELECT     fd_set writeFD;#endif /* USE_SELECT */    /* Initialize WindML */    uglInitialize();    /* Open the audio file */    fd = open (filename, O_RDONLY, 0666);    if (fd < 0)        {        printf ("Error opening file %s\n", filename);        return (ERROR);        }    /* Assume a wav file and read the wav form header file */    if (wavHeaderRead (fd, &channels, &samplerate, &samplebits,                         &samples, &datastart) == OK)        {        /* Set the audio format */        if (samplebits == 16)            format = AFMT_S16_LE;        else            format = AFMT_U8;        }    else        /* Error, try to read as an au type file */        auHeaderRead (fd, &channels, &samplerate, &format,                         &samples, &datastart);    /* if format was set, then sound format was recognized */    if (format == -1)        {        printf ("Sound file format not recognized\n");        close (fd);        return (ERROR);        }    /* Position to the start of the audio data */    if (lseek (fd, datastart, SEEK_SET) != datastart)        {        printf ("Sound file is corrupted\n");        close (fd);        return (ERROR);        }    /* Open the audio device */    sd = open (AUDIO_DEVICE, O_RDWR, 0666);    if (sd < 0)        {        printf("Unable to open the sound device - %s\n",AUDIO_DEVICE);        close (fd);        return (ERROR);        }    /* Open the mixer device */    md = open (MIXER_DEVICE, O_RDWR, 0666);    if (md < 0)        {        printf("Unable to open the mixer device - %s\n",MIXER_DEVICE);        close (fd);        close (sd);        return (ERROR);        }    /* Print characteristics of the sound data stream  */    printf ("File name:   %s\n", filename);    switch (format)        {        case AFMT_S16_LE:            printf("WAV file - 16 bit signed little endian\n");            size = samples * channels * (samplebits >> 3);            break;        case AFMT_U8:            printf("WAV file - 8 bit unsigned\n");            size = samples * channels * (samplebits >> 3);            break;        case AFMT_MU_LAW:            printf("AU file - 8 bit muLaw\n");            size = samples * channels;            samplebits = 8;            break;        }    printf ("Channels:    %d\n", channels);    printf ("Sample Rate: %d\n", (int)samplerate);    printf ("Sample Bits: %d\n", samplebits);    printf ("samples:     %d\n", (int)samples);    /* Although the mixer has default volume settings, lets set the     * volume for both channels to max     */    ioctl (md, SOUND_MIXER_WRITE_VOLUME, (int)&maxVol);    /* Set the device in proper mode for audio form characteristics */    ioctl (sd, SNDCTL_DSP_CHANNELS, (int)&channels);    ioctl (sd, SNDCTL_DSP_SPEED, (int)&samplerate);    ioctl (sd, SNDCTL_DSP_SETFMT, (int)&format);    /* Although the driver has a default fragment size, lets set      * to a size of 4k and use 2 fragments.     * The argument to this call is an integer encoded as 0xMMMMSSSS     * (in hex). The 16 least significant bits determine the     * fragment size. The size is 2^SSSS. For example SSSS=0008 gives     * fragment size of 256 bytes (2^8). The minimum is 16 bytes (SSSS=4)     * and the maximum is total buffer size/2. Some devices or processor     * architectures may require larger fragments - in this case the     * requested fragment size is automatically increased.     */    blockSize = (2 << 16) | 12;    ioctl (sd, SNDCTL_DSP_SETFRAGMENT, (int)&blockSize);    /* get the maximum data transfer size and allocate buffer.  The     * size of the buffer to pass to the audio device is such that     * each buffer is the maximum that the audio device can handle     * without blocking.  It is important that the buffer size     * be a multiple of the fragment size.     */    ioctl (sd, SNDCTL_DSP_GETOSPACE, (int)&info);    blockSize = info.fragstotal * info.fragsize;    buffer = malloc (blockSize);    if (!buffer)        {        close (fd);        return -1;        }    /* Loop reading audio file and sending to audio device */    while (size > 0)        {        /* If the audio stream has more than the block size, then         * select a read of the block size, otherwise only         * read the remaining data from the audio stream.         */        buffer_size = size > blockSize ? blockSize : size;        /* Read a block of audio data */        i = read (fd, buffer, buffer_size);        /* Send audio data to audio device */        write (sd, buffer, buffer_size);        /* Optionally use the select processing */#ifdef USE_SELECT         /* Pend until write complete */        FD_ZERO (&writeFD);        FD_SET (sd, &writeFD);        select (FD_SETSIZE, NULL, &writeFD, NULL, NULL);#endif /* USE_SELECT */        /* Update remaining size of audio data */        size -= buffer_size;        }    /* Close the audio file and the audio device */    free (buffer);    close (fd);    close (sd);    close (md);    return (OK);    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品一区二区| 美女视频一区在线观看| 国产欧美一区二区精品忘忧草| 欧美精品123区| 欧美日韩综合色| 91激情在线视频| 91久久国产综合久久| 色哟哟国产精品| 欧美中文字幕一区二区三区亚洲| 大桥未久av一区二区三区中文| 国产精一品亚洲二区在线视频| 国内精品免费在线观看| 国产美女娇喘av呻吟久久| 国产在线播放一区二区三区| 国产一区在线观看视频| 国产精品99久久久久久久女警 | 中文字幕制服丝袜成人av| 国产精品久久久久影院色老大| 国产精品欧美一区二区三区| 国产精品电影一区二区| 一区二区三区在线影院| 亚洲成人动漫av| 免费高清成人在线| 国内精品免费**视频| 国产成人av一区| 色菇凉天天综合网| 欧美老年两性高潮| 欧美mv和日韩mv的网站| 久久久久久**毛片大全| 成人欧美一区二区三区黑人麻豆| 一区二区三区在线不卡| 日韩精品色哟哟| 国产不卡在线视频| 99精品一区二区| 制服丝袜一区二区三区| 久久久五月婷婷| 亚洲精品视频一区二区| 日韩有码一区二区三区| 国产一区二区网址| 91在线精品秘密一区二区| 欧美性猛交xxxx乱大交退制版 | 亚洲电影激情视频网站| 日韩av一级电影| 成人午夜在线免费| 欧美视频一区在线| 精品国产一区二区三区久久久蜜月 | 欧美性猛交xxxx乱大交退制版 | 中文字幕不卡的av| 亚洲综合精品自拍| 国产一区二区三区四区五区入口 | 欧美一级专区免费大片| 国产精品女主播av| 日韩成人精品在线观看| 99免费精品视频| 宅男在线国产精品| 日韩毛片高清在线播放| 麻豆91免费观看| 欧洲一区在线观看| 国产三级欧美三级| 婷婷开心激情综合| 粉嫩av一区二区三区在线播放 | 亚洲精品乱码久久久久久| 久久国产夜色精品鲁鲁99| 91原创在线视频| 久久久久久久久岛国免费| 午夜私人影院久久久久| 成人av电影在线播放| 欧美一级理论片| 一区二区三区不卡在线观看| 东方欧美亚洲色图在线| 欧美一区二区女人| 亚洲伊人色欲综合网| 成人国产免费视频| 日韩精品一区二区三区视频播放 | 韩国精品主播一区二区在线观看| 在线观看av一区| 亚洲色大成网站www久久九九| 狠狠色伊人亚洲综合成人| 欧美日韩国产天堂| 亚洲精品国产精华液| 粉嫩高潮美女一区二区三区| wwww国产精品欧美| 视频一区免费在线观看| 日本福利一区二区| 亚洲欧美怡红院| 成人小视频在线观看| www日韩大片| 极品美女销魂一区二区三区| 欧美一区日韩一区| 婷婷开心激情综合| 欧美日韩黄色一区二区| 亚洲精品免费看| 一本色道综合亚洲| 亚洲欧美另类小说| 91农村精品一区二区在线| 亚洲欧洲精品一区二区精品久久久| 国产精品99久| 国产色产综合产在线视频| 国产美女久久久久| 精品成人一区二区三区| 狂野欧美性猛交blacked| 欧美喷潮久久久xxxxx| 午夜精品爽啪视频| 91精品国产综合久久小美女| 亚洲va韩国va欧美va| 欧美裸体bbwbbwbbw| 日韩av一二三| 亚洲精品在线免费播放| 国产呦萝稀缺另类资源| 久久久噜噜噜久久中文字幕色伊伊 | 亚洲欧洲韩国日本视频 | 国产人成亚洲第一网站在线播放 | 国产人久久人人人人爽| 豆国产96在线|亚洲| 中文字幕av一区 二区| 成人国产一区二区三区精品| 中文字幕日韩一区| 91麻豆精品在线观看| 一区二区激情小说| 欧美日韩国产综合视频在线观看| 婷婷久久综合九色国产成人| 日韩视频免费观看高清完整版| 激情另类小说区图片区视频区| 久久久精品免费免费| 成人av网站免费| 亚洲精品中文字幕乱码三区| 欧美色网一区二区| 青青草国产精品97视觉盛宴| 精品嫩草影院久久| 国产精品亚洲第一区在线暖暖韩国 | 国产精品情趣视频| 日本韩国欧美国产| 免费在线观看日韩欧美| 国产三级一区二区| 色狠狠一区二区| 美美哒免费高清在线观看视频一区二区| 日韩免费视频一区二区| 国产成人亚洲综合a∨婷婷| 日韩伦理av电影| 欧美精品乱码久久久久久按摩| 精品影院一区二区久久久| 国产精品久久久久久久蜜臀| 色女孩综合影院| 久久精品免费看| 国产精品久久久一本精品| 欧美天天综合网| 韩国av一区二区三区四区| 亚洲欧美偷拍卡通变态| 日韩欧美一区电影| 99riav久久精品riav| 天天色综合天天| 国产精品美女视频| 欧美喷潮久久久xxxxx| 国产成人av网站| 午夜久久久影院| 中文av一区特黄| 欧美一卡在线观看| 97aⅴ精品视频一二三区| 青青草精品视频| 一区二区三区中文字幕电影| 久久人人超碰精品| 91电影在线观看| 成人午夜大片免费观看| 舔着乳尖日韩一区| 国产精品成人网| 久久久久久久久伊人| 欧美日韩精品综合在线| 国产福利一区二区三区在线视频| 亚洲国产日日夜夜| 欧美经典三级视频一区二区三区| 欧美人狂配大交3d怪物一区| 93久久精品日日躁夜夜躁欧美| 久久成人av少妇免费| 亚洲一二三专区| 综合自拍亚洲综合图不卡区| 久久综合丝袜日本网| 69堂亚洲精品首页| 色婷婷av一区二区三区软件 | 欧美在线高清视频| 国产不卡免费视频| 蜜臀久久久久久久| 夜色激情一区二区| 中文字幕一区二区在线播放| 久久影音资源网| 欧美一区二区三区系列电影| 在线免费观看视频一区| 9l国产精品久久久久麻豆| 精品在线免费观看| 男男视频亚洲欧美| 婷婷国产v国产偷v亚洲高清| 一区二区三区日韩精品视频| 国产精品久久久久久户外露出| 久久综合成人精品亚洲另类欧美| 在线播放国产精品二区一二区四区| 99热99精品| 色综合一个色综合| caoporm超碰国产精品| 国产福利91精品| 国产精品一卡二卡在线观看| 久久99久久精品|