summaryrefslogtreecommitdiff
path: root/songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-07-11 15:42:37 +0000
commit9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e (patch)
tree4c304cd4151020bd5494d279ee68a105ae3a5a3a /songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java
parentdfa8ecbe609ca8ea194d08560a44fb9a92e94b4b (diff)
downloadrockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.tar.gz
rockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.zip
Songdb java version, source. only 1.5 compatible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java')
-rw-r--r--songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java b/songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java
new file mode 100644
index 0000000000..d958fecf0d
--- /dev/null
+++ b/songdbj/org/tritonus/file/mpeg/MpegAudioFileWriter.java
@@ -0,0 +1,75 @@
1/*
2 * MpegAudioFileWriter.java
3 *
4 * This file is part of Tritonus: http://www.tritonus.org/
5 */
6
7/*
8 * Copyright (c) 2000 by Florian Bomers <http://www.bomers.de>
9 *
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Library General Public License as published
13 * by the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 */
26
27/*
28|<--- this code is formatted to fit into 80 columns --->|
29*/
30
31package org.tritonus.sampled.file.mpeg;
32
33import java.util.Arrays;
34
35import javax.sound.sampled.AudioFileFormat;
36import javax.sound.sampled.AudioFormat;
37
38import org.tritonus.share.TDebug;
39import org.tritonus.share.sampled.file.THeaderlessAudioFileWriter;
40
41
42
43/** Class for writing mpeg files
44 *
45 * @author Florian Bomers
46 */
47public class MpegAudioFileWriter extends THeaderlessAudioFileWriter {
48
49 private static final AudioFileFormat.Type[] FILE_TYPES = {
50 //new AudioFileFormat.Type("MPEG", "mpeg"),
51 // workaround for the fixed extension problem in AudioFileFormat.Type
52 // see org.tritonus.share.sampled.AudioFileTypes.java
53 new AudioFileFormat.Type("MP3", "mp3")
54 };
55
56 public static AudioFormat.Encoding MPEG1L3=new AudioFormat.Encoding("MPEG1L3");
57
58 private static final AudioFormat[] AUDIO_FORMATS = {
59 new AudioFormat(MPEG1L3, ALL, ALL, 1, ALL, ALL, false),
60 new AudioFormat(MPEG1L3, ALL, ALL, 1, ALL, ALL, true),
61 new AudioFormat(MPEG1L3, ALL, ALL, 2, ALL, ALL, false),
62 new AudioFormat(MPEG1L3, ALL, ALL, 2, ALL, ALL, true),
63 };
64
65 public MpegAudioFileWriter()
66 {
67 super(Arrays.asList(FILE_TYPES),
68 Arrays.asList(AUDIO_FORMATS));
69 if (TDebug.TraceAudioFileWriter) { TDebug.out("MpegAudioFileWriter.<init>(): begin"); }
70 if (TDebug.TraceAudioFileWriter) { TDebug.out("MpegAudioFileWriter.<init>(): end"); }
71 }
72}
73
74
75/*** MpegAudioFileWriter.java ***/