Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Eric P. Scott
Wed, 15 Apr 1992 01:31
problems reading from SNDIN with sound driver
Author: Eric P. Scott
Date: Wed, 15 Apr 1992 01:31
Date: Wed, 15 Apr 1992 01:31
57 lines
2236 bytes
2236 bytes
Here's one for "Sun vs. NeXT--A World of difference"
I want to read "continuously" from the sound input, and process
data every 1024 bytes. Under SunOS, this would involve
open() /dev/audio
loop read()ing 1024 bytes
Pretty simple, huh? Not on the NeXT! Just the simple act of
reading from the microphone can send the programmer into pages
and pages of complex coding... and it just DOESN'T WORK.
Here's what I'm doing:
SNDAcquire() to obtain device and owner ports
snddriver_stream_setup() to obtain stream port
dataPath = SNDDRIVER_STREAM_FROM_SNDIN
sampleCount = 1024
sampleSize = 1
lowWater = 48*1024
highWater = 64*1024
port_allocate() to obtain reply port
snddriver_stream_start_reading()
sampleCount = 3*8192 /* originally 262143*8192 */
tag = 1
msg* = TRUE
snddriver_stream_control()
control = SNDDRIVER_AWAIT_STREAM
LOOP {
msg_receive()
[print message headers]
snddriver_reply_handler()
}
recorded_data() vm_deallocate()s and issues another SNDDRIVER_AWAIT_STREAM
Here's what happens (or doesn't):
- No matter what, I *never* get "completed" messages
- SNDDRIVER_ABORT_STREAM doesn't generate "aborted" messages if
SNDDRIVER_AWAIT_STREAM has been used--however, after several
subsequent calls to the recorded_data() handler,
snddriver_stream_control() fails with error 108
<nextdev/snd_msgs.h> defines this as SND_SEARCH--couldn't
find requested resource
and no further messages arrive
- SNDDRIVER_PAUSE_STREAM does generate a "pause" message, but
the stream doesn't seem to pause
- changing parameters (e.g. sampleCount) doesn't seem to make
a difference
I've checked the Tech Docs, NeXTanswers, the FAQ, and the
JeanLaroche materials--none were helpful.
Someone (Greg?) please help! (I'm using 2.1, if that matters.)
-=EPS=-
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