gcc using Pipes Done!

2011-07-18 Thread Martin McCormick
lee writes: > And leftchannel_pipe is supposed to be an array? Without seeing more of > your program, we're left in the dark ... Now that I got it working, here it is. All this does is to give you an 8-bit 8000 sample per second audio feed from both the left and right channels of the soun

Re: gcc using Pipes Some Progress

2011-07-15 Thread lee
Martin McCormick writes: > Ivan Jager writes: > if( write(leftchannel_pipe[1], &leftbyte, 1) < 0) > if ((leftchannel_pipe[0] = fdopen(leftdata,"r")) == NULL) { And leftchannel_pipe is supposed to be an array? Without seeing more of your program, we're left in the dark ... --

gcc using Pipes Some Progress

2011-07-15 Thread Martin McCormick
Ivan Jager writes: > Rather than using fwrite() you could just use write(), which takes a > file descriptor. Alternately, if you really want to use fwrite or > other stdio functions rather than the *nix syscalls, you could > use fdopen() to get a FILE* corresponding to the pipe's fd. > > If you ch

Re: gcc using Pipes

2011-07-14 Thread Ivan Jager
On Thu, Jul 14, 2011 at 06:30:21AM -0500, Martin McCormick scribbled: > #After the step, we should have two file descriptors. > (gdb) output leftchannel_pipe > {7, 8} [...] > #that also looks right, but let's try to write to leftchannel_pipe. > main () at 2pipes.c:98 > 98 fwrite(&leftbyte,size

gcc using Pipes

2011-07-14 Thread Martin McCormick
I want to send two output streams from a code module I wrote to two pipes so that other programs can read the streams. The rest of the module works but I am doing something wrong when writing to a pipe. The way I understand pipes, you write to one end. A small buffer fills and th