1.0.2 • Published 5 years ago
text-typer-ext-sound v1.0.2
⌨️ Text Typer Extension - Typing Sounds ⌨️
Enchance the typing with keyboard sound effects. Extension of TextTyper
Credit
Credit Sound Effects to Here
Links
Usage
Simply put the extension script tag under the core module's. Like so:
<script src='https://unpkg.com/text-typers@latest/build/bundle.js'></script>
<script src='https://unpkg.com/text-typer-ext-sound@latest/dist/cursor_ext_sound.js'></script>Example
// Use Normally
tt.soundSettings({
typeSound: TextTyper.SOUND_CHERRY_BLUE,
delSound: TextTyper.SOUND_CHERRY_BLACK,
typeVolume: 0.8,
delVolume: 0.6
});
const eq = tt.eventQueue();
// Chain method
eq.soundSettings({
typeSound: TextTyper.SOUND_CHERRY_BLUE
}).typeText("Hello").start();Settings
With this extension, it adds a new soundSettings method to both TextTyper object and CursorEventQueue object. So it can be used in chaining methods, or called normally before setting up event chains.
It takes in a SoundSettings Javascript object:
{ typeSound, delSound, typeVolume, delVolume }| Property | Description |
|---|---|
typeSound (optional) | A string constant. Sound Effect when typing characters. Explained in Setting Constants |
delSound (optional) | A string constant. Sound Effect when deleting characters. Explained in Setting Constants |
typeVolume (optional) | Number from 0 to 1. Volume of typing sound |
delVolume (optional) | Number from 0 to 1. Volume of deleting sound |
Setting Constants
TextTyper.SOUND_CHERRY_BLACKTextTyper.SOUND_CHERRY_BLUETextTyper.SOUND_CHERRY_BROWNTextTyper.SOUND_CHERRY_CLEARTextTyper.SOUND_CHERRY_GREENTextTyper.SOUND_CHERRY_GREYTextTyper.SOUND_CHERRY_REDTextTyper.SOUND_CHERRY_WHITE