Bug 684 - Make JOAL Platform Agnostic for non J2SE VMs (Remove use of javax.sound; Replace WaveLoader code, ..)
Summary: Make JOAL Platform Agnostic for non J2SE VMs (Remove use of javax.sound; Repl...
Status: RESOLVED FIXED
Alias: None
Product: Joal
Classification: JogAmp
Component: core (show other bugs)
Version: 1.0
Hardware: All all
: P2 enhancement
Assignee: Xerxes Rånby
URL:
Depends on:
Blocks:
 
Reported: 2013-02-06 23:35 CET by Sven Gothel
Modified: 2014-02-21 15:00 CET (History)
3 users (show)

See Also:
Type: ---
SCM Refs:
6292ed9712b17f849f22221aea9d586c3a363c09 d199e6cdbf1fe1283bad79f68d05a9037a91863b
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2013-02-06 23:35:43 CET
Make JOAL javax.audio Agnostic for non J2SE VMs

- javax.sound.* cannot be used in JOAL
  since it's missing on Android and other java'ish subsets.

E.g.

import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;

- Hence the *Audio*Exception shall be replaced completely to our namespace,
  i.e. like com.jogamp.openal.UnsupportedAudioFileException

- WavLoader's wav parsing must be replaced platform agnostic ..
Comment 1 Sven Gothel 2013-02-06 23:38:38 CET
.. never mind 'compatibility' .. since it must run well on Android and other platforms.
Comment 2 Xerxes Rånby 2013-04-27 22:58:54 CEST
FFMPEG/libav can easily provide WAV file decoding, and may decode many more audio formats. The tricky part is to build and bundle native FFMPEG/libav libraries for all supported platforms. Thus this bug now depend on 686.
Comment 3 Sven Gothel 2013-04-27 23:27:24 CEST
(In reply to comment #2)
> FFMPEG/libav can easily provide WAV file decoding, and may decode many more
> audio formats. The tricky part is to build and bundle native FFMPEG/libav
> libraries for all supported platforms. Thus this bug now depend on 686.

There is nothing too special about wav, i.e. usually it's simply a header w/ 
followup PCM data. Hence only the header needs to be parsed, no WAV audio 
data needs to be decoded!

Julien already started some parsing support from Java.

Problem: Relying on FFMPEG/libav for JOAL would create a dependency not always fullfilled,
hence this is not a solution. 

Would love to see the Java WAV header parsing work getting matured

Removing dependency - impossible to support.
Comment 4 Xerxes Rånby 2013-04-27 23:38:55 CEST
Review and merge gouessej's JOAL fix: Removes all references to javax.sound.* in order to allow JOAL to work in non-J2SE environments:
https://github.com/gouessej/joal/commit/6292ed9712b17f849f22221aea9d586c3a363c09
Comment 5 Julien Gouesse 2013-04-28 11:01:43 CEST
Pure Java WAV/OGG parsing should be moved to JOAL-utils in order to keep the API modular as such services are already provided by other libraries based on JOAL (for example Paul Lamb's Sound Library) or it would be possible to have a JAR containing the core features and another one containing all features including our WAV/OGG parsing.
Comment 6 Xerxes Rånby 2013-07-13 23:38:13 CEST
Merged gouessej's fix into JOAL:
http://jogamp.org/git/?p=joal.git;a=commit;h=6292ed9712b17f849f22221aea9d586c3a363c09 - Removes all references to javax.sound.* in order to allow JOAL to work in non-J2SE environments.
Comment 7 Xerxes Rånby 2013-07-14 02:39:52 CEST
Proposed junit test: ALutWAVLoaderTest: Test WAV decoder impl. Bug 684 
https://github.com/xranby/joal/commit/f91cb9e643f26dfec259fd9de694c8c8fd2a127e
Comment 8 Sven Gothel 2014-02-21 15:00:37 CET
d199e6cdbf1fe1283bad79f68d05a9037a91863b
   WAVLoader: Use Bitstream and support big-endian RIFX; Fix ALutWAVLoaderTest

29094cdad91594a2f5defd967aab893887f10c81
   ALExtLoopbackDeviceSOFTTest: Remove javax.sound.sampled.UnsupportedAudioFileException dependency