Comments (3)
Well it does this to avoid making the user wait for too long before the audio starts playing. There's no way to do actual HTTP streaming in JavaScript yet so the only way is to make small chunk requests. If you want to change the chunk size, you can set the chunkSize
property of the HTTPSource
object. If you just made a Player
, you can access the source through the asset.source
property, so all together set player.asset.source.chunkSize = whatever
. Eventually, I'd like to make the chunk size change depending on network conditions and the file size of the actual audio file, or just get actual streaming in the browser, but this works for now. Let me know if that doesn't work for you.
from aurora.js.
Years later I am having the same problem. The average file size of a FLAC track is 30 MB. That means 30 requests from a single user. Not only that, but because Internet speeds nowdays are quite high, some network filters my block the user thinking its a denial-of-service attack. Apparently the only chunk needed for starting the playback is the first one. It would be great to just download 1MB and the rest of the file entirely.
from aurora.js.
hi @filerun
I added this lines of code in my project and it works fine.
AV.HTTPSource.DEFAULT_CHUNK_SIZE = 1 << 20;
var old_loop = AV.HTTPSource.prototype.loop;
AV.HTTPSource.prototype.loop = function(){
this.chunkSize += this.chunkSize / 2;
old_loop.apply(this, arguments);
};
In this way chunkSize
is progressively incremented
Hope this helps
Fabio
from aurora.js.
Related Issues (20)
- How do I decode to raw, resample to 44,1khz and split stereo into dual mono buffers?
- "Something is wrong in HTTPSource.loop" while using AV.Asset.fromURL(remoteUrl)
- [Solved]switch backend from Speaker to PortAudio(naudiodon)
- Aurora not playing certain flac files with no error
- Live decoding on Android
- Node example HOT 1
- No default jsDelivr CDN file set
- Problems with 24-bit WAV files
- Questions about memory manage.
- Is decoding a specific part of a gargantuan file supported efficiently? HOT 3
- HTTP requests still sending to server even if HTTP error is returned
- Unit tests fail on master branch
- Chrome browser change for same site cookies
- gyp build fail HOT 1
- build for browser
- m4a demuxer fails when processing a file with co64 atom
- Window Not Defined
- decode fail
- How to install additional codecs? HOT 1
- Uncaught SyntaxError: Unexpected identifier 'key'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurora.js.