forked from TwilioDevEd/api-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the twiml ssml code snippets to avoid deprecated functions (Tw…
- Loading branch information
Showing
3 changed files
with
29 additions
and
30 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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
const VoiceResponse = require('twilio').twiml.VoiceResponse; | ||
|
||
|
||
const response = new VoiceResponse(); | ||
const say = response.say({ | ||
voice: 'Polly.Joanna' | ||
}, 'Hi'); | ||
say.ssmlBreak({ | ||
say.break_({ | ||
strength: 'x-weak', | ||
time: '100ms' | ||
}); | ||
say.ssmlEmphasis({ | ||
say.emphasis({ | ||
level: 'moderate' | ||
}, 'Words to emphasize'); | ||
say.ssmlP('Words to speak'); | ||
say.p('Words to speak'); | ||
say.addText('aaaaaa') | ||
say.ssmlPhoneme({ | ||
say.phoneme({ | ||
alphabet: 'x-sampa', | ||
ph: 'pɪˈkɑːn' | ||
}, 'Words to speak'); | ||
say.addText('bbbbbbb') | ||
say.ssmlProsody({ | ||
say.prosody({ | ||
pitch: '-10%', | ||
rate: '85%', | ||
volume: '-6dB' | ||
}, 'Words to speak'); | ||
say.ssmlS('Words to speak'); | ||
say.ssmlSayAs({ | ||
'interpret-as': 'spell-out' | ||
say.s('Words to speak'); | ||
say.sayAs({ | ||
'interpret-as': 'spell-out', | ||
role: 'yyyymmdd' | ||
}, 'Words to speak'); | ||
say.ssmlSub({ | ||
say.sub({ | ||
alias: 'alias' | ||
}, 'Words to be substituted'); | ||
say.ssmlW('Words to speak'); | ||
say.w('Words to speak'); | ||
|
||
console.log(response.toString()); |
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
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