AudioReplace
✖
AudioReplace
replaces the audio signal between t1 and t2 with the new signal new.
Details

- AudioReplace can be used to replace a part of an audio signal with a new signal. Typically, the duration of the whole audio stays unchanged.
- The time t can be any of the following:
-
t time given in seconds Quantity[t,"unit"] time given in "unit" compatible with seconds Quantity[t,"Samples"] time given as number of samples - The fitting method specifies how new replaces the {t1,t2} interval. Possible settings are:
-
"Fill" pad or trim new to duration t2-t1 (default) "Insert" remove audio from t1 to t2 and insert new at t1 "Stretch" replace {t1,t2} with the time-stretched version of new
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (3)Survey of the scope of standard use cases
Basic Uses (2)
Replace different intervals with the same signal:

https://wolfram.com/xid/09by6qbxu-7idghn

https://wolfram.com/xid/09by6qbxu-7cww4r

Insert different signals at different times:

https://wolfram.com/xid/09by6qbxu-1jq2u6

https://wolfram.com/xid/09by6qbxu-xynmpz

Fitting (1)
Use the fitting to control the behavior of the replacement signal:

https://wolfram.com/xid/09by6qbxu-snic3g

https://wolfram.com/xid/09by6qbxu-nuznhq


https://wolfram.com/xid/09by6qbxu-0dkdp2
By default, the replacement audio is trimmed or padded to the specified length:

https://wolfram.com/xid/09by6qbxu-3uyw84

The duration of the input signal stays the same:

https://wolfram.com/xid/09by6qbxu-piwnl4

Use "Insert" to avoid any trimming or padding of the replacement audio:

https://wolfram.com/xid/09by6qbxu-5dpltn

The duration changes if the duration of the replacement is different from the interval:

https://wolfram.com/xid/09by6qbxu-zoa40u

Use "Stretch" to time stretch the replacement audio to the desired duration:

https://wolfram.com/xid/09by6qbxu-x10k9g

The duration of the input signal does not change:

https://wolfram.com/xid/09by6qbxu-jytdnx

Applications (3)Sample problems that can be solved with this function
Replace the quiet parts of a recording with silence:

https://wolfram.com/xid/09by6qbxu-6ylmr9


https://wolfram.com/xid/09by6qbxu-q1ws3h

Replace the selected intervals with silence:

https://wolfram.com/xid/09by6qbxu-2vzcs6


https://wolfram.com/xid/09by6qbxu-472q6f

Replace parts of a recording with a new audio signal:

https://wolfram.com/xid/09by6qbxu-rnu1ej

Find the intervals with a nonzero amplitude and the fundamental frequency in a specified range:

https://wolfram.com/xid/09by6qbxu-2sicoq

Display the resulting intervals:

https://wolfram.com/xid/09by6qbxu-7uvf6p

Prepare the replacement audio:

https://wolfram.com/xid/09by6qbxu-poktw5
Replace the selected intervals with the replacement audio:

https://wolfram.com/xid/09by6qbxu-rmlzdp


https://wolfram.com/xid/09by6qbxu-m7tb2n

Correct the pitch of parts of a recording:

https://wolfram.com/xid/09by6qbxu-qqf7qr

Find the intervals with a nonzero amplitude and the fundamental frequency in a specified range:

https://wolfram.com/xid/09by6qbxu-orcs29


https://wolfram.com/xid/09by6qbxu-fbkk6r

Define the target frequencies:

https://wolfram.com/xid/09by6qbxu-oi96cy
Define the pitch-shifting algorithm:

https://wolfram.com/xid/09by6qbxu-jmfc00

https://wolfram.com/xid/09by6qbxu-tuka6o

https://wolfram.com/xid/09by6qbxu-3mphnf


https://wolfram.com/xid/09by6qbxu-4hslq

Wolfram Research (2017), AudioReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioReplace.html.
Text
Wolfram Research (2017), AudioReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioReplace.html.
Wolfram Research (2017), AudioReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioReplace.html.
CMS
Wolfram Language. 2017. "AudioReplace." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AudioReplace.html.
Wolfram Language. 2017. "AudioReplace." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AudioReplace.html.
APA
Wolfram Language. (2017). AudioReplace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioReplace.html
Wolfram Language. (2017). AudioReplace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioReplace.html
BibTeX
@misc{reference.wolfram_2025_audioreplace, author="Wolfram Research", title="{AudioReplace}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/AudioReplace.html}", note=[Accessed: 26-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_audioreplace, organization={Wolfram Research}, title={AudioReplace}, year={2017}, url={https://reference.wolfram.com/language/ref/AudioReplace.html}, note=[Accessed: 26-March-2025
]}