百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

jasiohost

> 编程语言
开源

基于 Java 的 (音频流输入/输出) ASIO 主机。

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

基于 Java 的 (音频流输入/输出) ASIO 主机。

About JAsioHost

JAsioHost (JAH) is a Java interface to Steinberg's Audio Stream Input/Output (ASIO) API. It provides low-latecy ( driverNameList = AsioDriver.getDriverNames();

// load the names ASIO driver AsioDriver asioDriver = AsioDriver.getDriver(driverNameList.get(0));

// add an AsioDriverListener in order to receive callbacks from the driver asioDriver.addAsioDriverListener(new AsioDriverListener() { @Override public void bufferSwitch(long systemTime, long samplePosition, Set channels) { // fill in audio buffers here }

// implement remaining AudioDriverListener interface functions }

// create a Set of AsioChannels, defining which input and output channels will be used Set activeChannels = new HashSet();

// configure the ASIO driver to use the given channels activeChannels.add(asioDriver.getChannelOutput(0)); activeChannels.add(asioDriver.getChannelOutput(1));

// create the audio buffers and prepare the driver to run asioDriver.createBuffers();

// start the driver asioDriver.start(); try { Thread.sleep(1000); } catch (InterruptedException ie) { ie.printStackTrace(System.err); }

// tear everything down AsioDriver.shutdownAndUnloadDriver();


See the [ExampleHost](https://github.com/mhroth/jasiohost/blob/master/src/com/synthbot/jasiohost/ExampleHost.java) for more details. It also contains a `main` function with a minimum GUI for selecting available drivers.

Note that you can only load one ASIO driver at time. This is a limitation of the original API (AFAIK).

## Note on Compilation
If you are brave enough to try to compile the native component, please note the following helpful tips:

* I use [Cygwin](http://www.cygwin.com/) to compile the library, and not Visual Studio. Because I am more familiar with the Unix toolchain. This makes some things more difficult. Unfortunate, but so be it.
* You must [download](http://www.steinberg.net/en/company/developer.html) your own copy of the ASIO library. It cannot be distributed here due to licensing restrictions by Steinberg.

In the ASIO library,
* `./common/asiodrvr.cpp` is not necessary. Rename or remove it.
* `./common/dllentry.cpp` is not necessary. Rename or remove it.
* Line 219 of `./common/combase.h`, `#if WINVER < 0x0501`, should be replaced with `#if 0`. See [here](http://osdir.com/ml/audio.portaudio.devel/2006-09/msg00058.html) for more information.

## A Note about API Translation
The `JAsioHost` API does not strictly reflect the original C++ API written by Steinberg. There are two reasons for this. The first is that some elements of the original API do not translate well due to language semantics. The second is that I felt that some things could be improved or simplified.

An example of the former is that the native API refers to an audio buffer by using a `void` pointer. Java does not allow arrays to be referenced opaquely. `JAsioHost` therefore encapsulates an audio buffer by using a `ByteBuffer`, which exposes the raw bytes of the native buffer, but also allows other types to be read and written with relative ease.

An example of the latter is the absence of the `ASIOBufferInfo` structure in Java. I simply added a reference to the audio buffer to the active `AsioChannel` objects. As the audio buffer conceptually belongs to a channel, this seemed to make sense, and also remove a superfluous class.

## License
JAsioHost is released under the [Lesser Gnu Public License](http://www.gnu.org/licenses/lgpl.html) (LGPL). Basically, the library stays open source, but you can use if for whatever you want, including closed source applications. You must publicly credit the use of this library.

## Acknowledgements
Many thanks to the following people for making JAsioHost possible:
* [Steinberg](http://www.steinberg.net/en/home.html) for releasing ASIO and making good documentation! Of course the ASIO API belongs to them, and if you want to be able to compile the native source then you will need to [get the ASIO component](http://www.steinberg.net/en/company/3rd_party_developer.html) from them.
* This project depends on [IASIOThisCallResolver](http://www.audiomulch.com/~rossb/code/calliasio/). Without it, this project would not be possible. All hail IASIOThisCallResolver. P.S. The reason for this is that I use Cygwin, gcc, MinGW in order to build the native component, not Visual Studio.
* Steve Taylor of [http://toot.org.uk](http://toot.org.uk) for his help in testing out various ASIO drivers and assisting in the debugging process.
* Carl Janson of [HD Sound Lab](hdsoundlab.com) for his efforts in compiling a 64-bit version of the native library.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言