audiojs / audio-play

Play audio buffer in browser/node
MIT License
60 stars 14 forks source link

Playing files over 100 kb large slows the rate arbitrarily #13

Open linuswillner opened 6 years ago

linuswillner commented 6 years ago

I'm using this package from an Electron application. As the title says, any files that are less than 100 kb in size play fine, but any over that get the playback rate cut in half as far as I can hear. This happens regardless of format.

Is there any reason for this happening, and is there a fix? Not exactly the optimal situation to have.

dy commented 6 years ago

@LWTechGaming could you show the code you use to run player?

linuswillner commented 6 years ago

@dfcreative The main playback logic is in this file, it's mostly based on your documentation. https://github.com/LWTechGaming/LiveSoundBoard/blob/master/src/js/sounds.js

Feel free to poke around if you wish to see anything else you find informative.

linuswillner commented 6 years ago

@dfcreative Had any luck? I've been poking around and haven't been able to find the cause of the issue 🤔

dy commented 6 years ago

@LWTechGaming I added a test, that seems to work fine in browser, run budo test. Is that possible that electron tries to use node version of package? Try require('audio-play/browser')

linuswillner commented 6 years ago

@dfcreative I found an interesting quirk... This issue only applies to MP3 files 👀 tried with MP3 files just now, under and above 100 kb, it sounds horrible. Any idea why? WAV works just fine.