/Edit: removed irrelevant text.
It should be straigth forward to replace the opening of the wave file with opening the stdin instead. Modify opening of wav file in src\test\tomp3.cpp to something like:
/*
* open the input wave file
*/
if (strcmp(filename, "-") == 0) {
handle = fileno(stdin);
setmode(handle, O_BINARY);
} else
handle = open ( filename, O_RDONLY | O_BINARY );
if ( handle < 0 )
{
printf ( "\n CANNOT_OPEN_INPUT_FILE" );
goto abort;
}
And similarly for the output file:
/*
* create the MPEG output file
*/
if (strcmp(fileout, "-") == 0) {
handout = fileno(stdout);
setmode(handout, O_BINARY /* | .... ? */);
} else
handout =
open ( fileout, O_RDWR | O_BINARY | O_CREAT | O_TRUNC,
S_IREAD | S_IWRITE );
if ( handout < 0 )
{
printf ( "\n CANNOT CREATE OUTPUT FILE" );
goto abort;
}
Add: You must also modify the CL processing:
/****** process command line args */
for ( k = 0, i = 1; i < argc; i++ )
{
if ( argv[i][0] != '-' || argv[i][1] == '\0' ) // <-- add this
{
if ( k == 0 )
filename = argv[i];
if ( k == 1 )
fileout = argv[i];
k++;
continue;
}