Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux»·¾³ÏÂÓÃcÓïÑÔдµÄ²¥·ÅwavÎļþµÄС³ÌÐò

±¾³ÌÐò¿ÉÒÔ¶ÁÈ¡.wavÎļþ£¬È»ºó½øÐв¥·Å¡£
È·ÈÏ·½·¨£ºcat /etc/sndstat£¬Èç¹ûÏÔʾÎÞ´ËÉ豸£¬ÔòûÓа²×°Çý¶¯¡£
#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/ioctl.h>#include <stdlib.h>#include <stdio.h>#include <linux/soundcard.h>/* ÏÂÃæµÄÈý¸ö²ÎÊýÊǸú¾ßÌåÎļþÏà¹ØµÄ£¬ÎļþʲôÑù£¬¾ÍÒªÉèÖóÉʲôÑù */
int main(){    int fd;     int wavfd; //wavÎļþµÄÃèÊö·û
    if (fd < 0) {        printf("open of /dev/dsp failed");        exit(1);}    wavfd = open("12193767609.wav",O_RDONLY);    if (wavfd < 0) {        printf("open of wav failed");        exit(1);  } 
/* .......... */    arg = CHANNELS;    status = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &arg);    if (status == -1)        perror("SOUND_PCM_WRITE_CHANNELS ioctl failed");    if (arg != CHANNELS)        perror("unable to set number of channels"); 
    /* ´ÓwavÎļþÖжÁbuf´óСµÄÄÚÈÝ£¬È»ºóдÈë/etc/dspÖУ¬Ö±µ½Îļþ½áÊø */     int time = 0; //¶¯Ì¬ÏÔʾ²¥·Åʱ¼äÓÃ
         /*status = ioctl(fd, SOUND_PCM_SYNC, 0);
        }}±¾³ÌÐòÖÐÐèÒªÒ»¸ö.wavÎļþ²ÅÄܲ¥·Å£¬Äã¿ÉÒÔµ½°Ù¶Èmp3ÉÏÈ¥ËÑË÷Ò»¸ö.wavÎļþ£¬·Åµ½³ÌÐòĿ¼Ï¡£È»ºó£¬°Ñ³ÌÐòÖеÄÎļþÃû¸Ä³É¸ÃÒôƵµÄÎļþÃû¡£


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

CÓïÑԽṹÌåÓë¹²ÓÃÌå

11.1 ¶¨ÒåÒ»¸ö½á¹¹µÄÒ»°ãÐÎʽ
    ÔÚʵ¼ÊÎÊÌâÖУ¬Ò»×éÊý¾ÝÍùÍù¾ßÓв»Í¬µÄÊý¾ÝÀàÐÍ¡£ÀýÈ磬ÔÚѧÉúµÇ¼Ç±íÖУ¬ÐÕÃûӦΪ×Ö·ûÐÍ£»Ñ§ºÅ¿ÉΪÕûÐÍ»ò×Ö·ûÐÍ£»ÄêÁäӦΪÕûÐÍ£»ÐÔ±ðӦΪ×Ö·ûÐÍ£»³É¼¨¿ÉΪÕûÐÍ»òʵÐÍ¡£ ÏÔÈ»²»ÄÜÓÃÒ»¸öÊý×éÀ´´æ·ÅÕâÒ»×éÊý¾Ý¡£ÒòΪÊý×éÖи÷ÔªËصÄÀàÐͺͳ¤¶È¶¼±ØÐëÒ»Ö£¬ÒÔ±ãÓÚ±àÒëϵͳ´¦Àí¡ ......

CÓïÑÔÎļþ

13.1 CÎļþ¸ÅÊö
    Ëùν“Îļþ”ÊÇÖ¸Ò»×éÏà¹ØÊý¾ÝµÄÓÐÐò¼¯ºÏ¡£Õâ¸öÊý¾Ý¼¯ÓÐÒ»¸öÃû³Æ£¬½Ð×öÎļþÃû¡£Êµ¼ÊÉÏÔÚÇ°ÃæµÄ¸÷ÕÂÖÐÎÒÃÇÒѾ­¶à´ÎʹÓÃÁËÎļþ£¬ÀýÈçÔ´³ÌÐòÎļþ¡¢Ä¿±êÎļþ¡¢¿ÉÖ´ÐÐÎļþ¡¢¿âÎļþ (Í·Îļþ)µÈ¡£
    Îļþͨ³£ÊÇפÁôÔÚÍⲿ½éÖÊ(Èç´ÅÅ̵È)Éϵģ¬ÔÚʹÓÃʱ²Åµ÷ÈëÄÚ´æÖ ......

Êý¾Ý½á¹¹ÔÚCÓïÑÔÖеÄÓ¦ÓÃ


     ÎÒÊÇÒ»¸ö¼ÆËã»úרҵµÄ±¾¿ÆÉú£¬ÏÖÔÚÎÒÃǸոÕѧÍêÁËÊý¾Ý½á¹¹¡£¾Ý˵Êý¾Ý½á¹¹¶ÔÓÚÎÒÃDZà³ÌºÜÖØÒª£¬¿ÉÊÇÎÒÏÖÔÚ²»ÖªÔõô°ÑÊý¾Ý½á¹¹ºÍCÓïÑÔ½áºÏÆðÀ´£¬ÒÔ±ã¸üºÃµÄ½øÐÐcÓïÑÔ±à³Ì¡£ÓÐÄÄλ¸ßÊÖÖ¸µãÒ»¶þ£¬ÔÚÏ¸м¤²»¾¡£¡
......

Õ»µÄCʵÏÖ(stack)

rows="2" cols="20" id="ctl00_ctl00_cphContent_cphDoc_EntryEditor1_richTextEditor" class="mceEditor" style="height:450px;width:100%;">
Õ»ÊÇÊý¾Ý½á¹¹ÖÐ×î»ù´¡Ò²ÊÇ×î¾­µäµÄÊý¾Ý½á¹¹£¬ÎÞÂÛÔÚÓ¦Óû¹ÊDzÙ×÷ϵͳÖоù¿ÉÒÔ¿´µ½ÆäÉíÓ°¡£Õ»ÊÇÒ»ÖÖÌØÊâµÄ
ÏßÐÔ±í£¬¼´ÏÞÖÆÔÚ±íµÄÒ»¶Ë½øÐвåÈ롢ɾ³ýÔËË㡣ͨ³£²åÈ롢ɾ³ýµÄÒ»¶Ë³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ