Greetings.
I am trying to get my audiotool record in linear encoding rather than u-law
which is the default.
Checked the man pages and it tells you to use some ioctls for this job.
I have tried the following code:
if ((ioctl(fd_audio, AUDIO_GETINFO, &auInfo)) == -1) {
perror("ERROR: ioctl AUDIO_GETINFO");
exit(1);
}
printf("encoding = %d\n", auInfo.play.encoding);
auInfo.record.encoding = 3; /* 3 = linear encoding */
if ((ioctl(fd_audio, AUDIO_SETINFO, &auInfo)) == -1) {
perror("ERROR: ioctl AUDIO_SETINFO");
exit(1);
}
if ((ioctl(fd_audio, AUDIO_GETINFO, &auInfo2)) == -1) {
perror("ERROR: ioctl AUDIO_GETINFO");
exit(1);
printf("encoding = %d\n", auInfo2.play.encoding);
where both auInfo and auInfo2 are audio_info_t structs. Both of my printfs result in
printing 1 which is u_law encoding.
Any ideas to get this thing record in linear (8-bit) encoding.
Please reply to:
TIA.
\\|//
(o^o)
+------------------------------oo0--(_)--0oo------------------------------+
| Emory University http://www.mathcs.emory.edu/~cafer |
| Atlanta GA 30322 Phone : (404) 373-3410 |
| USA Fax : (404) 727-5611 |
+-------------------------------------------------------------------------+