question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose AudioContext

See original GitHub issue

Hi,

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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jaggadcommented, Jan 23, 2022

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.

0reactions
lmiller1990commented, Jan 27, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found