如何在Erlang中录制声音 [英] How to record sound in Erlang

查看:85
本文介绍了如何在Erlang中录制声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Erlang中构建一个非常简单的流应用程序,它将像团队演讲一样工作.人员A,B和C都具有连接到服务器应用程序的客户端应用程序.服务器应用程序确保可以将音频消息从人员A分发到人员B和C.

I would like to build a very simple streaming application in Erlang, it will work something like team speak. Person A, B and C are all having a client application which connects to a server application. The server application makes sure it can distribute the audio message from Person A to Person B and C.

因此,这个概念很简单,并且互联网上已经可以找到很多东西(例如流式传输在Erlang中的工作方式).我似乎找不到如何在Erlang中录制音频.有一些带有完整文件的示例(例如Joe Armstrong的shoutcast示例)

So the concept is simple and many things can already be found on the internet (like how streaming works in Erlang). What I can't seem to find is how to record audio in Erlang. There are examples with complete files (like the shoutcast example from Joe Armstrong)

我唯一能找到的是,音频输入在OS级别上的工作方式存在差异. OSX具有Core Audio,Linux具有(/dev/audio& padsp.这似乎与Erlang有关.Windows可能有自己的东西.

The only thing I could find was that there are differences how audio input works on OS level. OSX has Core Audio, Linux has (/dev/audio & padsp. This seems to be relevant for Erlang. Windows probably has his own thing.

我对这些东西很陌生.

我的主要问题是:如何从Erlang应用程序中的麦克风获取输入?是否存在最佳实践,不同的操作系统之间是否存在差异?

My main question is: How can I get the inputs from microphones in my Erlang application? Is there a best practice and are there differences between different operating systems?

已经非常感谢!

利昂

推荐答案

您应该使用可移植的抽象层(例如SDL2),而不是自己弄清楚如何为每个OS进行操作.有一个Erlang绑定: https://github.com/ninenines/esdl2 ,但我不知道不知道音频部件是否还在工作.试试看,看看.或者,尝试使用较旧的SDL绑定: https://github.com/dgud/esdl .用于Erlang的wxWidgets绑定似乎没有实现任何音频功能: http://erlang .org/doc/apps/wx/index.html .

You should use a portable abstraction layer such as SDL2 rather than figuring out how to do it yourself for each OS. There is an Erlang binding: https://github.com/ninenines/esdl2, but I don't know if the audio parts are working yet. Try it out and see. Alternatively, try the older SDL binding: https://github.com/dgud/esdl. The wxWidgets binding for Erlang doesn't seem to implement any audio features: http://erlang.org/doc/apps/wx/index.html.

这篇关于如何在Erlang中录制声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆