Tone Resource

This topic introduces the tone resources provided by 'Linkus SDK for Web Core' and the usage methods.

Background information

The assets directory of 'Linkus SDK for Web Core' project files contains tone resources in the following forms:
  • Original audio files: Stored in the sounds folder.
  • base64-encoded strings: Stored in the sound.js file.
Refer to the following table for the available tone resources.
Name Description Name Description
Ring Incoming call ringtone DTMF04 Keypad 4 tone
Callend Call end tone DTMF05 Keypad 5 tone
Callwaiting Call waiting tone DTMF06 Keypad 6 tone
ringback Ringback tone DTMF07 Keypad 7 tone
DTMF00 Keypad 0 tone DTMF08 Keypad 8 tone
DTMF01 Keypad 1 tone DTMF09 Keypad 9 tone
DTMF02 Keypad 2 tone DTMFStar Keypad * tone
DTMF03 Keypad 3 tone DTMFPound Keypad # tone

Use tone resources

'Linkus SDK for Web Core' supports to use tone resources in the following methods:
  • Use the original audio files of tone resources.
  • Use the base64-encoded strings of the tone resources, as shown in the sample code below.
     import sounds from '/assets/sounds';
     const { Ring, Callend } = sounds;
     const audio = new Audio(Ring);
     audio.play();
     
     // Change the value of "audio.src" to play different tones.
     audio.src = Callend;
     audio.play();