使用HTML5从iPhone录制语音 [英] Record voice from IPhone using HTML5
问题描述
您可以尝试HTML媒体捕捉。 关于dev.opera的文章说:
Android OS 3.0是第一个通过其默认Android Webkit浏览器提供HTML Media Capture
支持的平台。现在,HTML Media
Capture也得到以下支持:
- Safari 6和iOS版Chrome移动版
- 适用于Android OS 3的Chrome移动版
- 适用于Android OS 3的Firefox移动版
- 适用于Android OS 3的Opera 16 +
>
尽管如此,其中一些只是部分实现了规范,或者
实现了一个较旧的W3C规范,这使得代码稍微高于
不同:
< input type =fileaccept =image / *capture =camera>
< input type =fileaccept =video / *capture =camcorder>
< input type =fileaccept =audio / *capture =microphone>
链接至演示页面,您可以在手机上进行尝试。我还发现了此示例页面。在我的快速iOS 7测试中,它只能正确处理照片和视频。
编辑:进一步阅读表明,在iOS 6和7上实际上不支持 accept =audio / *
,只有 accept =image / *
和 accept =video / *
。
更新:iOS 8.3的快速测试表明这里没有任何改变: accept =image / *
和 accept =video / *
是受支持的,但
更新:iOS 10.0.2的快速测试表明 accept =音频/ *
仍然不受支持,尽管看起来您现在可以从iCloud Drive或Dropbox上传音频文件。
更新:尽管 Webkit博客文章,似乎仍然不支持 accept =audio / *
在我的iPhone 5S上的iOS 10.3中。
更新:在iOS 11.0.3中也是如此。在iPhone 5S上似乎还不支持 accept =audio / *
。
I have been working on a mobile web application just for my own enjoyment and research. Everything seemed to be working pretty slick with HTML5/CSS and JavaScript for the client application, although it looks like I need a third party technology for voice recording. I had a pretty good solution working with Flash, but after testing it with my IPhone, I had remembered that they don't seem to support flash which is disappointing because I had a pretty good solution going. I want to record voice using HTML5 in Iphone and android. Is there any way?
You could try HTML Media Capture. An article on dev.opera says:
Android OS 3.0 was the first platform to provide HTML Media Capture support, via its default Android Webkit browser. Now HTML Media Capture is also supported by:
- Safari and Chrome Mobile for iOS 6+
- Chrome Mobile for Android OS 3+
- Firefox Mobile for Android OS 3+
- Opera 16 for Android OS 3+
Nonetheless some of them only partially implement the specification or implement an older W3C specification, that makes the code above slightly different:
<input type="file" accept="image/*" capture="camera"> <input type="file" accept="video/*" capture="camcorder"> <input type="file" accept="audio/*" capture="microphone">
It links out to a demo page which you could try on your mobile. I also found this example page. In my quick iOS 7 testing though, it only worked correctly for photos and videos.
Edit: Further reading suggests accept="audio/*"
isn't actually supported on iOS 6 and 7, only accept="image/*"
and accept="video/*"
.
Update: A quick test on iOS 8.3 suggests nothing has changed here: accept="image/*"
and accept="video/*"
are supported, but accept="audio/*"
is not.
Update: A quick test on iOS 10.0.2 suggests accept="audio/*"
is still not supported, although it looks like you might be able to upload an audio file from iCloud Drive or Dropbox now.
Update: Despite what it says in the Webkit blog post, there still seems to be no support for accept="audio/*"
in iOS 10.3 on my iPhone 5S.
Update: Same story in iOS 11.0.3. There still seems to be no support for accept="audio/*"
on my iPhone 5S.
这篇关于使用HTML5从iPhone录制语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!