ISDN byte streams are encoded as either u-Law (North America, Japan) or A-Law (most other countries) [2]
with the bit order 'swapped'.
Here in beautiful Lincolnshire (England, old world) the local telecoms use the A-Law coding.
What you need to do, to convert the raw network byte stream into something more useful is the following :
- The bits in every byte need to be 'swapped' like this : 0x00 -> 0x00, 0x01 -> 0x80, 0x02->0x40, 0x03->0xc0 ... [1]; (LawInputStream.java, LawOutputStream.java)
Now the bytes are coded as an A-Law stream or u-Law stream. - Optionally the Law stream can be converted into PCM-streams (see uk.co.mmscomputing.sound).
- This can now be packed into an audio file format (i.e.: MS-'wave', uk.co.mmscomputing.device.capi.CapiSystem, uk.co.mmscomputing.sound).
LawInputStream : Converts the incoming ISDN byte stream into A-Law or u-Law byte stream.
LawOutputStream : Converts an A-Law or u-Law byte stream into an outgoing ISDN byte stream.
PCMInputStream : Converts the incoming ISDN byte stream into a PCM byte stream.
PCMOutputStream : Converts a PCM byte stream into an outgoing ISDN byte stream.
The PCM-Format here is :
[1] caiviar project [last accessed : 2003-07-09]
[2] Willi-Hans Steeb; Mathematical Tools in Signal Processing with C++ and Java Simulations; International School for Scientific Computing
- uk.co.mmscomputing.sound:
Java classes that convert A-Law or u-Law byte streams into PCM byte streams or *.wav files and vice versa. A simple sound player and recorder