Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OfflineAudioContext for faster than realtime decompression #9

Open
Doidel opened this issue Jan 31, 2014 · 3 comments
Open

OfflineAudioContext for faster than realtime decompression #9

Doidel opened this issue Jan 31, 2014 · 3 comments

Comments

@Doidel
Copy link

Doidel commented Jan 31, 2014

Hai

May I suggest using OfflineAudioContext for the loading and decoding since it can decode (potentially) faster than realtime. Otherwise, if I have a sound with the length of 1.5 minutes i have to wait 1.5 minutes for it to be decoded.

e.g. what I use is

var AudioContext = window.AudioContext || window.webkitAudioContext;
var OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext;
this._context = new AudioContext();
this._loaderContext = new OfflineAudioContext(2, 1024, 44100); //22050 to 96000, CD = 44100

While I just use the offlineContext instead of the normal context for decoding.
I wouldn't hardcode the constructor values though since especially the first (and maybe the last parameter) might want to be set by some people.

Thanks for all, cu
Doidel

@jeromeetienne
Copy link
Owner

@Doidel thanks for report in github :)

what is offlineAudioContext ? what is the difference with AudioContext ?

@Doidel
Copy link
Author

Doidel commented Jan 31, 2014

If you use the normal audiocontext for decoding e.g. an mp3 file then it takes just as long as the mp3 file lasts. So if your mp3 file's duration is 1.5 minutes then your decompression (or analyzation, etc.) takes 1.5 minutes, which is unbearable.
See W3C specs: https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OfflineAudioContext-section

@jeromeetienne
Copy link
Owner

A pull request maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants