In this fourth part of the JNI tutorial series, we use the Java native interface to maintain an external resource with a state. Specifically, our example opens and plays an Opus audio file through the opusfile API, but the pattern is general enough to be used for any kind of resource. Getting a handle As… Continue reading A simple Opus audio player with JNI
Tag: linux
Tutorial: The Java native interface to C code
This post is the first in a tutorial series about how JNI, the Java native interface, can be used to call C code from a Java program. We start with the basics and finish with a useful Java class that uses an external library for its core operation. Along the way, we look at some… Continue reading Tutorial: The Java native interface to C code
The subtle choice of sound output device
Recently, I realized that I hadn’t made use of the full sound quality capability of my stereo for a couple of years, because I had got the sound device setting on my stereo computer wrong. Read on to learn from my mistake. I mainly listen to music from a computer I’ve got for that purpose,… Continue reading The subtle choice of sound output device
Playing CDs like in the old days
The CD drive is now integrated as a third Klipspringer input source (besides the FLAC file library and the radio channels). Very simple in terms of code, but it came with lots of little annoying problems that needed fixing, and it’s cool to be able to play physical CDs and have Klipspringer control it using… Continue reading Playing CDs like in the old days
Listening to Linux device input in Javascript
This post is about getting a program that runs in Node.js to react to input directly from a device such as a keyboard or remote control (and it’s probably applicable to a mouse as well) on a GNU/Linux operating system.