阅读:894回复:0
About sound driver\'s properties ...
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! |
|