{"action":"created","issue":{"url":"https://api.github.com/repos/AudioKit/AudioKit/issues/1311","repository_url":"https://api.github.com/repos/AudioKit/AudioKit","labels_url":"https://api.github.com/repos/AudioKit/AudioKit/issues/1311/labels{/name}","comments_url":"https://api.github.com/repos/AudioKit/AudioKit/issues/1311/comments","events_url":"https://api.github.com/repos/AudioKit/AudioKit/issues/1311/events","html_url":"https://github.com/AudioKit/AudioKit/issues/1311","id":312324877,"node_id":"MDU6SXNzdWUzMTIzMjQ4Nzc=","number":1311,"title":"iOS mic recording has a clicking noise with the option .defaultToSpeaker = true","user":{"login":"sihwapark","id":25071781,"node_id":"MDQ6VXNlcjI1MDcxNzgx","avatar_url":"https://avatars1.githubusercontent.com/u/25071781?v=4","gravatar_id":"","url":"https://api.github.com/users/sihwapark","html_url":"https://github.com/sihwapark","followers_url":"https://api.github.com/users/sihwapark/followers","following_url":"https://api.github.com/users/sihwapark/following{/other_user}","gists_url":"https://api.github.com/users/sihwapark/gists{/gist_id}","starred_url":"https://api.github.com/users/sihwapark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihwapark/subscriptions","organizations_url":"https://api.github.com/users/sihwapark/orgs","repos_url":"https://api.github.com/users/sihwapark/repos","events_url":"https://api.github.com/users/sihwapark/events{/privacy}","received_events_url":"https://api.github.com/users/sihwapark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-08T17:45:21Z","updated_at":"2018-06-10T20:18:50Z","closed_at":null,"author_association":"NONE","body":"On my iPhone 7, `.defaultToSpeaker = true` always causes clicking noise in a recorded sound but `.defaultToSpeack = false` doesn't. (When headphones are plugged and `.defaultToSpeaker = true`, there is no noise.). This issue also appears in the iOS Recorder example of AudioKit. \r\n\r\nMy temporary solution is toggling `defaultToSpeaker` whenever I record or play back as below:\r\n```\r\nAKSettings.defaultToSpeaker = false // set when you begin to record.\r\n// AKSettings.defaultToSpeaker = true // set when you play a recorded file back\r\n\r\ndo {\r\n     try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord,\r\n with:AKSettings.computedSessionOptions())\r\n} catch {\r\n     print(\"Filed to change AVAudioSessionCategoryOptions\")\r\n}\r\n```\r\nHowever, with the above trick, it is impossible to record additionally while you are playing a recorded file because calling AVAudioSession.sharedInstance().setCategory() stops a sound that is currently playing.\r\n\r\nThis noise problem has been issued almost one year ago (https://github.com/audiokit/AudioKit/issues/798) but it doesn't seem to be solved yet. Also, the recent issue (https://github.com/AudioKit/AudioKit/issues/1213) shows the same problem. According to the issue 1213, this mic recording noise problem only appears to happen on devices newer than iPhone 6 (6s and newer).\r\n\r\nIs there any solution for it?"},"comment":{"url":"https://api.github.com/repos/AudioKit/AudioKit/issues/comments/396078981","html_url":"https://github.com/AudioKit/AudioKit/issues/1311#issuecomment-396078981","issue_url":"https://api.github.com/repos/AudioKit/AudioKit/issues/1311","id":396078981,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjA3ODk4MQ==","user":{"login":"Dane456","id":10985108,"node_id":"MDQ6VXNlcjEwOTg1MTA4","avatar_url":"https://avatars0.githubusercontent.com/u/10985108?v=4","gravatar_id":"","url":"https://api.github.com/users/Dane456","html_url":"https://github.com/Dane456","followers_url":"https://api.github.com/users/Dane456/followers","following_url":"https://api.github.com/users/Dane456/following{/other_user}","gists_url":"https://api.github.com/users/Dane456/gists{/gist_id}","starred_url":"https://api.github.com/users/Dane456/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dane456/subscriptions","organizations_url":"https://api.github.com/users/Dane456/orgs","repos_url":"https://api.github.com/users/Dane456/repos","events_url":"https://api.github.com/users/Dane456/events{/privacy}","received_events_url":"https://api.github.com/users/Dane456/received_events","type":"User","site_admin":false},"created_at":"2018-06-10T20:18:50Z","updated_at":"2018-06-10T20:18:50Z","author_association":"NONE","body":"+ 1. However I'm not getting clicking I'm getting really bad feedback when I override through `try AVAudioSession.sharedInstance().overrideOutputAudioPort(AVAudioSessionPortOverride.speaker)`. Not to mention the recording audio is getting fed through my earpiece speaker for some reason."}}
{"actor":{"display_login":"Dane456"}}