2

I am using sox for creating synth with 100ms, this is my command:

/usr/bin/sox -V -r 44100 -n -b 64 -c 1 file.wav synth 0.1 sine 200 vol -2.0dB

Now when I create 3 sine wave files and combine all with

/usr/bin/sox file1.wav file2.wav file3.wav final.wav

Then I get gaps between the files. I don't know why. But when i open for example file1.wav then I also see a short gap in front and at the end of the file.

How can I create a sine with exact 100ms without gaps in front and end?

And my 2nd question: is there also a possibility to create e.g. 10 sine wave synths with one command in sox? like sox f1 200 0.1, f2 210 01, f3 220 01, ... first 200hz 10ms, 210hz 10ms, 220hz 10ms

I have tried some different options in sox but always each single sine file looks like that:

WAV GAP

2 Answers 2

2

Try:

/usr/bin/sox -V -r 44100 -n -b 64 -c 1 file.wav synth 0.1 sine 200 vol -2.0dB trim 0 0.1

Or:

/usr/bin/sox -n -r 44100 -b 64 -c 1 final.wav synth 0.1 sine 200 vol -2.0dB : synth 0.1 sine 210 vol -2.0dB : synth 0.1 sine 220 vol -2.0dB
0

I do not see any gaps running your commands here. Are you sure it is not an artifact of your viewer?

How do you want to combine the files? sox has several combination options. From the manual:

  --combine concatenate|merge|mix|mix-power|multiply|sequence
         Select the input file combining method; for some of these, short
         options are available: -m selects `mix', -M selects `merge', and
         -T selects `multiply'.

         See Input File Combining above for a description of the
         different combining methods.

The default is concatenation when using sox and @BenjaminEcker's solution should work. For mixing you might want to go with:

sox -V --combine mix \
  "|sox -r44100 -n -p synth 0.1 sine 200" \
  "|sox -r44100 -n -p synth 0.1 sine 210" \
  "|sox -r44100 -n -p synth 0.1 sine 220" \
  out.wav

Output:

sox INFO formats: assuming input pipe `|sox -r44100 -n -p synth 0.1 sine 220' has file-type `sox'
sox INFO formats: assuming input pipe `|sox -r44100 -n -p synth 0.1 sine 210' has file-type `sox'
sox INFO formats: assuming input pipe `|sox -r44100 -n -p synth 0.1 sine 200' has file-type `sox'

Input File     : '|sox -r44100 -n -p synth 0.1 sine 200' (sox)
Channels       : 1
Sample Rate    : 44100
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Level adjust   : 0.333333 (linear gain)
Comment        : 'Processed by SoX'


Input File     : '|sox -r44100 -n -p synth 0.1 sine 210' (sox)
Channels       : 1
Sample Rate    : 44100
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Level adjust   : 0.333333 (linear gain)
Comment        : 'Processed by SoX'


Input File     : '|sox -r44100 -n -p synth 0.1 sine 220' (sox)
Channels       : 1
Sample Rate    : 44100
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Level adjust   : 0.333333 (linear gain)
Comment        : 'Processed by SoX'

sox INFO sox: Overwriting `out.wav'

Output File    : 'out.wav'
Channels       : 1
Sample Rate    : 44100
Precision      : 32-bit
Sample Encoding: 32-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

sox INFO sox: effects chain: input        44100Hz  1 channels
sox INFO sox: effects chain: output       44100Hz  1 channels

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.