小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

wav2pcm

 海漩渦 2016-06-17
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>

#define MAX_LEN 1024*500

#define WAV_HEAD_LEN 44

int main(int argc, char *argv[])
{

    if(3 != argc)
    {
        printf("Please input 3 param\n");
        return -1;
    }

    char input_name[40];
    char output_name[40];

    int input_fd  = -1;
    int output_fd = -1;
    int len = -1;

    char *error_buf = NULL;
    char *buf = NULL;


    //------------------------------------------------------------
    //  初始化一些東西
    buf = (char *)malloc(MAX_LEN);
    if(NULL == buf)
    {
        printf("malloc error\n");
        return -1;
    }

    input_fd  = open(argv[1], O_RDWR);
    if(input_fd < 0)
    {        
        printf("open error\n");
        return -1;
    }
    printf("open [%s] success\n", argv[1]);
        
    
    output_fd = open(argv[2], O_RDWR|O_CREAT);
    if(output_fd < 0)
    {        
        printf("open error\n");
        return -1;
    }
    printf("open [%s] success\n", argv[2]);
    //-----------------------------------------------------------------



    //------------------------------------------------------
    // 轉(zhuǎn)換wav 為 pcm, 實際上只是跳過wav的頭,后面即是pcm數(shù)據(jù)
    lseek(input_fd, WAV_HEAD_LEN, SEEK_SET);
    while((len = read(input_fd, buf, MAX_LEN)) > 0 )
    {
        write(output_fd, buf, len);
    }
    //------------------------------------------------------

    printf("wav2pcm complete\n");

    close(input_fd);
    close(output_fd);
    
    return 0;
}

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多