SofaCas is a Windows command line tool designed to record/play .CAS files to/from an audio device or .WAV file. Please report any bug or suggestion on this thread.
It's using Goertzel signal processing, which makes the tool less sensitive to volume level, phase inversion or signal shift.
It gives pretty good results from my first tests, but please do not use it as a "preservation tool" right now, it still needs to be tested.
Another interesting feature is the ability to control the playback start/stop by connecting the MSX "REM" plug to a PC COM port (and I need to add schematics for this in the documentation...).
Windows executable and sources are available here. Code is quite generic except for the sound-acquisition/playback part and should be easy to port to other platforms.
Here's the command line usage:
SofaCas version 1.0, coded by Louthrax in April 2016
====================================================
sofacas play <cas_file> [options]
Plays an MSX .CAS or .ROM file to an audio output device or .WAV file
[options] can be one or more of:
-a<i> Specify audio output device (0). Use -l to list
-b<f> Audio output device buffer length in seconds (0.20)
-c<port> Use COM port <port> to read REM signal (e.g. COM1)
-f<i> Frequency in hertzes (44100Hz)
-g<f> Start position in .CAS file in bytes (0)
-h<f> Short header duration in seconds (6.67s)
-H<f> Long header duration in seconds (1.67s)
-k Wait for [Return] key instead of long silence
-l List available audio output devices and exit
-o<file> Output to .WAV file <file> instead of audio output device
-p Add prefix loader to always load with RUN"CAS:
-r<i> Target baud rate in bauds (2450Bd)
-s<f> Short silence duration in seconds (2.00s)
-S<f> Long silence duration in seconds (1.00s)
-v<f> Volume amplification (1.00)
-w<i> Waveform (Square)
0: Square
1: Sine
2: Sawtooth
-y Do not ask before overwriting file
<i> is an integer number
<f> is a floating point number
<cas_file> is a source MSX .CAS or .ROM file
Command line options can also be specifed in a "sofacas_play.ini" file
sofacas rec <cas_file> [options]
Records an MSX .CAS file from an audio output device or .WAV file
[options] can be one or more of:
-a<i> Specify audio input device (0). Use -l to list
-b<f> Audio input device buffer length in seconds (0.20s)
-f<i> Frequency in hertzes (44100Hz)
-h<f> Header detection block length in seconds (0.10s)
-H<f> Header detection length in seconds (0.75s)
-i<file> Use .WAV file <file> as input instead of audio input device
-l List available audio input devices and exit
-m<f> Minimal baud rate in bauds (500.00Bd)
-M<f> Maximal baud rate in bauds (4000.00Bd)
-p<f> Phase-adjust coefficient (0.25)
-q<f> Header quality (50.00)
-r<f> Header scan resolution (11.00)
-s<f> Silence ratio (0.10)
-v<f> Volume amplification (1.00)
-w<f> Header scan ratio (0.75)
-y Do not ask before overwriting file
<i> is an integer number
<f> is a floating point number
<cas_file> is a target MSX .CAS file
Command line options can also be specifed in a "sofacas_rec.ini" file
And a little snapshot of the thing in action:


