Free up to 1MM monthly messages. No credit card required.
Your voice is a powerful tool. Using the new Spoken SDK, you can capture and transmit your voice to remote control devices and apps. Using the PubNub Network, your voice transcript is transmitted to the target remote device. You will be able to build your own voice-powered app and control devices remotely by the time your done reading.
Badger Badger Badger Badger Badger Badger Badger Badger Badger Mushroom MUSHROOM!
Try it out: https://stephenlb.github.io/badger
Get free API Keys: https://dashboard.pubnub.com/signup
Voice capture technology is here and it’s so good. How good? The Spoken SDK can understand your voice at 109% of what the human ear can gather. You can control apps using your voice. This makes apps easier to use when driving or when impaired visually.
You can capture your voice commands calling the spoken.listen()
method. This method requests your microphone access. Once the voice capture starts your computer starts translating your speech into text. This is commonly referred as Speech-to-Text.
spoken.listen().then( transcript => { pubnub.publish({ message : transcript }); } );
Once the transcript is captured, you can transmit the result to a remote computer or IoT device, like a lamp. You can say: “Turn on the hallway lights.”. You can also say: “Badger Badger Badger.”.
Using any one of the PubNub SDKs you can receive commands driven by your voice.
pubnub.subscribe({ channels: ['badger'] }); pubnub.addListener( { message : transcript => { // DO SOMETHING HERE WITH YOUR VOICE TRANSCRIPT console.log(transcript); } );
You can create many new apps using voice technologies. Start by reviewing this list.
Now you can build voice-powered apps really easy using our new Spoken SDK.
Get free API Keys: https://dashboard.pubnub.com/signup
You can use the following code to add voice-controls to your app:
Use this code on the device with the microphone.
<script src="https://stephenlb.github.io/spoken/spoken.js"></script> <script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.21.2.min.js"></script> <script>( async e => { 'use strict'; const subscribe_key = '_SUBSCRIBE_API_KEY_'; const publish_key = '__PUBLISH_API_KEY__'; const data_channel = 'badger'; // Event Stream Network const pubnub = new PubNub({ publishKey : subscribe_key, subscribeKey : publish_key }); // Transmit your captured voice transcription spoken.listen().then( transcript => { pubnub.publish({ message : transcript, channel : data_channel }); } ).catch( e => console.info('Already listening.') ); })()</script>
Use this code on the remote device like an IoT light bulb.
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.21.2.min.js"></script> <script>( async e => { 'use strict'; const subscribe_key = '_SUBSCRIBE_API_KEY_'; const publish_key = '__PUBLISH_API_KEY__'; const data_channel = 'badger'; // Event Stream Network const pubnub = new PubNub({ publishKey : subscribe_key, subscribeKey : publish_key }); pubnub.subscribe({ channels: [data_channel] }); pubnub.addListener( { message : transcript => { // DO SOMETHING HERE WITH COMMAND console.log(transcript); } ); })()</script>
That’s it! Now you can create a voice-controlled device in just a few minutes.
Display real-time notification badges with PubNub and React Native to display important information and bring users back to your...
Michael Carroll
The concept of Digital Twins has evolved over the last two decades, however, one thing remains the same: the need for real-time...
Michael Carroll
Learn the ins-and-outs of PubNub message size and get a better idea of how many text characters fit in a single message.
Michael Carroll