Mobile Safari Audio Recording from Microphone

2019-04-28 06:03发布

问题:

I've done quite the searching. I know there's a lot of solutions from PhoneGap that allow people to record audio from the microphone. But what I'm looking for is a solid and simple example of how to record audio via Mobile Safari from a users microphone.

Any examples out there? There's been quite the developments in HTML5.

回答1:

You can - with iOS6 now - access the camera. Just use

<input type="file" capture="camera" accept="image/*" id="takePictureField">

I've tried with audio but so far haven't had any luck. I've got a full blog post (which yes, I know Stackoverflow frowns on) demonstrating camera access here: http://www.raymondcamden.com/index.cfm/2013/5/20/Capturing-camerapicture-data-without-PhoneGap



回答2:

Apple doesn't expose the microphone or camera to the mobile browser, but they do expose location based services and motion detection (ios 4.2 and later).

mobile safair info (including location based services) http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html

accelerometer/motion detection for ios 4.2+ http://www.mobilexweb.com/blog/safari-ios-accelerometer-websockets-html5