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

Add ability to start playing a SoundClip in the middle of the recorded sound #150

Open
jessegreenberg opened this issue Sep 27, 2021 · 1 comment

Comments

@jessegreenberg
Copy link
Contributor

In phetsims/quadrilateral#4 it was requested that we start playing a pre-recorded sound in the middle of the recording instead of at the start. For the use case in In phetsims/quadrilateral#4 the sound would loop around and would loop around the offset time that you provide. @Ashton-Morris described it like

I would imagine if possible it would sound something like this in code: Play file as loop - start playhead or playing file at random point of the files duration.

The motivation for this is

Also since the same files will be playing simultaneously it would be best if they started at different start points so they would sound less repetitive.

@jbphet said that this was not yet a supported feature of tambo, but that it could be. He also mentioned a potential challenge:

Starting in the middle of a sound can be problematic, since if the value of the sound data at the specified location is non-zero, it will cause a fast transient, which creates a very audible clicking sound. We'd need to work out whether there should be any built-in detection of nearby zero-crossings or not to proactively address this.

I am not sure if this will end up being necessary for quadrilateral, Ill bring this up with the team during normal meetings 9/28/21 and get a sense of priority.

@Ashton-Morris
Copy link
Contributor

Copy from Slack conversation:

During our meeting today we talked about starting a sound loop at random points and JB brought up that we can first start out by trying the delay function. So maybe when calling the 4 loops from the same source in Quad you can call: 1. immediately, 2. at 100ms delayed, 3. at 200ms delayed, and 4. at 300ms delayed.

Perhaps this would create the auditory illusion that we are not play the same sound file 4 times at once. If it sounds weird we can mess around with the lengths of the start delay

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

2 participants