Thread View: comp.dsp
2 messages
2 total messages
Started by Dan Frankowski
Thu, 19 Nov 1992 19:16
Sun audio device buffering
Author: Dan Frankowski
Date: Thu, 19 Nov 1992 19:16
Date: Thu, 19 Nov 1992 19:16
25 lines
1492 bytes
1492 bytes
Sorry to waste bandwidth, but I don't know the proper place to post this question. We are using the Sun audio device by opening it (sometimes blocking, sometimes nonblocking-- it's irrelevant for the question). We use a read call: count = read(record_fd, sound_bytes_ptr, sound_bytes_left); where record_fd is the file descriptor of the sound device opened for recording, sound_bytes_ptr is a pointer to the 0th element of an array of chars, and sound_bytes_left is usually 800. The very first call seems to return a small number of bytes (5 or 6). After that, it always returns data in multiples of 1K. I read the audio man pages, looked in Sun documentation, tried fstat(), and I just cannot seem to find why the device returns chunks in multiples of 1K. It is important to us to be able to get smaller chunks. Does anyone know how to do this? Thanks for your time. Dan -- Dan Frankowski dfrankow@cs.umn.edu
Re: Sun audio device buffering
Author: Dan Frankowski
Date: Thu, 19 Nov 1992 23:06
Date: Thu, 19 Nov 1992 23:06
19 lines
1189 bytes
1189 bytes
In <dfrankow.722200575@peca> dfrankow@peca.cs.umn.edu (Dan Frankowski) writes: >Sorry to waste bandwidth, but I don't know the proper place to post >this question. >count = read(record_fd, sound_bytes_ptr, sound_bytes_left); >.. and sound_bytes_left is usually 800. Argh! Typo! s_b_l is usually 8000. This is essentially the call: count = read(fd, buf, 8000); Sometimes it gives less than 8000. No problem, since it only has the sound since I last asked it. The problem is that it only gives me 1024 bytes, or 2048, or 3072, or 4096, etc. It holds anything less than 1K to itself. I want to get all the data, even if it's less than 1K. Dan
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads