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

Integrating Pitch Shifting into a Custom HTML5 Video Player with Tone.js #1290

Open
rrehltp opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@rrehltp
Copy link

rrehltp commented Nov 25, 2024

I’m trying to integrate Tone.PitchShift with an HTML <video> element in my project, but the pitch shifting functionality isn’t working as expected. Here’s a summary of my setup and the issue:

Setup:

  • Tone.js Version: v14.7.39
  • Browser: Safari
  • Code Snippet:
constructor() {
    this.player = new CustomPlayer();
}

setupPitchShift = () => {
    this.pitchShift = new Tone.PitchShift().toDestination();
    const mediaSource = Tone.context.createMediaElementSource(
      this.player.container
    );
    Tone.connect(mediaSource, this.pitchShift);
};

Issue:

  • The video plays, but the pitch shifting does not apply to the audio.

Steps to Reproduce:

  1. Initialize a Tone.PitchShift node.
  2. Connect an HTML <video> element as the audio source.
  3. Attempt to modify the pitch using pitchShift.pitch.

Questions:

  1. Is there a specific configuration or connection order required for MediaElementSource and PitchShift?
  2. Are there any known limitations with using PitchShift on <video> elements?

Any guidance would be greatly appreciated.

Best regards

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

No branches or pull requests

1 participant