你好。我的板是mini2440+linux,我在一段程序中这样调用音频设备,但是无法打开,麻烦帮我看看,指教一下,谢谢啦。
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <sys/soundcard.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int sockfd;
int count = 0;
int flag;
int i;
int audio_id;
if ( (audio_id = open ( "/dev/audio", O_RDWR ) ) < 0 )
{
fprintf (stderr, " Can't open sound device!\n");
exit ( -1 ) ;
}
……
……
就这样,运行的时候一直返回 Can't open sound device