AudioContext not resolved?

In a javascript file with the following line:


var aContext = new AudioContext();


AudioContext (and anything to do with HTML5's web audio api) is marked as an unresolved type.

The script file works. Libraries attached are WebStorm's native html5/ecmascript and html libraries.

How can I remove this error without setting to ignoring it?

7 comments
Comment actions Permalink

Nevermind...I just found my own answer... found a downloadable webaudioapi library in Preferences.

1
Comment actions Permalink

May i ask where you did find that option? I have the exact same problem and am looking around in the settings for quite a while now and i it's driving me crazy somehow.

0
Comment actions Permalink

I have the same problem here. Would anyone share more details about how to make AudioContext and web audio api resolved by Webstorm?
Now I have to switch to Visual Stuido Code while writing Web Audio API related javascript, sigh...
Thanks,

0
Comment actions Permalink

Hi there,

Please try this:

1. "Settings/Preferences | Languages & Frameworks | JavaScript | Libraries"
2. Click "Download" button
3. Make sure that "TypeScript community stubs" is selected in drop-down box on top
4. In that big list find "webaudioapi" (usual quick search works in that list -- just start typing)
5. "Download and Install"

(very last section) http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/

If anything:

0
Comment actions Permalink

Hi Andriy:
   Thanks for your reply. For some reasons I don't know, I cannot find "webaudioapi" in the big list you mention in step 4. The list stopped on "rest-io"
This is my workaround based your other hints:
1. download https://raw.githubusercontent.com/hraban/DefinitelyTyped/d24e36d975005de6e72c257c9d371a578e1cbdba/webaudioapi/waa.d.ts
    No, the waa.d.ts from master branch is not completed and outdated, I have to search the pull requests to get this version with latest patches.
2. Select Preferences | JavaScript | Libraries and click Add.
3. click "+' , Attach files ---> select waa.d.ts

Hope this help someone else.
BTW, is there anyway to submit a ticket for Webstorm?

0
Comment actions Permalink

Thanks for your reply. For some reasons I don't know, I cannot find "webaudioapi" in the big list you mention in step 4. The list stopped on "rest-io"

If you look at github repository itself ( https://github.com/borisyankov/DefinitelyTyped/ ) you will notice that it also stops at the same package.

You should also notice the warning at the top: "Sorry, we had to truncate this directory to 1,000 files. 270 entries were omitted from the list."

In order to have it working properly you have to use WebStorm v11 EAP / PhpStorm v9.5 EAP where this github limitation is fixed/bypassed.

BTW, is there anyway to submit a ticket for Webstorm?

https://youtrack.jetbrains.com/issues/WEB

If you were thinking about reporting aforementioned issue -- it's fixed and working fine in v11.

0
Comment actions Permalink

Thanks, that worked like a charm!

0

Please sign in to leave a comment.