Skip to content

The timer in Recorder doesn't start first time #14

@guangmingzizai

Description

@guangmingzizai

The callback of AVAudioSession.requestRecordPermission may not be called on main thread, so the timer in start method may doesn't start, due to absence of runloop.

The solution:

AVAudioSession.sharedInstance().requestRecordPermission() { allowed in
	DispatchQueue.main.async {
		if allowed {
			self.start(url)
		} else {
			self.update(nil)
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions