Adding javax.sound service provider as a module.
skoure May 30, 2012 4:20 PMI'm trying to add tritonus' java sound mp3 format conversion provider as a module on JBOSS AS 7.1, but I am not having any luck getting it registered with Java Sound.
I'm getting a java.lang.IllegalArgumentException: Unsupported conversion: MPEG1L3 from PCM_SIGNED ...
If I add the tritonus_mp3-0.3.6.jar and tritonus_share-0.3.6.jar to my applications, and set -Djava.library.path to the location of the native dlls all works fine, however, I would prefer to set this up as a module.
I have created the following directory structure under the modules directory.
org\tritonus\main
|- module.xml
|- tritonus_mp3-0.3.6.jar
|- tritonus_share-0.3.6.jar
|- service-loader-resources
| |- META-INF
| |- services
| |- javax.sound.sampled.spi.AudioFileReader
| |- javax.sound.sampled.spi.AudioFileWriter
| |- javax.sound.sampled.spi.FormatConversionProvider
| - lib
|- win-i686
|- lame_enc.dll
|- lametritonus.dll
The files under services are text files containing the tritonus class names of the classes implementing the services.
Note: I also had to add similar services under the sun.jdk module for ULAW, ALAW and Wave file support, that works fine.
module.xml is as follows.
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.tritonus" > <resources> <resource-root path="lib"/> <resource-root path="service-loader-resources" /> <resource-root path="tritonus_mp3-0.3.6.jar" /> <resource-root path="tritonus_share-0.3.6.jar" /> </resources> <dependencies> <system export="true"> <paths> <path name="org/tritonus/lowlevel/lame" /> <path name="org/tritonus/sampled/convert/javalayer" /> <path name="org/tritonus/sampled/convert/lame" /> <path name="org/tritonus/sampled/file/mpeg" /> <path name="org/tritonus/share" /> <path name="org/tritonus/share/midi" /> <path name="org/tritonus/share/sampled" /> <path name="org/tritonus/share/sampled/convert" /> <path name="org/tritonus/share/sampled/file" /> <path name="org/tritonus/share/sampled/mixer" /> <path name="META-INF/services" /> </paths> <exports> <include-set> <path name="META-INF/services" /> </include-set> </exports> </system> </dependencies> </module>
I'm not sure if I need to export everything, but since it's not working, I've added all the paths.
I've added a Dependency to org.tritonus in the Manifest of my .ear, .ejb, and .web, but MPEG1L3 still does not come up as a supported conversion type.
Any help would be greatly appreciated.