MCPcopy Create free account
hub / github.com/audacity/audacity / openFiles

Function openFiles

lib-src/soundtouch/source/SoundStretch/main.cpp:78–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 "\n";
77
78static 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

Callers 1

mainFunction · 0.85

Calls 3

getNumBitsMethod · 0.80
getSampleRateMethod · 0.80
getNumChannelsMethod · 0.45

Tested by

no test coverage detected