Skip to content
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

Alter playback speed? #19

Open
andymcarter opened this issue Sep 22, 2016 · 9 comments · Fixed by #148
Open

Alter playback speed? #19

andymcarter opened this issue Sep 22, 2016 · 9 comments · Fixed by #148

Comments

@andymcarter
Copy link

andymcarter commented Sep 22, 2016

After a few teething problems due to my lack of experience, now enjoying building some multitracks with this! I teach a Brazilian style of music called choro and you can see the tracks I've built up below.

http://chorotest.hol.es/

Is there a way to implement the webaudio playback speed feature, using a global slider like the master volume control. Then my students could speed up or slow down the track slightly (within reason).

https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/WebAudio_playbackRate_explained

@naomiaro
Copy link
Owner

naomiaro commented Sep 27, 2016

Hey! I'm checking out these site that you posted, but I'm getting some net::ERR_CONTENT_LENGTH_MISMATCH errors so I can't see the tracks loading.

I could try implementing a playback speed feature. There is nothing altering that parameter in the code so far. It will take just a bit of work I think to sync the changed playback rate with the UI, but it should be doable.

@naomiaro
Copy link
Owner

Maybe this was just my network in my coworking space, but it's working fine now from my home these examples.

@Willena
Copy link
Contributor

Willena commented Sep 27, 2016

I could try implementing a playback speed feature. There is nothing altering that parameter in the code so far. It will take just a bit of work I think to sync the changed playback rate with the UI, but it should be doable.

increase or slow down the speed is doable. In the current code as we did ( almost ) to create the master gain, we can modify the source playbackRate parameter . But as shown in this example, the audio is modified. And it might be very dificult to counter this modification.

@andymcarter
Copy link
Author

andymcarter commented Sep 28, 2016

http://hyperaud.io/lab/pbr-test/

The audio implementation at the bottom of the page doesn't change audio pitch.

PS. grateful for the responses :)

@Willena
Copy link
Contributor

Willena commented Sep 30, 2016

Having a look at https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/WebAudio_playbackRate_explained confirm what I was saying before. In Web Audio when you change the playback rate, the pitch also change and there are no automatic corrections. In your example when you are playing audio you are using html audio elements, which correct automaticaly the pitch. This project is build over web audio APIs, so we have to write our own pitch correction functions.

@andymcarter
Copy link
Author

Hadn't appreciated the difference between the two APIs, thanks for explaining.

Willena added a commit to Willena/waveform-playlist that referenced this issue Oct 1, 2016
The pitch is altered for now ...
Willena added a commit to Willena/waveform-playlist that referenced this issue Oct 2, 2016
@Willena Willena mentioned this issue Oct 2, 2016
@PDL-II
Copy link

PDL-II commented Sep 7, 2021

It seems to be very in demand this feature. Sometimes small tweaks like speeding up or down a file and it makes the whole difference. I really hope this feature gets added to this already amazing software! :)

@p-himik
Copy link
Contributor

p-himik commented Apr 27, 2022

Currently, the page linked above, https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/WebAudio_playbackRate_explained, states:

The pitch of the audio track does not change when playBackRate is altered.

And I can confirm this in at least Chrome and Firefox on Ubuntu.

Update: huh, but it doesn't work with AudioBufferSourceNode.playbackRate - the pitch is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants