javascript - Play audio of wav file with increasing file size -


i play audio via javascript in following way:

this.audio = new audio(); this.audio.src = "path/to/audio.wav"; this.audio.play(); 

the file audio.wav on server larger time , audio keep playing without interruptions. however, stop playing once reached point of initial file size.

what can make play seamlessly?

i pretty sure depends lot on server configuration.

wave format (in pretty of flavors, including microsoft , riff) has field data size on top of data block. read audio element if preload attribute set blank, auto or metadata

thus, web browser making request such file might request many bytes , close connection. there's nothing in the api description says it'll read until actual end of file met.

one thing comes mind, though, registering on "end" event. then, according this answer, should able start playing again, seeking position you've ended on. server should start streaming data position need. if doesn't work directly, i'd try reinserting audio node preload="metadata" read updated file size.

another, perhaps simpler thing hacking file size absurdly big. luck, might "just work".


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -