This project is a demo chat application that uses audible chirps to connect users to the same channel using the Chirp WebAssembly SDK and PubNub Javascript SDK.
Using Chirp you can eliminate the need to users to manually enter the channel they want to join. The users only need to enable microphone access and turn up their speaker to connect to each other. Chirp is a great alternative to QR codes.
Want to learn more about this project or build a clone from scratch? Check out the tutorial.
Chirp’s SDKs allows you to send small amounts of data over sound. It is designed to work in noisy everyday environments and doesn’t require perfect silence to work. In my experiments I found that my chirps were received in almost every reasonable scenario I tested.
- Sign up for a Chirp account. Get your Chirp key from the applications page.
- Sign up for a PubNub account (always free). Once you sign up, you can get your unique PubNub keys from the PubNub Admin Dashboard. Sign up using the form below.
Replace “YOUR_PUBNUB_PUBLISH_KEY_HERE” and “YOUR_PUBNUB_SUBSCRIBE_KEY_HERE” with your Publish Key and Subscribe Key from the PubNub Admin Dashboard.
Replace "YOUR_CHIRP_KEY_HERE" with your Chirp key from the applications page.
Although Chirp sends data completely offline, registration credentials are needed to identify your user account to the SDK, and to configure the SDK with your profile-specific features.
For web-based applications using the Chirp JavaScript or WebAssembly SDKs, applications are identified using your application key, and must be hosted on one of the web origins that you specify in the origins pane of your application.
Important Note: CORS rules won’t allow the browser to load the Chirp WebAssembly SDK directly from the file system.
You must host the files using a server. I recommend http-server to test locally.
npm install http-server -g
Start the server from the same directory as your project files:
http-server
Add your origin to the origins pane of your application.
Visit http://localhost:8080 to view and test your chat application powered by Chirp and PubNub.