title: Electron does not play mp3 audio file using <audio> Html5 tag in Raspberry Pi 3b+
body: <p><strong>Problem:</strong> I made simple electron project on raspberry-pi, It play an audio file but somehow that cannot play.</p>
  <p><strong>My Efforts</strong></p>
  <ol>
  <li>I tried already lots of other audio files.</li>
  <li>Removed node_modules, nodejs and npm from my <em>raspberry-pi 3b+</em> device and reinstall it.</li>
  <li>I tried also some Electron Versions 9.0.0, 9.3.1, 10.0.0.</li>
  <li>I tried to update and upgrade my raspberry pi device.</li>
  <li>I used one simple nodejs file and used a play-sound npm module and play audio file and yes its play but the same code I tried in my electron application did not play.</li>
  <li>I tried also bellow code snippet with using button click.</li>
  <li>I also used AudioContext and AudioBuffer to play sound but again failed.</li>
  </ol>
  <p><strong>Electron Versions :</strong> ^9.0.0, ^9.3.1</p>
  <p><strong>Node JS Version :</strong> 10.19.0</p>
  <p><strong>Electron Versions :</strong> 5.8.0</p>
  <p><strong>Device:</strong> Raspberry Pi 3B+</p>
  <p><strong>My Audio Code</strong></p>
  <pre><code>var audio = new Audio('beep.mp3');
  audio.volume = 1.0;
  setInterval(()=&gt;{
      audio.play();
  },1000);
  </code></pre>
  <p><strong>Simple Node JS File With npm module code</strong></p>
  <pre><code>var player = new require('play-sound')(opts={});
  setInterval(()=&gt;{
      player.play('beep.mp3', function(err){
          console.log('Err :', err);
      });
  },1000);
  </code></pre>
  <p><strong>Description:</strong> Above code is perfect working in simple node js but can not work with electron.</p>
  <p><strong>Electron index.js (main process)</strong></p>
  <pre><code>const { app, BrowserWindow } = require('electron');
  function createWindow () {
    const win = new BrowserWindow({
      width: 800,
      height: 600,
      webPreferences: {
        nodeIntegration: true
      }
    })
    win.loadFile('index.html');
    win.webContents.openDevTools();
  }
  app.whenReady().then(createWindow)
  app.on('window-all-closed', () =&gt; {
    if (process.platform !== 'darwin') {
      app.quit();
    }
  });
  
  app.on('activate', () =&gt; {
    if (BrowserWindow.getAllWindows().length === 0) {
      createWindow();
    }
  });
  </code></pre>
  <p><strong>Electron index.html</strong></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;Audio Play&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;script&gt;
               var audio = new Audio('beep.mp3');
               audio.volume = 1.0;
               setInterval(()=&gt;{
                 audio.play();
               },1000);
        &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p><strong>Conclusion:</strong>
  I think electron does not have permission to play audio file.</p>