-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does animation property work? #4
Comments
Hi! View simple example animation: HTML: <svg id="example10" height="140px" width="800px">
<path style="fill:none; stroke-width: 3; stroke:red" >
<animate
attributeName="d"
dur="2.54s"
repeatCount="indefinite"
calcMode="linear"
values=""
/>
</path>
</svg> Javascript: import { getAudioData, linearPath, polarPath } from 'https://cdn.skypack.dev/waveform-path';
async function AudioPath(file) {
console.log("test");
const audioData = await getAudioData(file);
const example10 = linearPath(audioData,{
samples: 100, type: 'steps', top: 20, animation: true
});
document.querySelector("#example10 path animate").setAttribute('values', example10);
console.log("test2");
}
AudioPath("https://jerosoler.github.io/waveform-path/hello_world.ogg");
If it is a long audio file, it may cause an error, since all the calculations are done by the browser, a problem with the AudioContext API. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I basically take the user audio input file and run this function to generate the new path
the path gets set on the
<path d={currentPath} />
object. Do I have to manually update the path each frame on my side? If so, am I expected the file passed tolinearPath
be a chunk? Just trying to understand how given an full audio file, we can animate showing the waveform for each frameI see the
animation
property we can pass to linearPath but it throws a stack size exceeded exception.The text was updated successfully, but these errors were encountered: