vcsongs
驱动牛犊
驱动牛犊
  • 注册日期2001-06-03
  • 最后登录2003-06-23
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:893回复:0

About sound driver\'s properties ...

楼主#
更多 发布于:2003-03-30 11:02
who can tell me how can i use ioctl syscall to modify /dev/audio or /dev/dsp\'s default properties, such as channal, rate and so on ...

i want to play some raw sound data. such as this:
void Play()
{
    int od, id;
    id = open( \"myrawsounddata\", O_RDONLY );
    od = open( \"/dev/audio\", O_WRONLY );

    ioctl( od, /* i don\'t know how to ... */ );

    char buf[1024];
    int n;
    while((n = read(id, buf, 1024) > 0)
    {
        write(od, buf, n);
    }
    
    close(id);
    close(od);
}

i have read some sound driver\'s source code of kernel. but i cannot understand it ...

thanks!
游客

返回顶部