首页 \ 问答 \ mysql 中文版得哪里有下载的?

mysql 中文版得哪里有下载的?

mysql 中文版得哪里有下载的?哪个有中文的能给我发个。QQ:1191366395
更新时间:2022-12-15 18:12

最满意答案

/** 
*test.c 
* 
*注意:这个例子在Ubuntu 12.04.1环境下编译运行成功。 
* 
*/  
#include <stdio.h>  
#include <stdlib.h>  
#include <alsa/asoundlib.h>  

int main(int argc, char *argv[])  
{  
    int i;  
    int ret;  
    int buf[128];  
    unsigned int val;  
    int dir=0;  
    char *buffer;  
    int size;  
    snd_pcm_uframes_t frames;  
    snd_pcm_uframes_t periodsize;  
    snd_pcm_t *playback_handle;//PCM设备句柄pcm.h  
    snd_pcm_hw_params_t *hw_params;//硬件信息和PCM流配置  
    if (argc != 2) {  
        printf("error: alsa_play_test [music name]\n");  
        exit(1);  
    }  
    printf("play song %s by wolf\n", argv[1]);  
    FILE *fp = fopen(argv[1], "rb");  
    if(fp == NULL)  
    return 0;  
    fseek(fp, 100, SEEK_SET);  

    //1. 打开PCM,最后一个参数为0意味着标准配置  
    ret = snd_pcm_open(&playback_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);  
    if (ret < 0) {  
        perror("snd_pcm_open");  
        exit(1);  
    }  

    //2. 分配snd_pcm_hw_params_t结构体  
    ret = snd_pcm_hw_params_malloc(&hw_params);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_malloc");  
        exit(1);  
    }  
    //3. 初始化hw_params  
    ret = snd_pcm_hw_params_any(playback_handle, hw_params);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_any");  
        exit(1);  
    }  
    //4. 初始化访问权限  
    ret = snd_pcm_hw_params_set_access(playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_set_access");  
        exit(1);  
    }  
    //5. 初始化采样格式SND_PCM_FORMAT_U8,8位  
    ret = snd_pcm_hw_params_set_format(playback_handle, hw_params, SND_PCM_FORMAT_U8);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_set_format");  
        exit(1);  
    }  
    //6. 设置采样率,如果硬件不支持我们设置的采样率,将使用最接近的  
    //val = 44100,有些录音采样频率固定为8KHz  


    val = 8000;  
    ret = snd_pcm_hw_params_set_rate_near(playback_handle, hw_params, &val, &dir);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_set_rate_near");  
        exit(1);  
    }  
    //7. 设置通道数量  
    ret = snd_pcm_hw_params_set_channels(playback_handle, hw_params, 2);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params_set_channels");  
        exit(1);  
    }  

    /* Set period size to 32 frames. */  
    frames = 32;  
    periodsize = frames * 2;  
    ret = snd_pcm_hw_params_set_buffer_size_near(playback_handle, hw_params, &periodsize);  
    if (ret < 0)   
    {  
         printf("Unable to set buffer size %li : %s\n", frames * 2, snd_strerror(ret));  

    }  
          periodsize /= 2;  

    ret = snd_pcm_hw_params_set_period_size_near(playback_handle, hw_params, &periodsize, 0);  
    if (ret < 0)   
    {  
        printf("Unable to set period size %li : %s\n", periodsize,  snd_strerror(ret));  
    }  

    //8. 设置hw_params  
    ret = snd_pcm_hw_params(playback_handle, hw_params);  
    if (ret < 0) {  
        perror("snd_pcm_hw_params");  
        exit(1);  
    }  

     /* Use a buffer large enough to hold one period */  
    snd_pcm_hw_params_get_period_size(hw_params, &frames, &dir);  

    size = frames * 2; /* 2 bytes/sample, 2 channels */  
    buffer = (char *) malloc(size);  
    fprintf(stderr,  
            "size = %d\n",  
            size);  

    while (1)   
    {  
        ret = fread(buffer, 1, size, fp);  
        if(ret == 0)   
        {  
              fprintf(stderr, "end of file on input\n");  
              break;  
        }   
        else if (ret != size)   
        {  
        }  
        //9. 写音频数据到PCM设备  
        while(ret = snd_pcm_writei(playback_handle, buffer, frames)<0)  
        {  
            usleep(2000);  
            if (ret == -EPIPE)  
            {  
                  /* EPIPE means underrun */  
                  fprintf(stderr, "underrun occurred\n");  
                  //完成硬件参数设置,使设备准备好  
                  snd_pcm_prepare(playback_handle);  
            }   
            else if (ret < 0)   
            {  
                  fprintf(stderr,  
                      "error from writei: %s\n",  
                      snd_strerror(ret));  
            }    
        }  

    }         
    //10. 关闭PCM设备句柄  
    snd_pcm_close(playback_handle);  

    return 0;  
}  

//注意:编译的时候应该保持“gcc -o test test.c -L. -lasound”的格式,运行的时候应该保持"./test //clip2.wav"这种格式。

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)