linux ²¥·ÅÉùÒôÎļþ³ÌÐò´úÂë
ÉùÒôÎļþ±ØÐëΪWave PCM unsigned 8bits mono¸ñʽ
/* the *.wav must be 8000Hz 64kbps 8bits MONO(1)*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h> /*for OSS style sound programing */
#define BUFF_SIZE 512 /*buffer size:512 Bytes */
#define FMT8BITS AFMT_U8 /*unsigned 8 bits(for almost PC) */
#define FMT16BITS AFMT_S16_LE /*signed 16 bits,little endian */
#define FMT8K 8000 /*default sampling rate */
#define FMT11K 11025 /*11,22,44,48 are three pop rate */
#define FMT22K 22050
#define FMT44K 44100
#define FMT48K 48000
#define MONO 1
#define STEREO 2
int main(int argc, char *argv[])
{
if(argc!=2)
printf("input error! ./playvoice filename");
int fd; //for device
fd=open("/dev/dsp",O_WRONLY);
if (fd<0){
perror("Can't open /dev/dsp");
return -1;
}
int outfile;
outfile=open(argv[1],O_RDONLY);
if (outfile<0) {
perror("Cannot open file for writing");
return -1;
}
/* set bit format */
int bits = FMT16BITS;
if (ioctl(fd, SNDCTL_DSP_SETFMT, &bits) == -1) {
fprintf(stderr, "Set fmt to bit %d failed:%s\n", bits,
strerror(errno));
return (-1);
}
if (bits != FMT16BITS) {
fprintf(stderr, "do not support bit %d, supported 8¡¢16\n", bits);
return (-1);
}
/*set channel */
int channel = MONO;
if ((ioctl(fd, SNDCTL_DSP_CHANNELS, &channel)) == -1) {
fprintf(stderr, "Set Au
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÎÞÂÛÊÇVC»¹ÊÇVB£¬»¹ÊÇC#£¬»¹ÊÇJSP PHPµÈµÈÓïÑÔ£¬ÔÚѧϰËûÃÇ֮ǰ×ÜÊÇÏÈÀ´Ò»¸öHELLO
WORLDµÄÀý×Ó£¬Õâ¸öºÃÏñ³ÉÁËÎÒÃdzÌÐòÈëÃŵıؾ֮·¡£ËùÒÔÔÚÇý¶¯³ÌÐòµÄѧϰÉÏ£¬Ò²Àë²»¿ªÕâ¸ö²½Öè¡£µ«ÊÇÇý¶¯³ÌÐòµÄ¿ª·¢ÊÇÔËÐÐÔÚÄں˿ռäµÄ£¬¶øÓ¦ÓóÌÐò
ÊÇÔËÐÐÔÚÓû§¿Õ¼äµÄ£¬ËùÒÔÇý¶¯³ÌÐòµÄ¿ª·¢ºÐµ÷ÊÔºÍÓ¦ÓóÌÐòµÄ¿ª·¢¶¼ÓкܴóµÄÇø±ð¡£¶ÔÓÚÕ ......
When Linux Runs Out of Memory
http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html?page=1
Perhaps you rarely face it, but once you do, you surely know what's
wrong: lack of free memory, or Out of Memory (OOM). The results are
typical: you can no longer allocate more memory ......
Å£½ò×ÖµäÖжÔ"kernel"Ò»´ÊµÄ¶¨ÒåÊÇ£º"½ÏÈíµÄ¡¢Í¨³£ÊÇÒ»¸ö¼á¹û¿ÉʳÓõIJ¿·Ö¡£"µ±È»»¹ÓеڶþÖÖ¶¨Ò壺"ij¸ö¶«Î÷ºËÐÄ»òÕß×îÖØÒªµÄ²¿·Ö¡£"¶ÔLinuxÀ´Ëµ£¬ËüµÄKernelÎÞÒÉÊôÓÚµÚ¶þÖÖ½âÊÍ¡£ÈÃÎÒÃÇÀ´¿´¿´Õâ¸öÖØÒªµÄ¶«Î÷ÊÇÈçºÎ¹¤×÷µÄ£¬ÏÈ´ÓÒ»µãÀíÂÛ˵Æð¡£
¹ãÒ嵨À´Ëµkernel¾ÍÊÇÒ»¸öÈí¼þ£¬ËüÔÚÓ²¼þºÍÔËÐ ......