Try it this way:
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/local/bin/lame"];
[task setArguments: [NSArray arrayWithObjects:
@"--preset",
@"extreme",
@"/Users/xanadu62/Music/test.wav",
@"/Users/xanadu62/Desktop/test.mp3",
nil]
];
[task launch];
You don't need to use pipes.
usage: lame [options] <infile> [outfile]
<infile> and/or <outfile> can be "-", which means stdin/stdout.