| 76 | "\n"; |
| 77 | |
| 78 | static void openFiles(WavInFile **inFile, WavOutFile **outFile, const RunParameters *params) |
| 79 | { |
| 80 | int bits, samplerate, channels; |
| 81 | |
| 82 | if (strcmp(params->inFileName, "stdin") == 0) |
| 83 | { |
| 84 | // used 'stdin' as input file |
| 85 | SET_STREAM_TO_BIN_MODE(stdin); |
| 86 | *inFile = new WavInFile(stdin); |
| 87 | } |
| 88 | else |
| 89 | { |
| 90 | // open input file... |
| 91 | *inFile = new WavInFile(params->inFileName); |
| 92 | } |
| 93 | |
| 94 | // ... open output file with same sound parameters |
| 95 | bits = (int)(*inFile)->getNumBits(); |
| 96 | samplerate = (int)(*inFile)->getSampleRate(); |
| 97 | channels = (int)(*inFile)->getNumChannels(); |
| 98 | |
| 99 | if (params->outFileName) |
| 100 | { |
| 101 | if (strcmp(params->outFileName, "stdout") == 0) |
| 102 | { |
| 103 | SET_STREAM_TO_BIN_MODE(stdout); |
| 104 | *outFile = new WavOutFile(stdout, samplerate, bits, channels); |
| 105 | } |
| 106 | else |
| 107 | { |
| 108 | *outFile = new WavOutFile(params->outFileName, samplerate, bits, channels); |
| 109 | } |
| 110 | } |
| 111 | else |
| 112 | { |
| 113 | *outFile = NULL; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | |
| 118 |
no test coverage detected