From d0a273724b2bb2ad775d0461fe8ee5de1e6bad2f Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 19 Apr 2021 19:23:35 +0200 Subject: Add README & License --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..caf4f3e --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# cswave + +`cswave` is a small, cross-platform utility to convert CSV sample data to WAVE files. This can be used to do further analysis or processing on the +data using audio tooling. + +Any column of the input file can be used as sample data for a resulting monophonic wave file, in one of the supported formats + +* `i8`: 8 bit unsigned integer data +* `i16`: 16bit signed little-endian data +* `i32`: 32bit signed little-endian data +* `f32`: 32bit IEEE float data + +Note that the integer output data formats only use the integer part of the input data, ie. when using the `i32` output format, the input sample +value `1.23` is truncated to the output sample value `1`. + +When using the integer output data formats, the exact sample value is preserved (as long as it fits the storage size). For the `f32` format, the +specification requires that the samples be normalized to the range `-1.0` to `1.0`, thus the sample values will not be preserved. + +Quoted text embedding the separation character `,` within CSV columns will confuse the CSV parser. Don't do that. + +## Building + +To build `cswave`, running `make` within the project directory on a machine with a working C compiler should work. + +To build the windows executable `cswave.exe`, the `mingw-w64` crosscompiler is required. Use `make cswave.exe` to build it. + +## Usage + +Call the tool using the invocation + +``` +./cswave [] +``` + +* ``: CSV input file +* ``: Output file, will be overwritten without question if it already exists +* ``: Zero-based column index within the CSV (e.g., `0`) +* ``: Integer sample rate of the resulting output file (e.g., `44100`) +* ``: Output file sample format as listed above, default `i16` -- cgit v1.2.3