home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / dsp / 2599 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  1.5 KB

  1. Xref: sparky comp.dsp:2599 comp.multimedia:3445 comp.speech:275
  2. Newsgroups: comp.dsp,comp.multimedia,comp.speech
  3. Path: sparky!uunet!cs.utexas.edu!uwm.edu!src.honeywell.com!The-Star.honeywell.com!umn.edu!peca!dfrankow
  4. From: dfrankow@peca.cs.umn.edu (Dan Frankowski)
  5. Subject: Sun audio device buffering
  6. Message-ID: <dfrankow.722200575@peca>
  7. Summary: How do you read small chunks from the Sun audio device?
  8. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  9. Nntp-Posting-Host: peca.cs.umn.edu
  10. Organization: University of Minnesota
  11. Date: Thu, 19 Nov 1992 19:16:15 GMT
  12. Lines: 25
  13.  
  14. Sorry to waste bandwidth, but I don't know the proper place to post
  15. this question.
  16.  
  17. We are using the Sun audio device by opening it (sometimes blocking,
  18. sometimes nonblocking-- it's irrelevant for the question).  We use a
  19. read call:
  20.  
  21. count = read(record_fd, sound_bytes_ptr, sound_bytes_left);
  22.  
  23. where record_fd is the file descriptor of the sound device opened
  24. for recording, sound_bytes_ptr is a pointer to the 0th element of
  25. an array of chars, and sound_bytes_left is usually 800.
  26.  
  27. The very first call seems to return a small number of bytes (5 or 6).
  28. After that, it always returns data in multiples of 1K.  I read the
  29. audio man pages, looked in Sun documentation, tried fstat(), and I
  30. just cannot seem to find why the device returns chunks in multiples of
  31. 1K.  It is important to us to be able to get smaller chunks.  Does
  32. anyone know how to do this?
  33.  
  34. Thanks for your time.
  35.  
  36. Dan
  37. --
  38. Dan Frankowski                dfrankow@cs.umn.edu
  39.