Function Repository Resource:

AudioSeparate

Source Notebook

Divide an audio signal into musical sources (such as vocals, drums and bass) using a neural network model

Contributed by: Hrachya Aslanyan

ResourceFunction["AudioSeparate"][input]

separates the input audio into all available sources.

ResourceFunction["AudioSeparate"][input,source]

separates the input audio and returns only the specified source.

Details and Options

ResourceFunction["AudioSeparate"] requires version 15.0+ of the Wolfram Language.
ResourceFunction["AudioSeparate"] returns an Association of separated Audio objects.
AudioSeparate performs music source separation using a pretrained deep neural network model (Demucs).
The function splits the input audio into overlapping chunks, processes them in batches, and merges the results using weighted overlap-add reconstruction.
By default, all available sources are returned as an association of the form: <|"drums"Audio[],"bass"Audio[],"other"Audio[],"vocals"Audio[]|>
If a single source is specified, the result is a single Audio object.
If a list of sources is specified as AudioSeparate[input, {source1, source2, …}], the result is an Association containing only those sources.
The input audio is automatically resampled and channel-mixed to match the model's expected sample rate and number of channels.
Computation can be performed on CPU or GPU depending on the value of TargetDevice.
ResourceFunction["AudioSeparate"] supports the following options:
"Overlap"0.25fraction of overlap between consecutive chunks. Must be between 0 and 0.5.
BatchSize1number of chunks processed in a single batch. Can be a positive integer or Infinity.
TargetDevice"CPU"device on which the neural network is evaluated. Possible values include "CPU" and "GPU".

Examples

Basic Examples (1) 

Separate instruments in an audio recording:

In[1]:=
ResourceFunction["AudioSeparate"][
ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
     "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-10T08-11-26-103.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
    Appearance -> "Basic"), {2}]]]
Out[1]=
In[2]:=
ResourceFunction["AudioSeparate"][
ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
     "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-12T09-52-08-472.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
    Appearance -> "Basic"), {2}]]]
Out[2]=

Scope (1) 

Extract only the desired sources and create an AudioPlot:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/704f6cb2-efda-47c1-a587-16858ea8f0ca"]
In[4]:=
stems = ResourceFunction["AudioSeparate"][
   Audio@snd, {"drums", "bass", "other"}];
AudioPlot /@ stems
Out[5]=

Options (3) 

Overlap (1) 

Use "Overlap" to control the fraction of overlap between consecutive chunks:

In[6]:=
EchoTiming [ ResourceFunction["AudioSeparate"][ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
      "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-10T08-11-26-103.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
     Appearance -> "Basic"), {2}]], "drums", "Overlap" -> 0.5 ] ]
4.844331`
Out[6]=
In[7]:=
EchoTiming [ ResourceFunction["AudioSeparate"][ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
      "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-10T08-11-26-103.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
     Appearance -> "Basic"), {2}]], "drums", "Overlap" -> 0.1] ]
6.591411`
Out[7]=

BatchSize (1) 

Use BatchSize to specify the number of chunks processed in a single batch:

In[8]:=
EchoTiming[ResourceFunction["AudioSeparate"][ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
      "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-12T09-52-08-472.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
     Appearance -> "Basic"), {2}]], "drums", BatchSize -> 1]]
34.975594`
Out[8]=
In[9]:=
EchoTiming[ResourceFunction["AudioSeparate"][ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
      "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-12T09-52-08-472.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
     Appearance -> "Basic"), {2}]], "drums", BatchSize -> 4]]
32.16486`
Out[9]=

TargetDevice (1) 

Use TargetDevice to set the device on which the neural network is evaluated:

In[10]:=
AudioPlot /@ ResourceFunction["AudioSeparate"][ReleaseHold[
Replace[
HoldComplete[
Audio[
CloudObject[
      "https://www.wolframcloud.com/obj/documentation/Audio/Audio-2026-02-10T08-11-26-103.wav"], "Real32", Appearance -> Automatic, AudioOutputDevice -> Automatic, SampleRate -> 44100, SoundVolume -> 1]], (Appearance -> Blank[]) -> (
     Appearance -> "Basic"), {2}]], TargetDevice -> "GPU"]
Out[10]=

Version History

  • 1.0.0 – 18 February 2026

Related Resources

License Information