music.mix_with_offset

music.mix_with_offset(first_sonic_vector, second_sonic_vector, duration=0, number_of_samples=0, sample_rate=44100)[source]

Mix two sonic vector by placing the beginning of the second one a specified number of seconds after the first one.

Parameters:
first_sonic_vectornumeric array

A sequence of PCM samples.

second_sonic_vectornumeric array

Another sequence of PCM samples.

durationnumeric

The offset of the second sound, i.e. the displacement that the start of the second sound. (First sound has offset 0). Might be negative, denoting to start sound2 |d| seconds before

s1 ends.
number_of_samplesint
sample_rateint
Parameters:
  • first_sonic_vector (ArrayLike)

  • second_sonic_vector (ArrayLike)

  • duration (float)

  • number_of_samples (int)

  • sample_rate (int)

Return type:

NDArray[float64]

See also

mix2

a better mixer

Notes

If d < 0, it should satisfy -d*fs < s1.shape[-1].

TODO: enhance/recycle J_ and mix2 or delete them. TTM