MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / main

Function main

examples/csv2wav/csv2wav.py:181–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179
180
181def main():
182 parser = argparse.ArgumentParser(description="Convert CSV audio data to WAV")
183 parser.add_argument("csv_file", help="Input CSV file path")
184 parser.add_argument("wav_file", nargs="?", help="Output WAV file path")
185 parser.add_argument(
186 "--rate",
187 type=int,
188 default=None,
189 help=(
190 "Sample rate in Hz. When omitted, it is derived from the "
191 f"'{TIME_HEADER}' column, falling back to {DEFAULT_SAMPLE_RATE}."
192 ),
193 )
194 parser.add_argument(
195 "--in_format",
196 default="float32",
197 choices=INPUT_FORMATS,
198 help="Input sample format of CSV values",
199 )
200 parser.add_argument(
201 "--dither",
202 action="store_true",
203 help="Apply TPDF dither before int16 quantization",
204 )
205
206 args = parser.parse_args()
207 convert_csv_to_wav(
208 args.csv_file,
209 args.wav_file,
210 args.rate,
211 in_format=args.in_format,
212 dither=args.dither,
213 )
214
215
216if __name__ == "__main__":

Callers 1

csv2wav.pyFile · 0.70

Calls 1

convert_csv_to_wavFunction · 0.85

Tested by

no test coverage detected