.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plotting/plot_stereo_channels.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plotting_plot_stereo_channels.py: Stereo channels =============== A channel per axis, and the panning methods that act on a stereo signal. .. GENERATED FROM PYTHON SOURCE LINES 7-11 .. code-block:: Python import audio_samples as aus from audio_samples import mpl .. GENERATED FROM PYTHON SOURCE LINES 12-18 .. code-block:: Python audio = aus.generation.stereo_sine_wave(440.0, 0.02, 22050) audio.pan(-0.6) print(f"left {audio.extract_channel(0).peak():.2f}, right {audio.extract_channel(1).peak():.2f}") assert audio.extract_channel(0).peak() > audio.extract_channel(1).peak() fig, axes = mpl.plot_waveform_channels(audio, title="Panned left") .. image-sg:: /gallery/plotting/images/sphx_glr_plot_stereo_channels_001.png :alt: Panned left :srcset: /gallery/plotting/images/sphx_glr_plot_stereo_channels_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none left 1.60, right 0.40 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.097 seconds) .. _sphx_glr_download_gallery_plotting_plot_stereo_channels.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_stereo_channels.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_stereo_channels.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_stereo_channels.zip `