1.2.1 • Published 6 years ago

cordova-plugin-system-sound-services v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Cordova System Sound Plugin

This is a simple plugin to play sound for iOS. The main motivation for creating this plugin is to play DTMF feedback sound while using https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc. The dtmfSender interface in cordova-plugin-iosrtc does not give the users audio feedback. Other plugins out there does not take consideration of a voip call in session and end up taking over the audio.

Installation

In your root Cordova project

$ cordova plugin add cordova-plugin-system-sound-services

Make sure you have your-sound-file.wav imported to the ios target as a part of your build process so it exists when you run build ios command.

Usage

Somewhere after/before running your DTMF function

window.SystemSound.playSound('your-sound-file.wav');

If you sound is not located in the root of the xcode project

window.SystemSound.playSound('your-sound-file.wav', 'path/to/folder/with/sounds');