This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ukatama
committed
Sep 10, 2017
1 parent
cc4d96d
commit a518010
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const AudioContext = window.AudioContext || window.webkitAudioContext; | ||
const audioContext = new AudioContext(); | ||
|
||
const gain = audioContext.createGain(); | ||
gain.connect(audioContext.destination); | ||
|
||
export default function playNoticeSound() { | ||
const oscillator = audioContext.createOscillator(); | ||
oscillator.type = 'sine'; | ||
oscillator.frequency.value = 523.251; | ||
oscillator.connect(gain); | ||
oscillator.start(); | ||
setTimeout(() => { | ||
oscillator.stop(); | ||
}, 100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters