Skip to content

Commit

Permalink
added sound for balloon hitting sweater, see #484
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Feb 22, 2021
1 parent 364d974 commit eab8567
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/balloons-and-static-electricity/view/BalloonNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import soundManager from '../../../../tambo/js/soundManager.js';
import Utterance from '../../../../utterance-queue/js/Utterance.js';
import grabBalloonSound from '../../../sounds/balloon-grab-004_mp3.js';
import releaseBalloonSound from '../../../sounds/balloon-release-004_mp3.js';
import balloonHitsSweaterSound from '../../../sounds/balloon-hit-sweater_mp3.js';
import balloonsAndStaticElectricity from '../../balloonsAndStaticElectricity.js';
import BASEA11yStrings from '../BASEA11yStrings.js';
import BASEQueryParameters from '../BASEQueryParameters.js';
Expand Down Expand Up @@ -219,6 +220,17 @@ class BalloonNode extends Node {
new BalloonRubbingSoundGenerator( model.dragVelocityProperty, model.onSweaterProperty, model.touchingWallProperty )
);

// sound generation for when the balloon contacts the sweater
const balloonHitsSweaterSoundClip = new SoundClip( balloonHitsSweaterSound, {
initialOutputLevel: 0.1
} );
soundManager.addSoundGenerator( balloonHitsSweaterSoundClip );
model.onSweaterProperty.link( onSweater => {
if ( onSweater && !model.isDraggedProperty.value ) {
balloonHitsSweaterSoundClip.play();
}
} );

// pdom
balloonImageNode.focusHighlight = new FocusHighlightFromNode( balloonImageNode );

Expand Down
Binary file added sounds/balloon-hit-sweater.mp3
Binary file not shown.
21 changes: 21 additions & 0 deletions sounds/balloon-hit-sweater_mp3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sounds/license.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"license": "contact [email protected]",
"notes": "created by Ashton Morris (PhET Interactive Simulations)"
},
"balloon-hit-sweater.mp3": {
"text": [
"Copyright 2002-2020 University of Colorado Boulder"
],
"projectURL": "http://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Ashton Morris (PhET Interactive Simulations)"
},
"balloon-release-004.mp3": {
"text": [
"Copyright 2002-2020 University of Colorado Boulder"
Expand Down

0 comments on commit eab8567

Please sign in to comment.