Pergunta

I'm trying to programmatically playback some apple loops files that I have. Since I enjoy clojure, I tried doing this using on the JVM first. The Java Sound Demo plays back the .aif that ships with the package just fine, but when I try to play back one of my loops files, I get:

java.lang.IllegalArgumentException: No line matching interface Clip supporting
format PCM_SIGNED 48000.0 Hz, 24 bit, stereo, 6 bytes/frame, big-endian, 
and buffers of 671064 to 671064 bytes is supported. 

I am guessing this means that the java sound api won't support my file type. I am language agnostic, but I am curious what the best language to use is for playing this back?

I've also looked into pygame, but it seems a nightmare to install, so wanted to see what my options are.

Foi útil?

Solução

The problem there is that Java sound, which is ancient and in desperate need of some love, does not support 24 bit files. (I am pretty sure it supports 48kHz and it def support stereo uncompressed AIFFs)

There are some options for extending javasound with various other libraries, though I don't know as much about those. You could try http://www.tritonus.org/

For other languages, one place to start is http://www.mega-nerd.com/libsndfile/ which is very popular and I think there may be wrappers for languages you may like besides C.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top