tone.js

How to enable volume slider of Player tone.js inside of useEffect hook(react)?

自作多情 提交于 2021-01-07 03:13:43
问题 I'm currently trying to adjust the volume of a Player component provided by tone.js. I initiated a new Player and utilized useRef to save a reference of the object in current . the Player contains keys like url, loop, volume etc. Outside of the useEffect I have a few eventhandlers which control the play and stop methods as well as a loop button that toggles the state of loop inside useEffect. They all work. The problem I am facing is that whenever I want to adjust the volume, useEffect is

How to enable volume slider of Player tone.js inside of useEffect hook(react)?

醉酒当歌 提交于 2021-01-07 03:13:25
问题 I'm currently trying to adjust the volume of a Player component provided by tone.js. I initiated a new Player and utilized useRef to save a reference of the object in current . the Player contains keys like url, loop, volume etc. Outside of the useEffect I have a few eventhandlers which control the play and stop methods as well as a loop button that toggles the state of loop inside useEffect. They all work. The problem I am facing is that whenever I want to adjust the volume, useEffect is

How to enable volume slider of Player tone.js inside of useEffect hook(react)?

亡梦爱人 提交于 2021-01-07 03:12:59
问题 I'm currently trying to adjust the volume of a Player component provided by tone.js. I initiated a new Player and utilized useRef to save a reference of the object in current . the Player contains keys like url, loop, volume etc. Outside of the useEffect I have a few eventhandlers which control the play and stop methods as well as a loop button that toggles the state of loop inside useEffect. They all work. The problem I am facing is that whenever I want to adjust the volume, useEffect is

create html <audio> element from Tone.js object

故事扮演 提交于 2020-06-29 03:52:26
问题 I am using Tone.js to modify sounds: audio_url = "/sounds/damncoolbeats.m4a" player = new Tone.Player(audio_url) modified_player = <some Tone.js modifications to player> To play the modified sound I would like to use a web audio element so that I can make use of audio.currentTime and eventlisteners to 'play' 'pause' and 'timeupdate' (which I can't seem to do with Tone.js). The only way I managed to create an audio element so far is by loading from an url: audio = new Audio(audio_url) My

How to connect Web Audio API to Tone.js?

≡放荡痞女 提交于 2019-12-14 03:08:08
问题 I'm doing an Online Audio Player , so I want to integrate Pitch Shifter in my App, which is available on Tone js but not in Web Audio API ... So my idea is to connect Tonejs Pitch Shifter to Web Audio API's audioContext . Is there any possible ways? Here is my code for a reference var audioCtx = new (window.AudioContext || window.webkitAudioContext); var mediaElem = document.querySelector('audio'); var stream = audioCtx.createMediaElementSource(mediaElem); var gainNode = audioCtx.createGain()

using tone.js within angular6

蓝咒 提交于 2019-12-05 18:37:28
I'm trying to import tone.js in angular 6. As mention in tone.js installation doc , I installed tone.js. npm - npm install tone I tried to import Tone in app.module.ts import { ToneJs } from 'tone'; imports: [ ToneJs, ... ] I got this exception: Error: Unexpected value 'undefined' imported by the module 'AppModule' How I can import and use tone.js with angular? Here my angular version ng -v Angular CLI: 6.0.1 Node: 8.11.1 OS: darwin x64 Angular: 6.0.1 Edit: When I try to load it in a component import { Component } from '@angular/core'; import { ToneJs } from 'tone'; @Component({ selector: 'app