Expose AudioContext
See original GitHub issueHi,
I’m using Crunker in a small rhythm game prototype; I need the current playback time which you can normally get from AudioContext.prototype.getOutputTimestamp
, but I’m unable to do this since Crunker isn’t exposing the audioContext.
Is it possible to expose this, or against the design philosophy?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Using the Web Audio API - Web APIs - MDN Web Docs
Let's take a look at getting started with the Web Audio API. ... We'll expose the song on the page using an <audio>...
Read more >Expose AudioContext in Worker/ServiceWorker #2383 - GitHub
Describe the feature Expose AudioContext in Worker and ServiceWorker contexts. Is there a prototype? No. Currently users need to use Native ...
Read more >AudioContext
Creates an AnalyserNode , which can be used to expose audio time and frequency data and for example to create data visualisations. AudioContext....
Read more >Web Audio API - W3C
This specification describes a high-level Web API for processing and synthesizing audio in web applications. The primary paradigm is of an audio ...
Read more >AudioContext interface - WebIDLpedia
[Exposed=Window] interface AudioContext : BaseAudioContext { constructor (optional AudioContextOptions contextOptions = {}); readonly attribute double ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe previously it was actually accessible by calling
crunker._context
. After the typescript refactor this may no longer be possible which could be considered a breaking change.I see no reason not to expose the context and many reasons (such as your’s) to expose it to be interfaces with.
I believe this will only make the library more powerful.
If you’d like to create a PR and to add a getter, for example, which returns the context then please go for it and I’ll create an npm release shortly after. Otherwise, if you’re unsure how to do this then I’m happy to help.
Do you want to have a go at extending the functionality first. Please also update the docs with the methods as well.
Hope this helps.
Ok, PR https://github.com/jackedgson/crunker/pull/67