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: sound
Support for Vorbis and Opus, not MP3
I’ve kept a reminder on my todo-list for a long time that I should not implement MP3 file support, but a couple of weeks ago i rebelled and started doing it anyway, which ended up as yet another decision to not do it. Instead, I implemented Ogg Vorbis support for playing .ogg files and streaming… Continue reading Support for Vorbis and Opus, not MP3
ALSA broken pipe errors
Since last summer, when I changed Klipspringer to access ALSA directly, I’ve had problems with occasional sudden stops in playback and capture, caused by broken pipe errors from the ALSA interface. This post contains the information I would have needed – but failed to find when searching the internet – to solve the problem when… Continue reading ALSA broken pipe errors
Ten standard ways of representing binary numbers
If you’ve read the headline and think that ten sounds like an awful lot of different binary-number formats, perhaps you are guessing that it includes floating point, or ones’ complement and other archaic representations, but no, this is all about what’s in common current use, all integers, and all based on two’s complement. This post… Continue reading Ten standard ways of representing binary numbers
The size of silence (and other quirks in streaming FLAC to browsers)
Streaming music from the Klipspringer hub requires three components to interact asynchronously – the Java process that encodes and transmits the data, the web browser with the client-side code that receives and plays it, and the HTTP server that ties them together – so no wonder it’s been stuck in deadlock many times during development.… Continue reading The size of silence (and other quirks in streaming FLAC to browsers)
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
Crossfading
This post is about implementing crossfading, for transitioning smoothly between audio segments or tracks.
Decoding the FLAC audio format in Java
About recording sound, storing and compressin it, the FLAC audio format, and how Klipspringer implements FLAC decoding by invoking libFLAC via JNI.