[linux-audio-dev] Digital in read

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Digital in read
From: Ralfs Kurmis (kurmisk_AT_inbox.lv)
Date: Fri Jul 04 2003 - 21:02:56 EEST


Hi folks

I have SB sound card and OSS driver
For read sound from line in i use such functions [see below]
How i can read signals from digital in ?
any example/idea welcomed

Tnx in advance

RalfsK

status = read(fdi, adat , sizeof( adat )); /* record some sound */

int fdi; /* sound device file descriptor */
int fdo; /* sound device file descriptor */
int arg; /* argument for ioctl calls */
int status; /* return status of system calls */

/*----*/void open_sound_device_read(void)
/*----*/{
/*----*/
/*----*/ fdi = open("/dev/dsp", O_RDONLY|O_NONBLOCK );
/*----*/ if (fdi < 0) {
/*----*/ perror("open of /dev/dsp failed");
/*----*/ exit(1);
/*----*/ }
/*----*/ //// set sampling parameters
/*----*/ arg = SIZE; //// sample size
/*----*/ status = ioctl(fdi, SOUND_PCM_WRITE_BITS, &arg);
/*----*/ if (status == -1)
/*----*/ perror("SOUND_PCM_WRITE_BITS ioctl failed");
/*----*/ if (arg != SIZE)
/*----*/ perror("unable to set sample size");
/*----*/
/*----*/ arg = CHANNELS; //// mono or stereo
/*----*/ status = ioctl(fdi, SOUND_PCM_WRITE_CHANNELS, &arg);
/*----*/ if (status == -1)
/*----*/ perror("SOUND_PCM_WRITE_CHANNELS ioctl failed");
/*----*/ if (arg != CHANNELS)
/*----*/ perror("unable to set number of channels");
/*----*/
/*----*/ arg = RATE; //// sampling rate
/*----*/ status = ioctl(fdi, SOUND_PCM_WRITE_RATE, &arg);
/*----*/ if (status == -1)
/*----*/ perror("SOUND_PCM_WRITE_WRITE ioctl failed");
/*----*/
/*----*/}

/*----*/void close_sound_device_read(void)
/*----*/{
/*----*/ close(fdi);
/*----*/}

---
This message contains no viruses. 
Guaranteed by Kaspersky Anti-Virus.
www.antivirus.lv


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jul 04 2003 - 21:08:18 EEST