Comments (5)
Arg, I though that would do the trick.
Did you try the first option (by only removing the analyser.connect(audioCtx.destination)
instruction) ?
Also, are you completely sure the modified source in the node_modules
are loaded ? There might be some cache involved that could prevent your modifications to be applied. (You could check that by adding a quick console.log
).
If modifications aren't working, you could checkout the Rythm.js repository and link it in your project (I usually use yarn
with the yarn link
).
Could you share a bit more code on how you integrated Rythm.js ?
Ideally, could you share a minimal reproduction of your use case ? (On codesandbox or similar). So that I could try to investigate a bit a more 👍
from rythm.js.
Hello @PromptJar first, many thanks for using Rythm.js 😄
Right now this isn't a feature that i had in my mind and Rythm.js animation is tied to the volume.
I think we might want to add an option around here
Line 43 in 6279915
if(!noOutput) {
Analyser.analyser.connect(this.audioCtx.destination)
}
or
if(!noOutput) {
const muteNode = this.audioCtx.createGain()
muteNode.gain = 0
Analyser.analyser.connect(muteNode)
muteNode.connect(this.audioCtx.destination)
} else {
Analyser.analyser.connect(this.audioCtx.destination)
}
Unfortunatly, either way, it will require to update Rythm.js internal code in order to do that 😢.
I can't say when i'll have the time to do that, if you really want that feature, feel free to create a PR 👍 I'll try to merge it and deploy the new version right away.
from rythm.js.
So I took your snippet above and modified the node_modules source (quick & dirty).
This is the part I changed:
this.connectSource = function (source) {
source.connect(_this.gain);
_this.gain.connect(Analyser$1.analyser);
if (_this.currentInputType !== _this.inputTypeList['STREAM']) {
// Analyser$1.analyser.connect(_this.audioCtx.destination); // COMMENTED OUT
// NEW CODE
const muteNode = _this.audioCtx.createGain()
muteNode.gain = 0
Analyser$1.analyser.connect(muteNode);
muteNode.connect(_this.audioCtx.destination)
_this.audio.addEventListener('ended', _this.stop);
} else {
Analyser$1.analyser.disconnect();
}
};
Unfortunately nothing happens (audio plays with sound), and I'm really bad at audio 😥
Will try a few different things but first I'll check how this all works.
from rythm.js.
Add caching to the list of stuff I'm not good at 😰
The muteNode.gain = 0
part will not work as it throws an error about it being only a getter.
However, just commeting out the first line like you initially said works perfectly.
Thanks for holding my hand here!
from rythm.js.
@PromptJar Glad i did help :) !
Feel free to open a PR to add that option to Rythm.js 🙏 that could help others that may want to use it the same way you are 👍
from rythm.js.
Related Issues (20)
- how to set volume for songs? HOT 2
- any way to catch the audio is finished play? HOT 4
- Does not work in iOS Safari HOT 5
- How to translate .md files into other languages HOT 1
- Integrate a new dance with wiv.js
- Need to add a nice Favicon (animated ?) HOT 2
- Cloudflare link is down HOT 6
- Lots of vulnerabilities HOT 1
- any way to make the audio loop? HOT 2
- multiple instances HOT 5
- Downloading Library HOT 4
- Rythm constructor is not recognized HOT 2
- Uncaught (in promise) DOMException: Failed to load because no supported source was found. HOT 2
- Getting past "AudioContext not allowed to start" issue on Chrome.
- Why are the dances not working besides the font-size?
- API Documentation
- Connect Rythm to an HTML audio source HOT 11
- close
- How to get rhythm data without using class attribute? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rythm.js.