-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAVIPCMAudioCodec.java
More file actions
70 lines (65 loc) · 2.84 KB
/
AVIPCMAudioCodec.java
File metadata and controls
70 lines (65 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* @(#)PCMAudioCodec.java 1.0 2011-07-10
*
* Copyright (c) 2011 Werner Randelshofer, Immensee, Switzerland.
* All rights reserved.
*
* You may not use, copy or modify this file, except in compliance with the
* license agreement you entered into with Werner Randelshofer.
* For details see accompanying license terms.
*/
import org.monte.media.audio.*;
import org.monte.media.Format;
import java.nio.ByteOrder;
import java.util.Arrays;
import java.util.HashSet;
import static org.monte.media.AudioFormatKeys.*;
/**
* {@code PCMAudioCodec} performs sign conversion, endian conversion and
* quantization conversion of PCM audio data.
* <p>
* Does not perform sampling rate conversion or channel conversion.
* <p>
* FIXME Maybe create separate subclasses for AVI PCM and QuickTime PCM.
*
* @author Werner Randelshofer
* @version 1.0 2011-07-10 Created.
*/
public class AVIPCMAudioCodec extends PCMAudioCodec {
private final static HashSet<String> supportedEncodings = new HashSet<String>(
Arrays.asList(new String[]{
ENCODING_PCM_SIGNED,
ENCODING_PCM_UNSIGNED, ENCODING_AVI_PCM,}));
public AVIPCMAudioCodec() {
super(new Format[]{
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_PCM_SIGNED,//
MimeTypeKey,MIME_JAVA,//
SignedKey,true),//
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_PCM_UNSIGNED,//
MimeTypeKey,MIME_JAVA,//
SignedKey,false),//
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_AVI_PCM,//
MimeTypeKey,MIME_AVI,//
SignedKey,false,SampleSizeInBitsKey,8),//
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_AVI_PCM,//
MimeTypeKey,MIME_AVI,//
ByteOrderKey,ByteOrder.LITTLE_ENDIAN,
SignedKey,true,SampleSizeInBitsKey,16),//
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_AVI_PCM,//
MimeTypeKey,MIME_AVI,//
ByteOrderKey,ByteOrder.LITTLE_ENDIAN,
SignedKey,true,SampleSizeInBitsKey,24),//
new Format(MediaTypeKey,MediaType.AUDIO,//
EncodingKey,ENCODING_AVI_PCM,//
MimeTypeKey,MIME_AVI,//
ByteOrderKey,ByteOrder.LITTLE_ENDIAN,
SignedKey,true,SampleSizeInBitsKey,32),//
});
name="AVI PCM Codec";
}
}