[TIMOB-26196] iOS: Move Ti.Media microphone related APIs to AVAudioRecorder and remove 3rd-party library
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-10-25T10:54:29.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | iOS |
| Labels | debt, ti.media |
| Reporter | Christopher Williams |
| Assignee | Vijay Singh |
| Created | 2018-07-10T19:44:50.000+0000 |
| Updated | 2018-10-25T14:25:13.000+0000 |
Description
iOS should be using AVAudioRecorder for mic recording related APIs, but is using a very, very old 3rd-party library: [SCListener](https://github.com/stephencelis/sc_listener). Full affected list of API's:
- startMicrophoneMonitor()
- stopMicrophoneMonitor()
- peakMicrophonePower (property)
- averageMicrophonePower (property)
This does not have to be a breaking change as the newer API's are pretty solid to use. We should also add an example for this into our KitchenSink (cc [~topener])
PR: https://github.com/appcelerator/titanium_mobile/pull/10166 Test-Case: https://gist.github.com/hansemannn/1414ea2d11238d1ce99d0528cc4d0cc7
On SDK Version
7.4.1.v20181008103750everything seems to be working fine using the test case mentioned above but on SDK version7.5.0.v20181010051919I see the following error:[ERROR] : Script Error { [ERROR] : column = 62; [ERROR] : line = 31; [ERROR] : message = "-[MediaModule hasAudioRecorderPermissions:]: unrecognized selector sent to instance 0x101029400"; [ERROR] : nativeStack = "3 CoreFoundation 0x00000001b9a837e8 <redacted> + 1412\n4 CoreFoundation 0x00000001b9a8548c _CF_forwarding_prep_0 + 92\n5 Ti8 0x00000001009db578 Ti8 + 636280\n6 CoreFoundation 0x00000001b9a85630 <redacted> + 144\n7 CoreFoundation 0x00000001b9963560 <redacted> + 292\n8 Ti8 0x0000000100958fbc Ti8 + 102332\n9 Ti8 0x00000001009576a0 Ti8 + 95904\n10 Ti8 0x00000001009c5d00 Ti8 + 548096\n11 Ti8 0x00000001009573c0 Ti8 + 95168\n12 JavaScriptCore 0x00000001c16a6b58 <redacted> + 348\n13 JavaScriptCore 0x00000001c1d90f5c <redacted> + 352\n14 JavaScriptCore 0x00000001c167ddd8 <redacted> + 29992\n15 JavaScriptCore 0x00000001c16766b4 <redacted> + 308\n16 JavaScriptCore 0x00000001c1cee1ac <redacted> + 424\n17 JavaScriptCore 0x00000001c1ea4d1c _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 188\n18 JavaScriptCore 0x00000001c16ac08c JSObjectCallAsFunction + 368\n19 Ti8 0x0000000100a63244 Ti8 + 1192516"; [ERROR] : sourceURL = "file:///var/containers/Bundle/Application/21AB9986-4D22-4DB1-8F33-27A196B6BC87/Ti8.app/app.js"; [ERROR] : stack = " at [native code]\n at buttonHandler(/app.js:31:62)"; [ERROR] : toJSON = "<KrollCallback: 0x280f2ac40>"; [ERROR] : }PR for fixing mentioned issue - https://github.com/appcelerator/titanium_mobile/pull/10398
FR Passed, waiting on Jenkins build and CR.
CR passed, Jenkins build is also ready
*Closing ticket.* Verified fix in SDK version
7.5.0.v20181025051112. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10398