{"_id":"581774a462e4500f009404e0","category":{"_id":"576d42354bcd290e00428942","version":"576d42354bcd290e00428941","project":"56a526d4e7a1622b0024fae4","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-24T19:32:37.467Z","from_sync":false,"order":0,"slug":"documentation","title":"Our Technology"},"user":"56bc6af27c91881900089bac","parentDoc":null,"version":{"_id":"576d42354bcd290e00428941","project":"56a526d4e7a1622b0024fae4","__v":1,"createdAt":"2016-06-24T14:22:45.076Z","releaseDate":"2016-06-24T14:22:45.076Z","categories":["576d42354bcd290e00428942","576d42354bcd290e00428943","576d42354bcd290e00428944","576d42354bcd290e00428945","576d42354bcd290e00428946","576d42354bcd290e00428947"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"__v":2,"project":"56a526d4e7a1622b0024fae4","updates":["581779805ec82a0f00a093d2","5818a70887c20b0f0086a1f7"],"next":{"pages":[],"description":""},"createdAt":"2016-10-31T16:43:16.747Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Chirp sends and receives data via acoustic signals, translating information into sequences of tones. Multiple configurations are available within each SDK, which allow you to tailor specific properties of the data transmission.\n\nConfigurable properties include:\n\n* **the payload size**, in bits\n* **the frequency range**, in hertz (including a lower and upper bound)\n* **the duration**, in seconds: longer tones are more reliable in reverberant environments, but result in a higher latency\n\nConfigurations are provided as distinct Chirp \"protocols\". Each protocol describe a complete set of properties tailored for a specific use case.\n\nBy default, two distinct audio protocols are provided. \n\n* **standard**: our classic 50-bit, 1.8s tone in the audible range, which maps tones onto the musical scale. Standard chirps are 10 characters long, from the 5-bit alphabet `0-9a-v`.\n* **ultrasonic**: an inaudible chirp, utilising frequencies that are beyond the limit of human hearing but can be sent and received by consumer audio devices. Ultrasonic chirps are 8 characters long, from the 4-bit hexadecimal alphabet `0-9a-f`, comprising 32 bits of data in total.\n\nBoth of these protocols are tailored for typical everyday peer-to-peer use cases, in moderately noisy acoustic environments.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Custom Audio Protocols\",\n  \"body\": \"If you'd like a specific protocol that is tailored to your use case, we're able to design and develop encodings that exactly match a client's specification. For [Skylanders Imaginators](https://www.skylanders.com/uk/en/video-games/skylanders-imaginators), we designed a high-capacity 1024-bit Chirp protocol that's specifically targeted at living room environments.\\n\\nTo speak to us about working with you to build the perfect audio communications protocol for your application, [drop us a line](mailto:developers:::at:::chirp.io).\"\n}\n[/block]\n# Selecting a Protocol\n\nEach Chirp SDK exposes a method that allows you to select the currently active protocol. The active protocol is used for both sending and receiving chirps; if you select the **ultrasound** protocol, you won't also be able to receive **standard** chirps.\n\nThe current protocol must be selected before the SDK is started. See below for example code.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Set the protocol before starting the SDK.\\n\\nNSError *error = [[ChirpSDK sdk] setProtocolNamed:ChirpProtocolNameUltrasonic];\\nif (error)\\n{\\n    NSLog(@\\\"Error setting ultrasonic mode: %@\\\", error);\\n}\\n\\n[[ChirpSDK sdk] start];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"// Set the protocol before starting the SDK.\\n\\nChirpProtocolResult chirpProtocolResult = chirpSDK.setProtocolNamed(ChirpProtocolName.ChirpProtocolNameUltrasonic);\\n\\nif (chirpProtocolResult != ChirpProtocolResult.OK) {\\n\\tLog.v(TAG, \\\"Error setting ultrasonic mode: \\\" + chirpProtocolResult.getDescription());\\n    return;\\n}\\n\\nchirpSDK.start();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"// Set the protocol before chirping.\\n\\nchirpSDK.setProtocolNamed('ultrasonic');\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"# Set the protocol before chirping.\\n  \\nsdk.set_protocol('ultrasonic')\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"chirp-protocols","type":"basic","title":"Chirp Protocols"}
Chirp sends and receives data via acoustic signals, translating information into sequences of tones. Multiple configurations are available within each SDK, which allow you to tailor specific properties of the data transmission. Configurable properties include: * **the payload size**, in bits * **the frequency range**, in hertz (including a lower and upper bound) * **the duration**, in seconds: longer tones are more reliable in reverberant environments, but result in a higher latency Configurations are provided as distinct Chirp "protocols". Each protocol describe a complete set of properties tailored for a specific use case. By default, two distinct audio protocols are provided. * **standard**: our classic 50-bit, 1.8s tone in the audible range, which maps tones onto the musical scale. Standard chirps are 10 characters long, from the 5-bit alphabet `0-9a-v`. * **ultrasonic**: an inaudible chirp, utilising frequencies that are beyond the limit of human hearing but can be sent and received by consumer audio devices. Ultrasonic chirps are 8 characters long, from the 4-bit hexadecimal alphabet `0-9a-f`, comprising 32 bits of data in total. Both of these protocols are tailored for typical everyday peer-to-peer use cases, in moderately noisy acoustic environments. [block:callout] { "type": "info", "title": "Custom Audio Protocols", "body": "If you'd like a specific protocol that is tailored to your use case, we're able to design and develop encodings that exactly match a client's specification. For [Skylanders Imaginators](https://www.skylanders.com/uk/en/video-games/skylanders-imaginators), we designed a high-capacity 1024-bit Chirp protocol that's specifically targeted at living room environments.\n\nTo speak to us about working with you to build the perfect audio communications protocol for your application, [drop us a line](mailto:developers@chirp.io)." } [/block] # Selecting a Protocol Each Chirp SDK exposes a method that allows you to select the currently active protocol. The active protocol is used for both sending and receiving chirps; if you select the **ultrasound** protocol, you won't also be able to receive **standard** chirps. The current protocol must be selected before the SDK is started. See below for example code. [block:code] { "codes": [ { "code": "// Set the protocol before starting the SDK.\n\nNSError *error = [[ChirpSDK sdk] setProtocolNamed:ChirpProtocolNameUltrasonic];\nif (error)\n{\n NSLog(@\"Error setting ultrasonic mode: %@\", error);\n}\n\n[[ChirpSDK sdk] start];", "language": "objectivec" }, { "code": "// Set the protocol before starting the SDK.\n\nChirpProtocolResult chirpProtocolResult = chirpSDK.setProtocolNamed(ChirpProtocolName.ChirpProtocolNameUltrasonic);\n\nif (chirpProtocolResult != ChirpProtocolResult.OK) {\n\tLog.v(TAG, \"Error setting ultrasonic mode: \" + chirpProtocolResult.getDescription());\n return;\n}\n\nchirpSDK.start();", "language": "java" }, { "code": "// Set the protocol before chirping.\n\nchirpSDK.setProtocolNamed('ultrasonic');", "language": "javascript" }, { "code": "# Set the protocol before chirping.\n \nsdk.set_protocol('ultrasonic')", "language": "python" } ] } [/block]