Skip to content

Commit

Permalink
fix issue where dragging books with keyboard interaction was causing …
Browse files Browse the repository at this point in the history
…infinite output levels, see #148
  • Loading branch information
jbphet committed Dec 5, 2018
1 parent 424ca9b commit 95dcb99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/friction/view/BookRubSoundGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ define( function( require ) {
if ( contact && Math.abs( topBookXVelocity ) > 0 && !rubSoundLockedOut ) {

// set the output level based on the velocity of the book
let noiseAmplitude = options.maxOutputLevel * Math.pow( Math.abs( topBookXVelocity ), 0.25 );
let noiseAmplitude = options.maxOutputLevel * Math.min( Math.pow( Math.abs( topBookXVelocity ), 0.25 ), 1 );
this.setOutputLevel( noiseAmplitude, 0.05 );
}
else {
Expand Down
2 changes: 1 addition & 1 deletion js/friction/view/FrictionScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ define( function( require ) {
// @private {BookRubSoundGenerator} - sound generator for when the books rub together
// TODO: Ashton - review and modify level if needed
this.bookRubSoundGenerator = new BookRubSoundGenerator( model.topBookPositionProperty, model.contactProperty, {
maxOutputLevel: 0.2
maxOutputLevel: 0.5
} );
soundManager.addSoundGenerator( this.bookRubSoundGenerator );

Expand Down

0 comments on commit 95dcb99

Please sign in to comment.