SwitcherCAD .wav file I/O

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
One of the more interesting and educational features of SwitcherCAD is .wav file input and output. You can use a standard .wav file ripped from a CD as input to a circuit, then have the circuit output another .wav file. You can use this to try out filters, equalizers, crossovers, generate test signals (that you burn to CD), and etc.

I have attached a schematic of a demo circuit that shows how to use .wav I/O.

This is a simple inverted stereo crossfeed circuit. All you need to do is provide a stereo .wav file named input.wav in the d:\temp directory (or just edit the text on the schematic page to point at any file you want in whatever directory it is in). The output file will be called output.wav- you can edit the name and directory for that as well.

I used a 10MB .wav for input and got a 10 MB .wav for output (duh!). The simulator generates a data file with .raw extension in the same directory as the schematic file (.asc). The .raw file in this case was about 300MB, so be sure you do this on a HDD with lots of space. It takes 1600 seconds to complete the 59 second simulation on my PC. shutting off the "marching waveforms" will reduce that to about 1400 seconds.

The .tran statement sets the time the simulation will run (in real seconds of audio). In this case I have it set for 59 seconds. You can adjust that as required by the length of time you want it to run up to the length (in seconds) of your input file.

Have fun!

I_F
 
I_forgot,

Try using the .save spice directive to reduce the size
of the data in the .raw file. (The big multi-megabit file you mentioned)

For example in your wavetest.asc file, add the
spice directive .save V(LEFT).

This saves only the V(LEFT) data in the .raw file.
This does not effect the saving of the left and right data in the wave file.

I've used the Ltspice wave command to make my own tones
and other sound effects. Then I burn them to a CD and then I can play
them on a hifi.

The most interesting thing I did was make my own burn in CD.
I modified the Lorenz Attractor file I got from the LTspice users
group on Yahoo to create my own chaos sound cd. It might be considered
kind of snake-oil, but it did not cost me anything.

Tom
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.