code: def apply_mono_filter_to_each_channel(seg, filter_fn):
      n_channels = seg.channels
  
      channel_segs = seg.split_to_mono()
      channel_segs = [
          filter_fn(channel_seg) for channel_seg in channel_segs
      ]
  
      out_data = seg.get_array_of_samples()
      for channel_i, channel_seg in enumerate(channel_segs):
          for sample_i, sample in enumerate(
              channel_seg.get_array_of_samples()
          ):
              index = (sample_i * n_channels) + channel_i
              out_data[index] = sample
  
      return seg._spawn(out_data)
  
file_path: pydub/test/pydub/effects.py
imports: import sys
  import math
  import array
  from .utils import db_to_float, ratio_to_db, register_pydub_effect, make_chunks, audioop, get_min_max_value
  from .silence import split_on_silence
  from .exceptions import TooManyMissingFrames, InvalidDuration
label_desc: Use image node_id 1 for calling a global function with example usage: apply_mono_filter_to_each_channel(seg, filter_fn) and returns: seg