最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flash - Javascript library for recording user audio? - Stack Overflow

programmeradmin4浏览0评论

This isn't another one of those "How can I record audio in the browser?" questions... I know that the HTML5 Stream API is around the corner and Flash can already access the user's microphone and camera. I'm simply wondering, as a Javascript developer with little knowledge of Flash, if anyone has developed a JS library that hooks into Flash's device capabilities for recording but sends the results back to javascript (presumably using ExternalInterface).

In other words... libraries like SoundManager2 utilize a Flash fallback for audio playback, but they don't seem to allow for recording. Has anyone written a JS library that uses an invisible Flash movie to allow audio recording?

This isn't another one of those "How can I record audio in the browser?" questions... I know that the HTML5 Stream API is around the corner and Flash can already access the user's microphone and camera. I'm simply wondering, as a Javascript developer with little knowledge of Flash, if anyone has developed a JS library that hooks into Flash's device capabilities for recording but sends the results back to javascript (presumably using ExternalInterface).

In other words... libraries like SoundManager2 utilize a Flash fallback for audio playback, but they don't seem to allow for recording. Has anyone written a JS library that uses an invisible Flash movie to allow audio recording?

Share Improve this question asked May 8, 2011 at 22:50 Matt DiamondMatt Diamond 11.7k5 gold badges30 silver badges36 bronze badges 1
  • I started working on something, but have since stalled. Initial work at github./stoive/aud.i-o - however it should really implement the navigator.getUserMedia() that WHATWG has defined ( whatwg/specs/web-apps/current-work/plete/… ). It's also buggy. – Stoive Commented May 9, 2011 at 0:36
Add a ment  | 

2 Answers 2

Reset to default 5

This does most of what you're looking for:

https://code.google./p/wami-recorder/

It records audio and sends it to a server via an HTTP POST (avoiding the need for a Flash Media Server.) A JavaScript API is available via ExternalInterface.

I'm not sure why you'd want the audio bytes in JavaScript, but it would probably be easy to modify it to do that too.

Unfortunately, you can't really do Flash audio recording in browser only. The Flash audio interfaces are all designed (surprise surprise) to talk to a Flash media server (or Red5): there is no interface to store recorded audio data locally and pass the recorded audio data to Javascript.

Once you have Red5/FMS setup you can control the recording process from Javascript: you can start/stop/playback the audio stream to/from the server. However, for security reasons you have to have a flash movie that is a minimum of 216 x 138 (see http://blog.natebeck/2009/01/tip-of-the-day-tricks-of-the-mic-settings-panel/ for a writeup) otherwise the settings manager won't be shown: this prevents people hiding an audio recording flash widget on a page and eavesdropping.

So no, no invisible flash controlled from javascript.

发布评论

评论列表(0)

  1. 暂无评论