<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: miguelairs</title>
    <description>The latest articles on DEV Community by miguelairs (@miguelairs).</description>
    <link>https://dev.to/miguelairs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F651348%2F95dd0d96-8340-44df-89ea-e30c93500e35.png</url>
      <title>DEV Community: miguelairs</title>
      <link>https://dev.to/miguelairs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miguelairs"/>
    <language>en</language>
    <item>
      <title>How do I select one audio channel from a multichannel array in librosa?</title>
      <dc:creator>miguelairs</dc:creator>
      <pubDate>Thu, 17 Jun 2021 20:21:03 +0000</pubDate>
      <link>https://dev.to/miguelairs/how-do-i-select-one-audio-channel-from-a-multichannel-array-in-librosa-2ea7</link>
      <guid>https://dev.to/miguelairs/how-do-i-select-one-audio-channel-from-a-multichannel-array-in-librosa-2ea7</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/68025673/how-do-i-select-one-audio-channel-from-a-multichannel-array-in-librosa" rel="noopener noreferrer"&gt;
               How do I select one audio channel from a multichannel array in librosa?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jun 17 '21&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/68025673/how-do-i-select-one-audio-channel-from-a-multichannel-array-in-librosa" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am new to librosa (and python in general) and I am getting started with audio analysis. My starting wav files contain multichannel arrays. I am wondering if I can use librosa to choose a single, specific channel. As of now, I convert my files to mono as shown here:&lt;/p&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/68025673/how-do-i-select-one-audio-channel-from-a-multichannel-array-in-librosa" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
Hi all!&lt;br&gt;
I am new to librosa (and python in general) and I am getting started with audio analysis. My starting wav files contain multichannel arrays. I am wondering if I can use librosa to choose a single, specific channel. As of now, I convert my files to mono as shown here:&lt;br&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import librosa

y, sr = librosa.load(file, sr=None, mono=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, I suspect that mono=True averages the channels instead of selecting individually. Please correct me if I am wrong! I know that SciPy allows individual channel selection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from scipy.io import wavfile

sample_rate, data = wavfile.read(file)
#[:,1] slices the channel array
spectrum, freqs, t, im = plt.specgram(data[:,1], Fs=sample_rate))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How can I slice and select an individual channel like that in librosa?&lt;/p&gt;

&lt;p&gt;Many thanks! Much help is greatly appreciated!&lt;/p&gt;

</description>
      <category>librosa</category>
      <category>python</category>
      <category>scipy</category>
    </item>
  </channel>
</rss>
