易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux环境下用c语言写的播放wav文件的小程序

#include <unistd.h>
#include <fcntl.h>
#include
<sys/types.h>
#include <sys/ioctl.h>
#include
<stdlib.h>
#include <stdio.h>
#include
<linux/soundcard.h>
/* 下面的三个参数是跟具体文件相关的,文件什么样,就要设置成什么样 */
#define RATE 11025  
#define SIZE 16    
#define CHANNELS
2  // 1表示单声道,2为立体声
/* ................ */
unsigned char
buf[RATE*SIZE/8]; //buf里面正好放一秒钟的音频,下面的计时还要用
int main()
{
    int fd;
    int wavfd; //wav文件的描述符
    int arg;        /* ..ioctl..... */
    int status;   /*
........ */
                /* ...... */
    fd = open("/dev/dsp",
O_RDWR);      
    if (fd < 0) {
        printf("open of /dev/dsp failed");
       
exit(1);
}
    wavfd = open("a.wav",O_RDONLY);
    if (wavfd
< 0) {
        printf("open of wav failed");
        exit(1);
 
}
 
/* .......... */
    arg = SIZE;
    status = ioctl(fd,
SOUND_PCM_WRITE_BITS, &arg);
    if (status == -1)
        
perror("SOUND_PCM_WRITE_BITS ioctl failed");
    if (arg != SIZE)
        
perror("unable to set sample size");
 
/* .......... */
    arg = CHANNELS;
    status = ioctl(fd,
SOUND_PCM_WRITE_CHANNELS, &arg);
    if (status == -1)
 &nb


相关文档:

转载 写得蛮好的linux学习笔记

linux目录架构
/   根目录
/bin    常用的命令 binary file 的目錄
/boot   存放系统启动时必须读取的档案,包括核心 (kernel) 在内
     /boot/grub/menu.lst   GRUB设置
     /boot/vmlinuz   内核
   ......

Linux下DDD的安装

这个DDD安装了一晚上,记录步骤如下:
1.下载lesstif-0.93.40.tar.bz2(ddd-3.3.11.tar.gz 的文档中说这个稳定我就用这个了)从http://www.ibiblio.org/pub/X11/lesstif/srcdist/放到/usr/local下,然后是三部曲:./configure ,make,make install
2.下载ddd-3.3.11.tar.gz 从http://download.chinaunix.net/download/0003 ......

linux目录架构

/       根目录
/bin         常用的命令   binary   file   的目錄
/boot       存放系统启动时必须读取的档案,包括核心   (kernel)   在内
          /boot/grub/menu.lst       GRUB ......

Linux下快速搭建ntp时间同步服务器

一、搭建时间同步服务器
1、编译安装ntp server
wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.4p4.tar.gz
tar zxvf ntp-4.2.4p4.tar.gz
cd ntp-4.2.4p4
./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks
make && make install
注:如以上下载地址无法访问, ......

linux用busybox制作ramdisk的方法


目前的嵌入式开发大多采用linux操作系统,linux操作系统运行的一般方式都是内核(如bzImage)加上根文件系统(rootfs),内核的编译裁剪说的很多,也不麻烦,我这里想说的是使用busybox来制作rootfs的方法,
废话不说那么多,我制作了一个sh脚本程序,可以直接生成我需要的ramdisk,先将脚本贴出来:
#bash/sh
echo "S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号