0.3.2 • Published 7 months ago

@sparklaboratory/react-native-system-tones v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@sparklaboratory/react-native-system-tones

Provides access to the available system tones on the device.

Installation

npm install @sparklaboratory/react-native-system-tones

Usage

import {
  list,
  play,
  stop,
  SOUND_TYPES,
} from '@sparklaboratory/react-native-system-tones';

// ...

const sounds = await list(SOUND_TYPES.RINGTONES);
// [ { soundID: 1, url: /path/to/file, title: "Sound Name" }]
play(sounds[1]);
setTimeout(() => stop(), 1000);

SOUND_TYPES

  • RINGTONES
  • ALARMS
  • NOTIFICATIONS
  • ALL

NOTE that alarms, notifications and all are android only, using those 3 parameters on iOS will return to you the UI Sounds. Eventually ALL will include ringtones on iOS as well once some light refactoring is completed.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.3.2

7 months ago

0.3.1

7 months ago

0.3.0

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago