语音录音插件

这是一个简单的语音录制插件,支持直接在桌面或移动设备的浏览器中录制语音消息并发布。

查看 english.best 社区论坛 以了解其实际效果。代码托管在 Github 上。

该库使用了一个经过轻微修改的 Microm 库,其中集成了 RecordRTC 和 lamejs。

完成 标准安装 后,请在设置中启用 composer_audio_upload_enabled

撰写新消息时,只需点击麦克风图标即可开始录制。录制完成后,您的录音将被转换为 mp3 格式,以增强跨浏览器兼容性。

目前重编码使用的是 lamejs,这并不是最优方案,对于较长的语音消息或在较慢的设备上可能需要一些时间。

如果出于某种原因它在您的设备上无法工作,我将不胜感激您能提供设备型号、浏览器及系统版本信息。测试工作并非极其全面,但我们已有一些用户在使用。期待您的反馈和/或提交拉取请求 :slight_smile:

58 个赞

Thank you very much :smiley:

1 个赞

Cool! We regularly get asked for the ability to add a voice message or even a video recording directly to posts. I’ll try this out and let you know how it works out!

Some feedback:

  • mp3, the file type of the uploaded audio recording, is by default not allowed as an upload type. suggest adding a note to the install instructions to enable mp3 uploads.
  • an obvious admin setting to add would be to allow limiting the length of audio recording that can be uploaded. right now it seems that the recording can go on indefinitely though I have not tried it. A max of say 30 seconds or 2 minutes would be suitable for some communities. The utility of an audio recording diminishes the longer it gets, so some default max eg 5 minutes would be sensible.
  • an admin setting to limit by trust level would be helpful
  • a progress indicator during the recording would be helpful, to indicate long the recording is getting, as well as an audio level indicator to show that the audio recording is actually working.
  • the file size of the saved recording is displayed in kilobytes, not megabytes, so eg a 3 minute recording is 2000+. It would be nice to see it in mb.
  • as you indicated, it takes a while to save even a three minute recording, so a progress indicator of the saving process would be helpful.

Is there any scope or ability to add video recording to this plugin? It would be very welcome in my community.

7 个赞

And a quick follow-up after spending a bit of time with this plugin. While looking at

I looked around here but was not able to immediately find posts containing voice recordings (turns out it’s buried in this topic). Some icon (maybe microphone?) indicating topics containing voice recordings might be a good idea, as well as the ability to filter by posts containing voice recordings in the search. Even searching mp3 did not take me straight to posts containing recordings. E.g. a filter to only return topics/posts that “include mp3 recordings”:

Also, just for giggles I recorded a 20 minute recording, then tried to upload it - but the upload failed because it was larger than the maximum size allowed. The recording was then lost, which in this case was no big deal… it was only a recording of me taking a nap, after all. :zzz: But if I had actually spent 20 minutes recording myself saying something important I would have been pretty sad to lose it! So ideally the plugin would stop the recording before the limit is reached, or at least provide a fallback method to save the recording to my device so I can upload it elsewhere and share the link as suggested by the error message.

Update: not sure this is a surprise but this plugin does not work on mobile, using chrome on ios. The record button just doesnt do anything.

Another update: occurs to me the record button could live in the composer options submenu. That would be better in my opinion.

5 个赞

Many thanks for all your feedback, we’ll try to implement some of your suggestions in the next update.

1 个赞

Awesome! I remain very interested in this plugin. Let me know when you need more testing or feedback. :rocket:

1 个赞

Would it possible to allow the recording to be saved somewhere else and then link to that in the plugin.

Example. Say the member had a soundcloud.com account and the recording was sent to soundcloud as a private or public recording.

7 个赞

Intressting project, I really like it.

How about background recording in cases, to allow parallel note taking? This would be my killer feature :wink: Do you know the iOS App Notability? This is currently my way to combine notes with recordings. It’s awesome, because Notability is able to highlight all changes made while the voice is keep talking… I guess this might be too much here? :stuck_out_tongue_winking_eye:

2 个赞

I’d also like to support Keith’s idea of saving the recording elsewhere with one addition. Instead of each member needing a soundcloud.com account, I’d like to be able to create an admin soundcloud account so that all recordings are saved to that account. Will simplify things immensely.

5 个赞

Update to this idea: I wonder if there’s a workflow that allows us to SpeakPipe instead! It’s a free voice recorder that generates a URL that can be added to your post. It also doesn’t require people to create an account. At minimum, people could click on the microphone icon and text pops up with a link to and directions on how to use SpeakPipe.

@csmu and @pawel, this may be another topic all together. Should I split this topic?

2 个赞

Is it free? If so then I think having it as an option would be excellent.

Could the recording be stored on Amazon S3?

1 个赞

The recorder feature is free for any individual to use. They have a more robust product that does cost money, take a look for yourself!

There doesn’t seem to be a workflow that makes it happen automatically, though the person who makes the recording can download it and store the file somewhere else.

3 个赞

Speakpipe does not seem to be “free as in freedom” like we get with discourse. My preference would be to avoid third party hosting of content, including these voice recordings.

You can set up your site to host all attachments on amazon s3 is that not a reasonable solution for those who may want to host longer recordings that take up more space?

3 个赞

我很高兴发现了这个插件,但在支持第三方录音托管之前,我还有些犹豫是否安装它。理想情况下,除了自托管外,还能提供与 Google Drive、Dropbox、Vocaroo 或其他第三方网站连接的选项,但第三方托管对于存储空间有限的托管社区来说尤其有益。期待该应用的任何未来更新,也感谢 Pawel 开发了它!

2 个赞

你好,Jimmy!欢迎加入。很高兴你也对这个插件感兴趣。上面关于第三方托管有一些讨论,但我个人并不认为这是高优先级的问题,甚至对于本插件来说并不相关。

如果足够多的人需要,或许你可以开发另一个插件,来与 Speakpipe 或其他基于云端的音频分享网站配合使用?

对于本插件,我认为当务之急是添加一个管理员设置,用于限制录音长度。这样文件大小就不会给存储或播放带来过大负担,网站也不会被无人收听的冗长散漫录音所充斥。:wink:

目前,Discourse 已经支持外部托管附件(这是内置功能,请查看“启用 S3 上传”管理员设置)。但确实,它并不适合用于流媒体内容。

2 个赞

我很好奇,为什么不行?

1 个赞

我见过这里关于在 Discourse 上托管视频流等功能的限制讨论,但一时没找到。:wink: 也许有人能在我继续查找时提供答案。

我的直觉是,小文件通常不是问题,但一旦涉及数小时的电影内容,你就应该将内容迁移到像 Vimeo 或 YouTube 这样的云流媒体服务,然后在 Discourse 帖子中提供内嵌播放链接,让用户无需离开论坛即可观看。

1 个赞

这个插件不是用于语音录制的吗?

单声道 MP3 音频通常应小于 10MB(44.1kHz/16bit/96kbps 的 10 分钟单声道音频约为 7.2MB),因此它类似于一个较大的 GIF 文件,完全可以与对象存储(S3)及 CDN 结合使用。

6 个赞

啊,我们说的是同一件事。抱歉之前表述得有些混淆。

有人提出支持第三方托管音频录音,而我的观点是:正如你所说,我们完全不必为此担心。存储和播放小文件根本不是问题。

然而,目前该插件允许用户开始录音后无限期地持续录制,如果录音时间过长导致文件超过服务器允许的大小,在保存时就会失败。

4 个赞

正如 Tobias 在 这里 提到的,该插件存在不少重要问题(主要是移动端问题,以及在保存录音时缺乏计时器或反馈)。

我非常希望能看到一种原生的替代方案。对我而言,让用户录制并分享音频的最简单方法是使用像 Clyp 这样的服务。其免费套餐提供 360 分钟的录音时长,并且会生成一个可以直接粘贴到 Discourse 中的链接(这要归功于 OneBox 的魔力):

https://clyp.it/ry03mt3o

唯一的缺点是它无法在 iPad 上录音(你只能上传音频文件)。

其他在线录音选项,如果对大家有用的话:

  • Poodll - 缺点:文件仅保存 30 天
  • VirtualSpeech: 在线语音录音器 - 缺点:无法在 iPad 上运行。在 Android 上,它会生成 .oga 文件,这些文件在 Discourse 中无法自动播放(尽管 .ogg 文件可以。这可能是一个 bug)
2 个赞