## 7.2.3 How to use

wios  accepts three types of options: mode (Record, Playback and Synchronized playback and recording), device (ALSA and RASP), and general, which can be freely combined. You can run wios  with no options to see the complete help.

For example, if you want to record 2 seconds from an ALSA device plughw:1,0 at a sampling rate 44.1kHz and store it into voice.wav, the command is:

wios -r -x 0 -a plughw:1,0 -f 44100 -t 2 -o voice.wav


If you want to playback to an RASP device 192.168.33.24 and store it into tsp.wav, the command is:

wios -p -x 1 -a 192.168.33.24 -i tsp.wav


When playing tsp.wav with RASP device 192.168.33.24 and saving it to rec.wav (Synchronized recording and playback), it is as follows. In this case, -a option is the same device, it can be omitted.

wios -s -x 1 -d 192.168.33.24 -i tsp.wav -o rec.wav


When playing the tsp.wav using the ALSA device plughw:1,0 and saving it to the rec.wav using the ALSA device plughw:2,0 (Synchronized recording and playback) is as follows. In this case, -d and -a is another device and can not be omitted.

wios -s -x 0 -d plughw:1,0 -a plughw:2,0 -i tsp.wav -o rec.wav


When playing the tsp.wav using the RASP device 192.168.33.24 and saving it to the rec.wav using the ALSA device plughw:2,0 (Synchronized recording and playback) is as follows. Since the types of playback device and recording device are different, -y and -z are used instead of -x.

wios -s -y 1 -d 192.168.33.24 -z 0 -a plughw:2,0 -i tsp.wav -o rec.wav


See the recipe “Recording multichannel sound” of the HARK cookbook for other examples.

The descriptions of the options for each category are:

### 7.2.3.1 Mode option

The three modes for wios  are.

Record

: The option is -r or --rec. You can specify the wave file name to record name using -o or --ad-file. The default file name is da.wav.

Play

: The option is -p or --play. You can specify the wave file name to play using -i or --da-file. The default file name is ad.wav.

Synchronized playing and recording

: The option is -s or --sync. You can specify the wave file name to play using -i or --da-file and the file to record using -o or --ad-file. wios  will then play the specified file and simultaneously record to another specified file.

### 7.2.3.2 Device options

The device is specified using two options representing the device type and the device name. Use -x or --dev-type to specify the device type. To specify the D/A device and the A/D device separately in the --sync mode, use -y or --da-dev-type (D/A device) and -z or --ad-dev-type (A/D device).

ALSA

: The device type of ALSA is 0. That is, specify -x 0, -y 0 or -z 0. The device name to be used is specified by -d or --da-dev-name option (D/A: when playback) or -a or --ad-dev-name option (A/D: when recording). The default devuce name is plughw:0,0.

RASP

: The device type of RASP is 1. That is, specify -x 1, -y 1 or -z 1. The IP address of the device to be used is specified by -d or --da-dev-name option (D/A: when playback) or -a or --ad-dev-name option (A/D: when recording). The default IP address is 192.168.33.24.

In addition to thees options, you can specify other device dependent options such as gains; see help for wios  for details.

### 7.2.3.3 General options

• -t: Recording/playing duration.

• -e: Quantization bit rate. The default is 16 bits.

• -f: Sampling frequency. The default is 16000 Hz.

• -c: Number of channels. The default is 1ch.