You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(14) |
Dec
(33) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(68) |
Feb
(19) |
Mar
(6) |
Apr
(97) |
May
(15) |
Jun
(28) |
Jul
(83) |
Aug
(21) |
Sep
(67) |
Oct
(16) |
Nov
|
Dec
(22) |
| 2003 |
Jan
(47) |
Feb
(17) |
Mar
(5) |
Apr
|
May
(5) |
Jun
(106) |
Jul
(25) |
Aug
|
Sep
(14) |
Oct
(7) |
Nov
(24) |
Dec
(5) |
| 2004 |
Jan
(54) |
Feb
(19) |
Mar
|
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(153) |
Dec
(6) |
| 2005 |
Jan
(178) |
Feb
(17) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(2) |
Feb
(173) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
(14) |
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(29) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
(29) |
Feb
(3) |
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2013 |
Jan
(7) |
Feb
|
Mar
(18) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Matthias P. <pfi...@us...> - 2013-01-24 19:02:53
|
Update of /cvsroot/tritonus/tritonus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30781 Modified Files: version Log Message: new development version Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/version Index: version =================================================================== RCS file: /cvsroot/tritonus/tritonus/version,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** version 7 Jan 2008 16:16:50 -0000 1.3 --- version 24 Jan 2013 19:02:49 -0000 1.4 *************** *** 1 **** ! 0.3.7 \ No newline at end of file --- 1 ---- ! 0.3.8_beta01 \ No newline at end of file |
|
From: Matthias P. <pfi...@us...> - 2013-01-19 21:43:22
|
Update of /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15444/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm Modified Files: GSMDecoderFormatConversionProviderTest.java GSMEncoderFormatConversionProviderTest.java Log Message: - adapted WaveAudioFileReader for MS GSM - extended GSM FormatConversionProvider test cases Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm/GSMDecoderFormatConversionProviderTest.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm/GSMEncoderFormatConversionProviderTest.java Index: GSMDecoderFormatConversionProviderTest.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm/GSMDecoderFormatConversionProviderTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** GSMDecoderFormatConversionProviderTest.java 19 Jan 2013 21:15:09 -0000 1.1 --- GSMDecoderFormatConversionProviderTest.java 19 Jan 2013 21:43:19 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package org.tritonus.test.tritonus.sampled.convert.gsm; + import static javax.sound.sampled.AudioSystem.NOT_SPECIFIED; + import java.util.Arrays; import java.util.List; *************** *** 277,287 **** { testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, true), ALL, new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), ALL); testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), ALL, new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), ALL); } --- 279,305 ---- { testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, true), // ! NOT_SPECIFIED,// ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! NOT_SPECIFIED); ! testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, true), // ! 134,// ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! 160 * 134); ! testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), // ! NOT_SPECIFIED,// new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! NOT_SPECIFIED); testGetAudioInputStreamEncoding(Encoding.PCM_SIGNED, new AudioFormat( ! MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), // ! 134,// new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! 320 * 134); } *************** *** 299,306 **** new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, true), // ! ALL, // new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, 8000.0F, false), // ! ALL); testGetAudioInputStreamAudioFormat( // --- 317,342 ---- new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, true), // ! NOT_SPECIFIED, // ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! NOT_SPECIFIED); ! testGetAudioInputStreamAudioFormat(// ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, ALL, 1, 33, 50, ! true), // ! 134, // ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! 160 * 134); ! testGetAudioInputStreamAudioFormat( ! // ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false),// ! new AudioFormat(MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), // ! NOT_SPECIFIED,// new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, 8000.0F, false), // ! NOT_SPECIFIED); testGetAudioInputStreamAudioFormat( // *************** *** 308,314 **** 8000.0F, false),// new AudioFormat(MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), // ! ALL,// new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), ALL); } } --- 344,351 ---- 8000.0F, false),// new AudioFormat(MS_GSM_ENCODING, 8000.0F, ALL, 1, 65, 25, true), // ! 134,// new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! 320 * 134); } } Index: GSMEncoderFormatConversionProviderTest.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/gsm/GSMEncoderFormatConversionProviderTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** GSMEncoderFormatConversionProviderTest.java 19 Jan 2013 21:15:09 -0000 1.1 --- GSMEncoderFormatConversionProviderTest.java 19 Jan 2013 21:43:19 -0000 1.2 *************** *** 237,248 **** testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, true), NOT_SPECIFIED,// new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), NOT_SPECIFIED); testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), NOT_SPECIFIED,// new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), NOT_SPECIFIED); // wrong source PCM Encoding --- 237,266 ---- testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, true), // ! NOT_SPECIFIED,// new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), // ! NOT_SPECIFIED); ! testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, true), // ! 160 * 134,// ! new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), // ! 134); ! testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // ! new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! NOT_SPECIFIED,// ! new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), // ! NOT_SPECIFIED); testGetAudioInputStreamEncoding(TOAST_GSM_ENCODING, // new AudioFormat(Encoding.PCM_SIGNED, 8000.0F, 16, 1, 2, ! 8000.0F, false), // ! 160 * 134,// new AudioFormat(TOAST_GSM_ENCODING, 8000.0F, NOT_SPECIFIED, 1, ! 33, 50.0F, true), // ! 134); // wrong source PCM Encoding |
|
From: Matthias P. <pfi...@us...> - 2013-01-19 21:15:13
|
Update of /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14121/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert Added Files: AbstractFormatConversionProviderTest.java Log Message: - split Gsm FormatConversionProvider into two classes, one for decoding, one for encoding - Implemented support for encoding of Microsoft frame format of GSM 06.10 - added test cases for GSM format conversion providers Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert/AbstractFormatConversionProviderTest.java --- NEW FILE: AbstractFormatConversionProviderTest.java --- |
|
From: Matthias P. <pfi...@us...> - 2013-01-19 21:15:12
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14121/src/classes/org/tritonus/lowlevel/gsm Modified Files: Gsm_Def.java GSMDecoder.java Encoder.java Added Files: BitEncoder.java Log Message: - split Gsm FormatConversionProvider into two classes, one for decoding, one for encoding - Implemented support for encoding of Microsoft frame format of GSM 06.10 - added test cases for GSM format conversion providers Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/BitEncoder.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/Gsm_Def.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/Encoder.java --- NEW FILE: BitEncoder.java --- Index: Gsm_Def.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/Gsm_Def.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Gsm_Def.java 13 Jan 2013 23:54:06 -0000 1.2 --- Gsm_Def.java 19 Jan 2013 21:15:09 -0000 1.3 *************** *** 95,97 **** --- 95,104 ---- public static final short gsm_FAC[] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 }; + + /** + * Bit masks for obtaining the 1, 2, ..., or 7 lowest bits. The index into + * the array is equal to the number of bits to mask. + */ + public static final int[] BITMASKS = { 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, + 0x7F }; } Index: GSMDecoder.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** GSMDecoder.java 13 Jan 2013 23:56:11 -0000 1.5 --- GSMDecoder.java 19 Jan 2013 21:15:09 -0000 1.6 *************** *** 158,162 **** * byte array containing the coded frame * @param bufferStartOffset ! * TODO * @param firstHalfOfMicrosoftFrame * should be passed as <code>true</code> if the frame is the --- 158,162 ---- * byte array containing the coded frame * @param bufferStartOffset ! * offset into the array for the coded frame * @param firstHalfOfMicrosoftFrame * should be passed as <code>true</code> if the frame is the *************** *** 543,557 **** } - /** - * Bit masks for obtaining the 1, 2, ..., or 7 lowest bits. The index into - * the array is equal to the number of bits to mask. Used in - * {@link #getNextBits(int)}. - */ - private static final int[] BITMASKS = { 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, - 0x3F, 0x7F }; - private final int getNextBits(int bits) { ! int value = m_sr & BITMASKS[bits]; m_sr >>>= bits; return value; --- 543,549 ---- } private final int getNextBits(int bits) { ! int value = m_sr & Gsm_Def.BITMASKS[bits]; m_sr >>>= bits; return value; Index: Encoder.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/Encoder.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Encoder.java 13 Jan 2013 23:54:06 -0000 1.6 --- Encoder.java 19 Jan 2013 21:15:09 -0000 1.7 *************** *** 21,29 **** package org.tritonus.lowlevel.gsm; ! import java.io.*; public class Encoder ! { ! /* Every Encoder has a state through completion */ private Gsm_State g_s = new Gsm_State(); private Long_term lg_term_Obj = new Long_term(); --- 21,34 ---- package org.tritonus.lowlevel.gsm; ! import org.tritonus.lowlevel.gsm.BitEncoder.AllocationMode; + /** + * Encoder for GSM 06.10. + * + * @author Christopher Edwards + * @author Matthias Pfisterer + */ public class Encoder ! { /* Every Encoder has a state through completion */ private Gsm_State g_s = new Gsm_State(); private Long_term lg_term_Obj = new Long_term(); *************** *** 47,224 **** /* Reads 160 bytes */ private int[] input_signal = new int[160]; /* [0..159] OUT */ - /* Writes 33 bytes */ - private byte[] frame = new byte[Gsm_Def.FRAME_SIZE]; ! /** ! * Encoder class constructor. ! */ ! public Encoder() ! { ! } ! ! /** ! * Remove the header info from the stream and verifies the file type. As ! * defined by the NeXT/Sun audio file format U-law (.au). For more info see ! * the README file. <br> ! * <br> ! * Note: Most of this info is not needed to reproduce the sound file after ! * encoding. All that is needed is the magic number and the sampling rate to ! * reproduce the sound file during decoding. ! * ! * @param in ! * Strip the header from a Sun/Next formated sound stream. ! */ ! public static void stripAUHeader(InputStream in) throws Exception ! { ! DataInputStream input = new DataInputStream(in); ! ! /* Just read these bits from the stream and do nothing with them */ ! int magic = input.readInt(); /* ! * magic number SND_MAGIC ! * ((int)0x2e736e64), which equals ".snd".) ! */ ! input.readInt(); /* offset or pointer to the data */ ! input.readInt(); /* number of bytes of data */ ! int dataFormat = input.readInt(); /* the data format code */ ! int sampleRate = input.readInt(); /* ! * the sampling rate = ~8000 ! * samples/sec. ! */ ! input.readInt(); /* the number of channels */ ! input.readChar(); /* optional text information - 4 chars */ ! input.readChar(); ! input.readChar(); ! input.readChar(); ! ! if (magic != 0x2E736E64) // ".snd" in ASCII ! { ! // throw new GsmException("AuFile wrong Magic Number"); ! } ! else if (dataFormat != 1) // 8-Bit mu-Law ! { ! // throw new GsmException("AuFile not 8-bit Mu-Law"); ! } ! else if (sampleRate != 8000) // 8kHz ! { ! // throw new GsmException("AuFile not 8kHz"); ! } ! } /** ! * Encode the specified file. <br> ! * This method calls the <code>stripAUHeader</code> method for you.<br> ! * stripAUHeader will verify file type. * ! * @param input_file ! * The name of the file to encode. ! * @param output_file ! * The name of the GSM encoded file. */ ! public void encode(String input_file, String output_file) throws Exception { ! ! File arg1 = new File(input_file); ! if (!arg1.exists() || !arg1.isFile() || !arg1.canRead()) ! { ! throw new IOException("File : " + input_file ! + "\ndoes not exist or cannot be read."); ! } ! ! FileInputStream from = null; ! FileOutputStream to = null; ! try ! { ! from = new FileInputStream(input_file); ! to = new FileOutputStream(output_file); ! ! // Remove the header. It gets mangled by the encoding. ! stripAUHeader(from); ! ! // Read bytes till EOF. ! while (ulaw_input(from) > 0) ! { ! // System.out.println("Entering Native method."); ! gsm_encode(); ! ! // Need to do some error check here. Update ulaw_output. ! ulaw_output(to); // Write bytes. ! } ! ! } ! catch (Exception e) ! { ! throw new Exception("Encoder: " + e.getMessage()); ! } ! finally ! { ! if (from != null) ! { ! try ! { ! from.close(); ! } ! catch (IOException e) ! { ! throw new IOException("Encoder: " + e.getMessage()); ! } ! } ! if (to != null) ! { ! try ! { ! to.close(); ! } ! catch (IOException e) ! { ! throw new IOException("Encoder: " + e.getMessage()); ! } ! } ! } ! } ! ! /** ! * Encode the specified InputStream. ! * ! * @param input ! * The stream to encode. ! * @param output_file ! * The name of the GSM encoded file. ! */ ! public void encode(InputStream input, String output_file) ! throws IOException ! { ! FileOutputStream to = null; ! try ! { ! to = new FileOutputStream(output_file); ! ! // Read bytes till EOF. ! while (ulaw_input(input) > 0) ! { ! gsm_encode(); ! ! // Need to do some error check here. Update ulaw_output. ! ulaw_output(to); // Write bytes. ! } ! ! } ! catch (IOException e) ! { ! throw new IOException("Encoder: " + e.getMessage()); ! } ! finally ! { ! if (to != null) ! { ! try ! { ! to.close(); ! } ! catch (IOException e) ! { ! throw new IOException("Encoder: " + e.getMessage()); ! } ! } ! } } --- 52,67 ---- /* Reads 160 bytes */ private int[] input_signal = new int[160]; /* [0..159] OUT */ ! private GsmFrameFormat gsmFrameFormat; /** ! * Constructor. * ! * @param gsmFrameFormat ! * the format of the GSM frames to produce */ ! public Encoder(GsmFrameFormat gsmFrameFormat) { ! this.gsmFrameFormat = gsmFrameFormat; } *************** *** 227,275 **** * * @param asBuffer ! * an 160-element array with the data to encode int PCM 16 bit ! * format. ! * * @param abFrame ! * the encoded GSM frame (33 bytes). */ public void encode(short[] asBuffer, byte[] abFrame) { for (int i = 0; i < 160; i++) { input_signal[i] = asBuffer[i]; } ! gsm_encode(); ! System.arraycopy(frame, 0, abFrame, 0, frame.length); ! } ! ! /** ! * Read 160 bytes from a U-law stream and set up the input_signal array. ! */ ! private int ulaw_input(InputStream in) throws IOException ! { ! int c = 0; ! int i = 0; ! ! for (i = 0; i < input_signal.length && ((c = in.read()) != -1); i++) { ! if (c < 0) ! { ! throw new IOException( ! "Encoder ulaw_input: Corrupt InputStream."); ! } ! else { ! input_signal[i] = u2s[c]; } } ! return (i); } ! private void gsm_encode() { - int index = 0; - - Gsm_Coder_java(); - frame[index++] = (byte) (((0xD) << 4) /* 1 */ | ((LARc[0] >> 2) & 0xF)); --- 70,203 ---- * * @param asBuffer ! * an 160-element (for "toast" frame format) or 320-element array ! * (for Microsoft frame format) with the data to encode in PCM ! * signed 16 bit format * @param abFrame ! * the encoded GSM frame (33 or 65 bytes, depending on the frame ! * format). */ public void encode(short[] asBuffer, byte[] abFrame) { + BitEncoder bitEncoder; + switch (gsmFrameFormat) + { + case TOAST: + bitEncoder = new BitEncoder(abFrame, AllocationMode.MSBitFirst); + bitEncoder.addBits(0xD, 4); + break; + case MICROSOFT: + bitEncoder = new BitEncoder(abFrame, AllocationMode.LSBitFirst); + break; + default: + throw new RuntimeException("Unhandled GSM frame format"); + } for (int i = 0; i < 160; i++) { input_signal[i] = asBuffer[i]; } ! Gsm_Coder_java(); ! implodeFrameGeneric(bitEncoder); ! if (gsmFrameFormat == GsmFrameFormat.MICROSOFT) { ! for (int i = 0; i < 160; i++) { ! input_signal[i] = asBuffer[i + 160]; } + Gsm_Coder_java(); + implodeFrameGeneric(bitEncoder); } ! ! // byte[] frameold = new byte[33]; ! // implodeFrame(frameold, index); ! // System.arraycopy(frame, 0, abFrame, 0, frame.length); ! } ! ! private void implodeFrameGeneric(BitEncoder bitEncoder) ! { ! bitEncoder.addBits(LARc[0], 6); ! bitEncoder.addBits(LARc[1], 6); ! bitEncoder.addBits(LARc[2], 5); ! bitEncoder.addBits(LARc[3], 5); ! bitEncoder.addBits(LARc[4], 4); ! bitEncoder.addBits(LARc[5], 4); ! bitEncoder.addBits(LARc[6], 3); ! bitEncoder.addBits(LARc[7], 3); ! ! bitEncoder.addBits(Nc[0], 7); ! bitEncoder.addBits(bc[0], 2); ! bitEncoder.addBits(Mc[0], 2); ! bitEncoder.addBits(xmaxc[0], 6); ! bitEncoder.addBits(xmc[0], 3); ! bitEncoder.addBits(xmc[1], 3); ! bitEncoder.addBits(xmc[2], 3); ! bitEncoder.addBits(xmc[3], 3); ! bitEncoder.addBits(xmc[4], 3); ! bitEncoder.addBits(xmc[5], 3); ! bitEncoder.addBits(xmc[6], 3); ! bitEncoder.addBits(xmc[7], 3); ! bitEncoder.addBits(xmc[8], 3); ! bitEncoder.addBits(xmc[9], 3); ! bitEncoder.addBits(xmc[10], 3); ! bitEncoder.addBits(xmc[11], 3); ! bitEncoder.addBits(xmc[12], 3); ! ! bitEncoder.addBits(Nc[1], 7); ! bitEncoder.addBits(bc[1], 2); ! bitEncoder.addBits(Mc[1], 2); ! bitEncoder.addBits(xmaxc[1], 6); ! bitEncoder.addBits(xmc[13], 3); ! bitEncoder.addBits(xmc[14], 3); ! bitEncoder.addBits(xmc[15], 3); ! bitEncoder.addBits(xmc[16], 3); ! bitEncoder.addBits(xmc[17], 3); ! bitEncoder.addBits(xmc[18], 3); ! bitEncoder.addBits(xmc[19], 3); ! bitEncoder.addBits(xmc[20], 3); ! bitEncoder.addBits(xmc[21], 3); ! bitEncoder.addBits(xmc[22], 3); ! bitEncoder.addBits(xmc[23], 3); ! bitEncoder.addBits(xmc[24], 3); ! bitEncoder.addBits(xmc[25], 3); ! ! bitEncoder.addBits(Nc[2], 7); ! bitEncoder.addBits(bc[2], 2); ! bitEncoder.addBits(Mc[2], 2); ! bitEncoder.addBits(xmaxc[2], 6); ! bitEncoder.addBits(xmc[26], 3); ! bitEncoder.addBits(xmc[27], 3); ! bitEncoder.addBits(xmc[28], 3); ! bitEncoder.addBits(xmc[29], 3); ! bitEncoder.addBits(xmc[30], 3); ! bitEncoder.addBits(xmc[31], 3); ! bitEncoder.addBits(xmc[32], 3); ! bitEncoder.addBits(xmc[33], 3); ! bitEncoder.addBits(xmc[34], 3); ! bitEncoder.addBits(xmc[35], 3); ! bitEncoder.addBits(xmc[36], 3); ! bitEncoder.addBits(xmc[37], 3); ! bitEncoder.addBits(xmc[38], 3); ! ! bitEncoder.addBits(Nc[3], 7); ! bitEncoder.addBits(bc[3], 2); ! bitEncoder.addBits(Mc[3], 2); ! bitEncoder.addBits(xmaxc[3], 6); ! bitEncoder.addBits(xmc[39], 3); ! bitEncoder.addBits(xmc[40], 3); ! bitEncoder.addBits(xmc[41], 3); ! bitEncoder.addBits(xmc[42], 3); ! bitEncoder.addBits(xmc[43], 3); ! bitEncoder.addBits(xmc[44], 3); ! bitEncoder.addBits(xmc[45], 3); ! bitEncoder.addBits(xmc[46], 3); ! bitEncoder.addBits(xmc[47], 3); ! bitEncoder.addBits(xmc[48], 3); ! bitEncoder.addBits(xmc[49], 3); ! bitEncoder.addBits(xmc[50], 3); ! bitEncoder.addBits(xmc[51], 3); } ! // TODO (GSM) remove ! private void implodeFrameOld(byte[] frame, int index) { frame[index++] = (byte) (((0xD) << 4) /* 1 */ | ((LARc[0] >> 2) & 0xF)); *************** *** 481,538 **** g_s.setMp(mp); } - - /* Write the encoded bytes to the stream. */ - private void ulaw_output(FileOutputStream out) throws IOException - { - int i = 0; - for (i = 0; i < frame.length; i++) - { - out.write(frame[i]); - } - } - - /** - * Used for debugging. - * - * @param state - * The Gsm_State object to be viewed. - */ - private void dump_Gsm_State(Gsm_State state) - { - state.dump_Gsm_State(); - } - - /* - * This is the encoding matrix. - * - * Java does not have an unsigned short, ie. 16 bits, so I will use the - * upper 16 bits of the integer. This wastes a little memory although I do - * not think it will cause a problem. - */ - private static final int u2s[] = { 33280, 34308, 35336, 36364, 37393, - 38421, 39449, 40477, 41505, 42534, 43562, 44590, 45618, 46647, - 47675, 48703, 49474, 49988, 50503, 51017, 51531, 52045, 52559, - 53073, 53587, 54101, 54616, 55130, 55644, 56158, 56672, 57186, - 57572, 57829, 58086, 58343, 58600, 58857, 59114, 59371, 59628, - 59885, 60142, 60399, 60656, 60913, 61171, 61428, 61620, 61749, - 61877, 62006, 62134, 62263, 62392, 62520, 62649, 62777, 62906, - 63034, 63163, 63291, 63420, 63548, 63645, 63709, 63773, 63838, - 63902, 63966, 64030, 64095, 64159, 64223, 64287, 64352, 64416, - 64480, 64544, 64609, 64657, 64689, 64721, 64753, 64785, 64818, - 64850, 64882, 64914, 64946, 64978, 65010, 65042, 65075, 65107, - 65139, 65163, 65179, 65195, 65211, 65227, 65243, 65259, 65275, - 65291, 65308, 65324, 65340, 65356, 65372, 65388, 65404, 65416, - 65424, 65432, 65440, 65448, 65456, 65464, 65472, 65480, 65488, - 65496, 65504, 65512, 65520, 65528, 0, 32256, 31228, 30200, 29172, - 28143, 27115, 26087, 25059, 24031, 23002, 21974, 20946, 19918, - 18889, 17861, 16833, 16062, 15548, 15033, 14519, 14005, 13491, - 12977, 12463, 11949, 11435, 10920, 10406, 9892, 9378, 8864, 8350, - 7964, 7707, 7450, 7193, 6936, 6679, 6422, 6165, 5908, 5651, 5394, - 5137, 4880, 4623, 4365, 4108, 3916, 3787, 3659, 3530, 3402, 3273, - 3144, 3016, 2887, 2759, 2630, 2502, 2373, 2245, 2116, 1988, 1891, - 1827, 1763, 1698, 1634, 1570, 1506, 1441, 1377, 1313, 1249, 1184, - 1120, 1056, 992, 927, 879, 847, 815, 783, 751, 718, 686, 654, 622, - 590, 558, 526, 494, 461, 429, 397, 373, 357, 341, 325, 309, 293, - 277, 261, 245, 228, 212, 196, 180, 164, 148, 132, 120, 112, 104, - 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 }; } --- 409,411 ---- |
|
From: Matthias P. <pfi...@us...> - 2013-01-19 21:15:05
|
Update of /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14087/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert Log Message: Directory /cvsroot/tritonus/tritonus/test/suite/src/classes/org/tritonus/test/tritonus/sampled/convert added to the repository Direct links to online-CVS: |
|
From: Matthias P. <pfi...@us...> - 2013-01-13 23:56:14
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8795/src/classes/org/tritonus/lowlevel/gsm Modified Files: GSMDecoder.java Log Message: Reformatted code Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java Index: GSMDecoder.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** GSMDecoder.java 13 Jan 2013 23:39:26 -0000 1.4 --- GSMDecoder.java 13 Jan 2013 23:56:11 -0000 1.5 *************** *** 421,425 **** m_frame_chain = m_sr & 0xf; ! } else { m_sr = m_frame_chain; --- 421,426 ---- m_frame_chain = m_sr & 0xf; ! } ! else { m_sr = m_frame_chain; *************** *** 566,570 **** { System.out.print(","); ! } else { System.out.println("]"); --- 567,572 ---- { System.out.print(","); ! } ! else { System.out.println("]"); *************** *** 653,657 **** exp = -4; mant = 7; ! } else { while (mant <= 7) --- 655,660 ---- exp = -4; mant = 7; ! } ! else { while (mant <= 7) *************** *** 941,945 **** : ((temp < 20070) ? temp + 11059 : add((temp >> 2), 26112)))); ! } else { temp = LARp[i]; --- 944,949 ---- : ((temp < 20070) ? temp + 11059 : add((temp >> 2), 26112)))); ! } ! else { temp = LARp[i]; *************** *** 1017,1021 **** ep[epo++] = 0; ep[epo++] = xMp[po++]; ! } while (--i > 0); while (++Mc < 4) --- 1021,1026 ---- ep[epo++] = 0; ep[epo++] = xMp[po++]; ! } ! while (--i > 0); while (++Mc < 4) |
|
From: Matthias P. <pfi...@us...> - 2013-01-13 23:39:30
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7208/src/classes/org/tritonus/lowlevel/gsm Modified Files: GSMDecoder.java Added Files: GsmConstants.java GsmFrameFormat.java Log Message: Implemented support for decoding of Microsoft frame format of GSM 06.10 Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GsmConstants.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GsmFrameFormat.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java --- NEW FILE: GsmConstants.java --- --- NEW FILE: GsmFrameFormat.java --- Index: GSMDecoder.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/lowlevel/gsm/GSMDecoder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** GSMDecoder.java 13 Feb 2006 17:40:04 -0000 1.3 --- GSMDecoder.java 13 Jan 2013 23:39:26 -0000 1.4 *************** *** 18,23 **** // Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - // This software is a port of the GSM Library provided by // Jutta Degener (ju...@cs...) and --- 18,21 ---- *************** *** 27,799 **** package org.tritonus.lowlevel.gsm; [...1759 lines suppressed...] ! } ! ; ! ! do ! { ! ep[epo++] = 0; ! ep[epo++] = 0; ! ep[epo++] = xMp[po++]; ! } while (--i > 0); ! ! while (++Mc < 4) ! { ! ep[epo++] = 0; ! } ! } } /*** GSMDecoder.java ***/ |
|
From: Florian B. <fl...@us...> - 2009-10-30 10:55:55
|
Update of /cvsroot/tritonus/tritonus/src/lib/lame In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9931/src/lib/lame Modified Files: org_tritonus_lowlevel_lame_Lame.c Log Message: fix LAME for Linux/64-bits Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/lib/lame/org_tritonus_lowlevel_lame_Lame.c Index: org_tritonus_lowlevel_lame_Lame.c =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/lib/lame/org_tritonus_lowlevel_lame_Lame.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** org_tritonus_lowlevel_lame_Lame.c 26 Apr 2004 00:35:38 -0000 1.8 --- org_tritonus_lowlevel_lame_Lame.c 30 Oct 2009 10:55:42 -0000 1.9 *************** *** 76,83 **** } static LameConf* getNativeGlobalFlags(JNIEnv *env, jobject obj) { jfieldID fieldID = getNativeGlobalFlagsFieldID(env); ! return (LameConf*) ((unsigned int) (*env)->GetLongField(env, obj, fieldID)); } --- 76,86 ---- } + #ifndef _WIN32 + typedef unsigned long UINT_PTR; + #endif static LameConf* getNativeGlobalFlags(JNIEnv *env, jobject obj) { jfieldID fieldID = getNativeGlobalFlagsFieldID(env); ! return (LameConf*) ((UINT_PTR) (*env)->GetLongField(env, obj, fieldID)); } *************** *** 85,89 **** static void setNativeGlobalFlags(JNIEnv *env, jobject obj, LameConf* flags) { jfieldID fieldID = getNativeGlobalFlagsFieldID(env); ! (*env)->SetLongField(env, obj, fieldID, (jlong) ((unsigned int) flags)); } --- 88,92 ---- static void setNativeGlobalFlags(JNIEnv *env, jobject obj, LameConf* flags) { jfieldID fieldID = getNativeGlobalFlagsFieldID(env); ! (*env)->SetLongField(env, obj, fieldID, (jlong) ((UINT_PTR) flags)); } |
|
From: Florian B. <fl...@us...> - 2009-03-16 20:49:17
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18946/src/classes/org/tritonus/sampled/file Modified Files: WaveAudioOutputStream.java Log Message: Better handle length==-1 when writing WAVE files. Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/file/WaveAudioOutputStream.java Index: WaveAudioOutputStream.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/WaveAudioOutputStream.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** WaveAudioOutputStream.java 3 Jun 2007 19:50:12 -0000 1.3 --- WaveAudioOutputStream.java 16 Mar 2009 20:49:00 -0000 1.4 *************** *** 40,44 **** import org.tritonus.share.sampled.file.TDataOutputStream; - /** * AudioOutputStream for Wave files. --- 40,43 ---- *************** *** 85,88 **** --- 84,88 ---- } + @Override protected void writeHeader() throws IOException { *************** *** 107,122 **** // writing of the header, just truncate the size fields, don't throw an exception if (lLength != AudioSystem.NOT_SPECIFIED ! && lLength+dataOffset>0xFFFFFFFFl) { ! lLength=0xFFFFFFFFl-dataOffset; } // chunks must be on word-boundaries ! long lDataChunkSize=lLength+(lLength%2); TDataOutputStream dos = getDataOutputStream(); // write RIFF container chunk dos.writeInt(WaveTool.WAVE_RIFF_MAGIC); ! dos.writeLittleEndian32((int) ((lDataChunkSize+dataOffset-WaveTool.CHUNK_HEADER_SIZE) ! & 0xFFFFFFFF)); dos.writeInt(WaveTool.WAVE_WAVE_MAGIC); --- 107,130 ---- // writing of the header, just truncate the size fields, don't throw an exception if (lLength != AudioSystem.NOT_SPECIFIED ! && lLength+dataOffset>0xFFFFFFFFL) { ! lLength=0xFFFFFFFFL-dataOffset; } // chunks must be on word-boundaries ! long lDataChunkSize = lLength+(lLength%2); ! if (lLength == AudioSystem.NOT_SPECIFIED || lDataChunkSize > 0xFFFFFFFFL) { ! lDataChunkSize = 0xFFFFFFFFL; ! } ! ! long RIFF_Size = lDataChunkSize+dataOffset-WaveTool.CHUNK_HEADER_SIZE; ! if (lLength == AudioSystem.NOT_SPECIFIED || RIFF_Size > 0xFFFFFFFFL) { ! RIFF_Size = 0xFFFFFFFFL; ! } ! TDataOutputStream dos = getDataOutputStream(); // write RIFF container chunk dos.writeInt(WaveTool.WAVE_RIFF_MAGIC); ! dos.writeLittleEndian32((int) RIFF_Size); dos.writeInt(WaveTool.WAVE_WAVE_MAGIC); *************** *** 157,171 **** ! if (formatCode!=WaveTool.WAVE_FORMAT_PCM) { // write "fact" chunk: number of samples // todo: add this as an attribute or property // in AudioOutputStream or AudioInputStream long samples=0; ! if (lLength!=AudioSystem.NOT_SPECIFIED) { ! samples=lLength/format.getFrameSize()*decodedSamplesPerBlock; } // saturate sample count ! if (samples>0xFFFFFFFFl) { ! samples=(0xFFFFFFFFl/decodedSamplesPerBlock)*decodedSamplesPerBlock; } dos.writeInt(WaveTool.WAVE_FACT_MAGIC); --- 165,179 ---- ! if (formatCode != WaveTool.WAVE_FORMAT_PCM) { // write "fact" chunk: number of samples // todo: add this as an attribute or property // in AudioOutputStream or AudioInputStream long samples=0; ! if (lLength != AudioSystem.NOT_SPECIFIED) { ! samples = lLength / format.getFrameSize() * decodedSamplesPerBlock; } // saturate sample count ! if (samples>0xFFFFFFFFL) { ! samples = (0xFFFFFFFFL/decodedSamplesPerBlock)*decodedSamplesPerBlock; } dos.writeInt(WaveTool.WAVE_FACT_MAGIC); *************** *** 176,182 **** // write header of data chunk dos.writeInt(WaveTool.WAVE_DATA_MAGIC); ! dos.writeLittleEndian32((lLength!=AudioSystem.NOT_SPECIFIED)?((int) lLength):LENGTH_NOT_KNOWN); } protected void patchHeader() throws IOException { --- 184,191 ---- // write header of data chunk dos.writeInt(WaveTool.WAVE_DATA_MAGIC); ! dos.writeLittleEndian32((lLength != AudioSystem.NOT_SPECIFIED)?((int) lLength):LENGTH_NOT_KNOWN); } + @Override protected void patchHeader() throws IOException { *************** *** 187,190 **** --- 196,200 ---- } + @Override public void close() throws IOException { long nBytesWritten=getCalculatedLength(); |
|
From: Florian B. <fl...@us...> - 2009-03-16 09:17:44
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4791/src/classes/org/tritonus/share/sampled/file Modified Files: TAudioFileReader.java Log Message: change back to creating buffered input stream in getAudioFileFormat( InputStream inputStream, long lFileLengthInBytes) and not before. Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java Index: TAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** TAudioFileReader.java 5 Mar 2009 20:38:42 -0000 1.5 --- TAudioFileReader.java 16 Mar 2009 09:17:33 -0000 1.6 *************** *** 178,181 **** --- 178,184 ---- if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(InputStream): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; + if (!inputStream.markSupported()) { + inputStream = new BufferedInputStream(inputStream, getMarkLimit()); + } inputStream.mark(getMarkLimit()); AudioFileFormat audioFileFormat = null; *************** *** 198,225 **** ! /** Get an AudioFileFormat (internal implementation). ! Subclasses must implement this method in a way specific ! to the file format they handle. ! ! Note that depending on the implementation of this method, ! you should or should not override ! getAudioInputStream(InputStream, long), too (see comment ! there). ! ! @param inputStream The InputStream to read from. ! @param lFileLengthInBytes The size of the originating ! file, if known. If it isn't known, AudioSystem.NOT_SPECIFIED ! should be passed. This value may be used for byteLength in ! AudioFileFormat, if this value can't be derived from the ! informmation in the file header. ! ! @return an AudioFileFormat instance containing ! information from the header of the stream passed in as ! inputStream. ! */ protected abstract AudioFileFormat getAudioFileFormat( ! InputStream inputStream, ! long lFileLengthInBytes) ! throws UnsupportedAudioFileException, IOException; --- 201,225 ---- ! /** ! * Get an AudioFileFormat (internal implementation). Subclasses must ! * implement this method in a way specific to the file format they handle. ! * Note that depending on the implementation of this method, you should or ! * should not override getAudioInputStream(InputStream, long), too (see ! * comment there). ! * ! * @param inputStream The InputStream to read from. It should be tested if ! * it is markable. If not, and it is re-reading, wrap it into a ! * BufferedInputStream with getMarkLimit() size. ! * @param lFileLengthInBytes The size of the originating file, if known. If ! * it isn't known, AudioSystem.NOT_SPECIFIED should be passed. ! * This value may be used for byteLength in AudioFileFormat, if ! * this value can't be derived from the informmation in the file ! * header. ! * @return an AudioFileFormat instance containing information from the ! * header of the stream passed in as inputStream. ! */ protected abstract AudioFileFormat getAudioFileFormat( ! InputStream inputStream, long lFileLengthInBytes) ! throws UnsupportedAudioFileException, IOException; *************** *** 321,324 **** --- 321,327 ---- long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; AudioInputStream audioInputStream = null; + if (!inputStream.markSupported()) { + inputStream = new BufferedInputStream(inputStream, getMarkLimit()); + } inputStream.mark(getMarkLimit()); try *************** *** 349,394 **** ! /** Get an AudioInputStream (internal implementation). ! This implementation calls getAudioFileFormat() with the ! same arguments as passed in here. Then, it constructs ! an AudioInputStream instance. This instance takes the passed ! inputStream in the state it is left after getAudioFileFormat() ! did its work. In other words, the implementation here ! assumes that getAudioFileFormat() reads the entire header ! up to a position exactely where the audio data starts. ! If this can't be realized for a certain format, this method ! should be overridden. ! ! @param inputStream The InputStream to read from. ! @param lFileLengthInBytes The size of the originating ! file, if known. If it isn't known, AudioSystem.NOT_SPECIFIED ! should be passed. This value may be used for byteLength in ! AudioFileFormat, if this value can't be derived from the ! information in the file header. ! */ ! protected AudioInputStream getAudioInputStream(InputStream inputStream, long lFileLengthInBytes) ! throws UnsupportedAudioFileException, IOException ! { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): begin (class: "+getClass().getSimpleName()+")"); } ! if (isRereading()) ! { ! if (TDebug.TraceAudioFileReader) {TDebug.out(" -inputStream is class "+inputStream.getClass()); } ! if (TDebug.TraceAudioFileReader) {TDebug.out(" -decorating inputStream as BufferedInputStream"); } ! //$$fb do not optimize by checking for ! // -BufferedInputStream: markLimit may not be sufficient ! // -FileInputStream: mark/reset not supported. ! inputStream = new BufferedInputStream(inputStream, getMarkLimit()); inputStream.mark(getMarkLimit()); } ! AudioFileFormat audioFileFormat = getAudioFileFormat(inputStream, lFileLengthInBytes); ! if (isRereading()) ! { inputStream.reset(); } ! AudioInputStream audioInputStream = ! new AudioInputStream(inputStream, ! audioFileFormat.getFormat(), ! audioFileFormat.getFrameLength()); ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): end"); } return audioInputStream; } --- 352,398 ---- ! /** ! * Get an AudioInputStream (internal implementation). This implementation ! * calls getAudioFileFormat() with the same arguments as passed in here. ! * Then, it constructs an AudioInputStream instance. This instance takes the ! * passed inputStream in the state it is left after getAudioFileFormat() did ! * its work. In other words, the implementation here assumes that ! * getAudioFileFormat() reads the entire header up to a position exactly ! * where the audio data starts. If this can't be realized for a certain ! * format, this method should be overridden. ! * ! * @param inputStream The InputStream to read from. It should be tested if ! * it is markable. If not, and it is re-reading, wrap it into a ! * BufferedInputStream with getMarkLimit() size. ! * @param lFileLengthInBytes The size of the originating file, if known. If ! * it isn't known, AudioSystem.NOT_SPECIFIED should be passed. ! * This value may be used for byteLength in AudioFileFormat, if ! * this value can't be derived from the information in the file ! * header. ! */ ! protected AudioInputStream getAudioInputStream(InputStream inputStream, ! long lFileLengthInBytes) throws UnsupportedAudioFileException, ! IOException { ! if (TDebug.TraceAudioFileReader) { ! TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): begin (class: " ! + getClass().getSimpleName() + ")"); ! } ! if (isRereading()) { ! if (!inputStream.markSupported()) { ! inputStream = new BufferedInputStream(inputStream, ! getMarkLimit()); ! } inputStream.mark(getMarkLimit()); } ! AudioFileFormat audioFileFormat = getAudioFileFormat(inputStream, ! lFileLengthInBytes); ! if (isRereading()) { inputStream.reset(); } ! AudioInputStream audioInputStream = new AudioInputStream(inputStream, ! audioFileFormat.getFormat(), audioFileFormat.getFrameLength()); ! if (TDebug.TraceAudioFileReader) { ! TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): end"); ! } return audioInputStream; } |
|
From: Florian B. <fl...@us...> - 2009-03-05 20:38:52
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15484/src/classes/org/tritonus/share/sampled/file Modified Files: TAudioFileReader.java Log Message: add cause to exception if thrown in exception handler Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java Index: TAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TAudioFileReader.java 9 Nov 2008 22:45:28 -0000 1.4 --- TAudioFileReader.java 5 Mar 2009 20:38:42 -0000 1.5 *************** *** 333,337 **** catch (IOException e) { ! inputStream.reset(); throw e; } --- 333,344 ---- catch (IOException e) { ! try { ! inputStream.reset(); ! } catch (IOException e2) { ! if (e2.getCause() == null) { ! e2.initCause(e); ! throw e2; ! } ! } throw e; } *************** *** 358,362 **** should be passed. This value may be used for byteLength in AudioFileFormat, if this value can't be derived from the ! informmation in the file header. */ protected AudioInputStream getAudioInputStream(InputStream inputStream, long lFileLengthInBytes) --- 365,369 ---- should be passed. This value may be used for byteLength in AudioFileFormat, if this value can't be derived from the ! information in the file header. */ protected AudioInputStream getAudioInputStream(InputStream inputStream, long lFileLengthInBytes) |
|
From: Florian B. <fl...@us...> - 2008-11-09 22:45:36
|
Update of /cvsroot/tritonus/tritonus/src/org/tritonus/sampled/convert/javalayer In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1018/src/org/tritonus/sampled/convert/javalayer Modified Files: MpegFormatConversionProvider.java Log Message: - improved debugging - mp3 conversion provider: - clean up - make sure that it really only converts formats that are supported - add unit test - use MP3 alias for MPEG2L3 (since JavaZoom uses that) - depend on jl1.0.jar rather than javalayer.jar - update instructions (fixes funded by Eduard van den Bongard, thanks!) Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/org/tritonus/sampled/convert/javalayer/MpegFormatConversionProvider.java Index: MpegFormatConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/org/tritonus/sampled/convert/javalayer/MpegFormatConversionProvider.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** MpegFormatConversionProvider.java 7 Jan 2008 16:15:33 -0000 1.10 --- MpegFormatConversionProvider.java 9 Nov 2008 22:45:28 -0000 1.11 *************** *** 7,10 **** --- 7,11 ---- /* * Copyright (c) 1999 - 2004 by Matthias Pfisterer + * Copyright (c) 2008 by Florian Bomers * * This program is free software; you can redistribute it and/or modify *************** *** 30,33 **** --- 31,35 ---- package org.tritonus.sampled.convert.javalayer; + import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; *************** *** 40,43 **** --- 42,46 ---- import org.tritonus.share.TDebug; + import org.tritonus.share.sampled.AudioUtils; import org.tritonus.share.sampled.TConversionTool; import org.tritonus.share.sampled.convert.TEncodingFormatConversionProvider; *************** *** 52,58 **** /** ! * ConversionProvider for decoding of mp3 files. * * @author Matthias Pfisterer */ --- 55,62 ---- /** ! * ConversionProvider for decoding mp3 files. * * @author Matthias Pfisterer + * @author Florian Bomers */ *************** *** 61,68 **** extends TEncodingFormatConversionProvider { - // only used as abbreviation public static final AudioFormat.Encoding MPEG1L1 = new AudioFormat.Encoding("MPEG1L1"); public static final AudioFormat.Encoding MPEG1L2 = new AudioFormat.Encoding("MPEG1L2"); public static final AudioFormat.Encoding MPEG1L3 = new AudioFormat.Encoding("MPEG1L3"); public static final AudioFormat.Encoding MPEG2L1 = new AudioFormat.Encoding("MPEG2L1"); public static final AudioFormat.Encoding MPEG2L2 = new AudioFormat.Encoding("MPEG2L2"); --- 65,72 ---- extends TEncodingFormatConversionProvider { public static final AudioFormat.Encoding MPEG1L1 = new AudioFormat.Encoding("MPEG1L1"); public static final AudioFormat.Encoding MPEG1L2 = new AudioFormat.Encoding("MPEG1L2"); public static final AudioFormat.Encoding MPEG1L3 = new AudioFormat.Encoding("MPEG1L3"); + public static final AudioFormat.Encoding MP3 = new AudioFormat.Encoding("MP3"); // alias for MPEG1L3 public static final AudioFormat.Encoding MPEG2L1 = new AudioFormat.Encoding("MPEG2L1"); public static final AudioFormat.Encoding MPEG2L2 = new AudioFormat.Encoding("MPEG2L2"); *************** *** 101,104 **** --- 105,115 ---- // mono + new AudioFormat(MP3, -1.0F, -1, 1, -1, -1.0F, false), + new AudioFormat(MP3, -1.0F, -1, 1, -1, -1.0F, true), + // stereo + new AudioFormat(MP3, -1.0F, -1, 2, -1, -1.0F, false), + new AudioFormat(MP3, -1.0F, -1, 2, -1, -1.0F, true), + + // mono new AudioFormat(MPEG2L1, -1.0F, -1, 1, -1, -1.0F, false), new AudioFormat(MPEG2L1, -1.0F, -1, 1, -1, -1.0F, true), *************** *** 173,272 **** }; ! ! // private static final boolean t = true; ! // private static final boolean f = false; ! ! ! /** Constructor. */ public MpegFormatConversionProvider() { ! super(Arrays.asList(INPUT_FORMATS), ! Arrays.asList(OUTPUT_FORMATS)/*, ! true, // new behaviour ! false*/); ! // bidirectional .. constants UNIDIR../BIDIR..? ! if (TDebug.TraceAudioConverter) { TDebug.out("MpegFormatConversionProvider.<init>(): begin"); } ! if (TDebug.TraceAudioConverter) { TDebug.out("MpegFormatConversionProvider.<init>(): end"); } } - - @Override public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) { if (TDebug.TraceAudioConverter) { ! TDebug.out("MpegFormatConversionProvider.getAudioInputStream(AudioFormat, AudioInputStream):"); TDebug.out("trying to convert"); ! TDebug.out("\tfrom: " + audioInputStream.getFormat()); TDebug.out("\tto: " + targetFormat); } ! AudioFormat matchingFormat = getMatchingFormat( ! targetFormat, ! audioInputStream.getFormat()); ! // if (isConversionSupported(targetFormat, ! // audioInputStream.getFormat())) ! if (matchingFormat != null) { if (TDebug.TraceAudioConverter) { ! TDebug.out("MpegFormatConversionProvider.getAudioInputStream(AudioFormat, AudioInputStream):"); ! TDebug.out("\tisConversionSupported() accepted it; now setting up the conversion"); ! } ! targetFormat = setUnspecifiedFieldsFromProto(targetFormat, matchingFormat); ! if (TDebug.TraceAudioConverter) ! { ! TDebug.out("MpegFormatConversionProvider.getAudioInputStream(AudioFormat, AudioInputStream):"); ! TDebug.out("\tcompleted target format (1. stage): " + targetFormat); ! } ! targetFormat = setUnspecifiedFieldsFromProto(targetFormat, audioInputStream.getFormat()); ! if (TDebug.TraceAudioConverter) ! { ! TDebug.out("MpegFormatConversionProvider.getAudioInputStream(AudioFormat, AudioInputStream):"); ! TDebug.out("\tcompleted target format (2. stage): " + targetFormat); } return new DecodedMpegAudioInputStream( ! targetFormat, ! audioInputStream); } ! else { ! throw new IllegalArgumentException("conversion not supported"); } } ! ! // TODO: ask Florian if these methods are of general interest ! private static AudioFormat setUnspecifiedFieldsFromProto( ! AudioFormat incomplete, ! AudioFormat prototype) ! { ! AudioFormat format = new AudioFormat( ! incomplete.getEncoding(), ! getSpecificValue(incomplete.getSampleRate(), prototype.getSampleRate()), ! getSpecificValue(incomplete.getSampleSizeInBits(), prototype.getSampleSizeInBits()), ! getSpecificValue(incomplete.getChannels(), prototype.getChannels()), ! getSpecificValue(incomplete.getFrameSize(), prototype.getFrameSize()), ! getSpecificValue(incomplete.getFrameRate(), prototype.getFrameRate()), ! incomplete.isBigEndian()); ! return format; ! } ! ! ! ! private static float getSpecificValue(float fIncomplete, float fProto) ! { ! return (fIncomplete == AudioSystem.NOT_SPECIFIED) ? fProto : fIncomplete; } ! ! private static int getSpecificValue(int nIncomplete, int nProto) { ! return (nIncomplete == AudioSystem.NOT_SPECIFIED) ? nProto : nIncomplete; } - - public static class DecodedMpegAudioInputStream extends TAsynchronousFilteredAudioInputStream --- 184,338 ---- }; ! /** ! * Constructor. */ public MpegFormatConversionProvider() { ! super(Arrays.asList(INPUT_FORMATS), Arrays.asList(OUTPUT_FORMATS)); ! if (TDebug.TraceAudioConverter) ! { ! TDebug.out("MpegFormatConversionProvider()"); ! } } @Override public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) { + AudioFormat sourceFormat = audioInputStream.getFormat(); + if (TDebug.TraceAudioConverter) { ! TDebug.out(">MpegFormatConversionProvider.getAudioInputStream(AudioFormat, AudioInputStream):"); TDebug.out("trying to convert"); ! TDebug.out("\tfrom: " + sourceFormat); TDebug.out("\tto: " + targetFormat); } ! ! targetFormat = getFullyQualifiedTargetFormat(targetFormat, sourceFormat, false); ! if (targetFormat != null) { if (TDebug.TraceAudioConverter) { ! TDebug.out("< OK"); } return new DecodedMpegAudioInputStream( ! targetFormat, ! audioInputStream); } ! if (TDebug.TraceAudioConverter) { ! TDebug.out("< not supported"); } + throw new IllegalArgumentException("conversion not supported"); } + + private AudioFormat getFullyQualifiedTargetFormat(AudioFormat targetFormat, AudioFormat sourceFormat, boolean allowUnspecified) { + // check that sourceFormat and targetFormat are in list of supported formats + if (!super.isConversionSupported(targetFormat.getEncoding(), sourceFormat)) { + if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: super.isConversionSupported()==false"); + return null; + } + + // make it simple: we can only convert to PCM_SIGNED, + // therefore, just fill in the missing fields + if (!targetFormat.getEncoding().equals(PCM_SIGNED)) { + if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: target is not PCM_SIGNED"); + return null; + } + + // some values are never allowed + if (sourceFormat.getChannels() > 2 + || targetFormat.getChannels() > 2 + || sourceFormat.getChannels() == 0 + || targetFormat.getChannels() == 0 + || sourceFormat.getSampleRate() == 0 + || targetFormat.getSampleRate() == 0) { + if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: channels or sample rate out of bounds"); + return null; + } + ! // check channels ! if (sourceFormat.getChannels() < 0) { ! if (allowUnspecified) { ! // both channel fields must be -1 ! if (targetFormat.getChannels() >= 0) { ! // cannot convert a non-specified channel number to a different specified channel ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: cannot any to specific channels"); ! return null; ! } ! } else { ! // do not allow source channels = -1 ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: channels cannot be AudioSystem.NOT_SPECIFIED"); ! return null; ! } ! } else { ! // if target channels are given, they must equal source channels ! if (targetFormat.getChannels() > 0 && targetFormat.getChannels() != sourceFormat.getChannels()) { ! // cannot convert a specified channel number to a different specified channel ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: specified channel number must be the same"); ! return null; ! } ! } ! ! // check sample rate ! if (sourceFormat.getSampleRate() < 0) { ! if (allowUnspecified) { ! // both SampleRate fields must be -1 ! if (targetFormat.getSampleRate() >= 0) { ! // cannot convert a non-specified SampleRate to a different specified SampleRate ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert any to specific sample rate"); ! return null; ! } ! } else { ! // do not allow SampleRate = -1 ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: source sample rate is NOT_SPECIFIED"); ! return null; ! } ! } else { ! // if target SampleRate is given, must equal source SampleRate ! if (targetFormat.getSampleRate() > 0 && targetFormat.getSampleRate() != sourceFormat.getSampleRate()) { ! // cannot convert a specified SampleRate to a different specified SampleRate ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert sample rate"); ! return null; ! } ! } ! ! // check sample size ! if (targetFormat.getSampleSizeInBits() != 16) { ! if (TDebug.TraceAudioConverter) TDebug.out("cannot convert: source sample width is not 16"); ! return null; ! } ! ! return new AudioFormat( ! PCM_SIGNED, ! sourceFormat.getSampleRate(), ! targetFormat.getSampleSizeInBits(), ! sourceFormat.getChannels(), ! AudioUtils.getFrameSize(sourceFormat.getChannels(), targetFormat.getSampleSizeInBits()), ! sourceFormat.getSampleRate(), ! targetFormat.isBigEndian(), ! targetFormat.properties()); } ! @Override ! public boolean isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat) { ! if (TDebug.TraceAudioConverter) ! { ! TDebug.out(">MpegFormatConversionProvider.isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat):"); ! TDebug.out("checking if conversion possible"); ! TDebug.out("from: " + sourceFormat); ! TDebug.out("to: " + targetFormat); ! } ! AudioFormat format = getFullyQualifiedTargetFormat(targetFormat, sourceFormat, true); ! boolean supported = (format != null); ! if (TDebug.TraceAudioConverter) ! { ! TDebug.out("<MpegFormatConversionProvider.isConversionSupported(AudioFormat targetFormat, AudioFormat sourceFormat), result=" + supported); ! } ! return supported; } public static class DecodedMpegAudioInputStream extends TAsynchronousFilteredAudioInputStream *************** *** 306,311 **** return; } ! //$$fb decodeOutput not needed ! /*Obuffer decoderOutput =*/ m_decoder.decodeFrame(header, m_bitstream); m_bitstream.closeFrame(); getCircularBuffer().write(m_oBuffer.getBuffer(), 0, m_oBuffer.getCurrentBufferSize()); --- 372,376 ---- return; } ! m_decoder.decodeFrame(header, m_bitstream); m_bitstream.closeFrame(); getCircularBuffer().write(m_oBuffer.getBuffer(), 0, m_oBuffer.getCurrentBufferSize()); *************** *** 451,454 **** --- 516,617 ---- } } + + private static int test(AudioFormat target, AudioFormat source, boolean failSupported, boolean failAIS, int testNum) { + boolean verbose = false; + AudioInputStream ais = new AudioInputStream(new ByteArrayInputStream(new byte[8]), source, 8); + MpegFormatConversionProvider provider = new MpegFormatConversionProvider(); + boolean isConversionSupported = provider.isConversionSupported(target, source); + AudioInputStream convertedAIS = null; + try { + convertedAIS = provider.getAudioInputStream(target, ais); + } catch (Exception e) { + // ignore + } + boolean failed = (failSupported == isConversionSupported) + || (failAIS != (convertedAIS == null)); + if (failed || verbose) { + if (failed) { + System.out.println(""+(testNum)+".ERROR:"); + } else { + System.out.println(""+(testNum)+".PASSED:"); + } + System.out.println(" source: "+source); + System.out.println(" target: "+target); + if (failSupported == isConversionSupported) { + System.out.println(" isConversionSupported() erronously returned "+isConversionSupported); + } else { + System.out.println(" isConversionSupported() correctly returned "+isConversionSupported); + } + if (convertedAIS != null) { + if (failAIS) { + System.out.println(" converted stream was erronously returned with format:"); + } else { + System.out.println(" converted stream was correctly returned with format:"); + } + System.out.println(" converted format: "+convertedAIS.getFormat()); + } else { + if (failAIS) { + System.out.println(" converted stream was correctly not returned."); + } else { + System.out.println(" converted stream was erronously not returned."); + } + } + } else if (!failed) { + System.out.println(""+(testNum)+".OK"); + } + return failed?0:1; + } + + + /** unit test */ + public static void main(String[] args) { + int testNum = 0; + int passed = 0; + + // negative tests: should not be able to convert mp3 to mp3 + AudioFormat source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + AudioFormat target = new AudioFormat(MPEG1L3, 44100, 16, 2, 4, 44100, false); + passed += test(target, source, true, true, testNum++); + source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + target = new AudioFormat(MPEG1L3, -1, 16, -1, -1, -1, false); + passed += test(target, source, true, true, testNum++); + source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + target = new AudioFormat(MPEG1L3, -1, 32, 2, 8, -1, false); + passed += test(target, source, true, true, testNum++); + + // negative test: should not claim to convert channels + source = new AudioFormat(MPEG1L3, 44100, -1, 1, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, -1, 16, 2, 4, -1, false); + passed += test(target, source, true, true, testNum++); + source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, -1, 16, 1, 2, -1, false); + passed += test(target, source, true, true, testNum++); + + // negative test: should not claim to convert sample rate + source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, 8000, 16, 2, 4, 8000, false); + passed += test(target, source, true, true, testNum++); + + // positive test: should convert MP3 to PCM + source = new AudioFormat(MPEG1L3, 44100, -1, 2, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, 44100, 16, 2, 4, 44100, false); + passed += test(target, source, false, false, testNum++); + + // positive test: should convert MP3 to PCM + source = new AudioFormat(MPEG1L3, 44100, -1, 1, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, 44100, 16, 1, 2, 44100, false); + passed += test(target, source, false, false, testNum++); + + // special case: can check isSupported with -1 for both fields, but should not return an AIS + source = new AudioFormat(MPEG1L3, -1, -1, 1, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, -1, 16, 1, 2, -1, false); + passed += test(target, source, false, true, testNum++); + source = new AudioFormat(MPEG1L3, 8000, -1, -1, -1, -1, false); + target = new AudioFormat(PCM_SIGNED, 8000, 16, -1, -1, 8000, false); + passed += test(target, source, false, true, testNum++); + + System.out.println("Passed "+passed+" tests of "+testNum); + } + } |
|
From: Florian B. <fl...@us...> - 2008-11-09 22:45:36
|
Update of /cvsroot/tritonus/tritonus/src/org/tritonus/sampled/file/mpeg In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1018/src/org/tritonus/sampled/file/mpeg Modified Files: MpegAudioFileReader.java Log Message: - improved debugging - mp3 conversion provider: - clean up - make sure that it really only converts formats that are supported - add unit test - use MP3 alias for MPEG2L3 (since JavaZoom uses that) - depend on jl1.0.jar rather than javalayer.jar - update instructions (fixes funded by Eduard van den Bongard, thanks!) Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/org/tritonus/sampled/file/mpeg/MpegAudioFileReader.java Index: MpegAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/org/tritonus/sampled/file/mpeg/MpegAudioFileReader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** MpegAudioFileReader.java 23 Nov 2004 19:29:00 -0000 1.9 --- MpegAudioFileReader.java 9 Nov 2008 22:45:28 -0000 1.10 *************** *** 85,88 **** --- 85,89 ---- + @Override protected AudioFileFormat getAudioFileFormat(InputStream inputStream, long lFileSizeInBytes) throws UnsupportedAudioFileException, IOException |
|
From: Florian B. <fl...@us...> - 2008-11-09 22:45:36
|
Update of /cvsroot/tritonus/tritonus In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1018 Modified Files: build-common.xml README README_mp3 Log Message: - improved debugging - mp3 conversion provider: - clean up - make sure that it really only converts formats that are supported - add unit test - use MP3 alias for MPEG2L3 (since JavaZoom uses that) - depend on jl1.0.jar rather than javalayer.jar - update instructions (fixes funded by Eduard van den Bongard, thanks!) Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/build-common.xml http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/README http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/README_mp3 Index: build-common.xml =================================================================== RCS file: /cvsroot/tritonus/tritonus/build-common.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** build-common.xml 27 Feb 2008 15:00:26 -0000 1.28 --- build-common.xml 9 Nov 2008 22:45:28 -0000 1.29 *************** *** 33,37 **** srcFile="version" /> <property name="plugins" value="tritonus_share-${version}.jar tritonus_remaining-${version}.jar tritonus_gsm-${version}.jar tritonus_javasequencer-${version}.jar tritonus_src-${version}.jar tritonus_aos-${version}.jar tritonus_vorbis-${version}.jar tritonus_jorbis-${version}.jar tritonus_dsp-${version}.jar tritonus_mp3-${version}.jar" /> - <!--property name="plugins" value="../../javalayer/dist/javalayer.jar" /--> <property name="plugins-bin" value="tritonus-vorbis-linux-${version}.zip" /> </target> --- 33,36 ---- *************** *** 282,286 **** <attribute name="Built-By" value="${user.name}"/> <attribute name="Built-Date" value="${DSTAMP}"/> ! <attribute name="Class-Path" value="tritonus_share-${version}.jar javalayer.jar"/> </manifest> </jar> --- 281,285 ---- <attribute name="Built-By" value="${user.name}"/> <attribute name="Built-Date" value="${DSTAMP}"/> ! <attribute name="Class-Path" value="tritonus_share-${version}.jar jl1.0.jar"/> </manifest> </jar> Index: README =================================================================== RCS file: /cvsroot/tritonus/tritonus/README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** README 22 Nov 2003 09:29:50 -0000 1.5 --- README 9 Nov 2008 22:45:28 -0000 1.6 *************** *** 1,11 **** ! This is Tritonus, version 0.3.1 ! Tritonus is an implementation of the Java Sound API 1.0. What you see ! here is an implementaion for GNU/Linux i386 and GNU/Linux PowerPC. ! ! It is intended to support different plattforms in the future. Several ! components are written purely in Java. They can be used to extend any ! known Java Sound implementation. For pre-compiled versions of these ! components, see: http://www.tritonus.org/plugins.html Tritonus is distributed under the terms of the GNU Library General --- 1,8 ---- ! This is Tritonus, version 0.3.7 ! Tritonus is an implementation of the Java Sound API (as of Java 5.0) ! and several Java Sound plugins ("service providers"). For pre-compiled ! versions of these components, see: ! http://www.tritonus.org/plugins.html Tritonus is distributed under the terms of the GNU Library General Index: README_mp3 =================================================================== RCS file: /cvsroot/tritonus/tritonus/README_mp3,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** README_mp3 15 Apr 2001 18:55:05 -0000 1.7 --- README_mp3 9 Nov 2008 22:45:28 -0000 1.8 *************** *** 5,19 **** ------------ This version of Tritonus includes mp3 decoding support. This is due to ! using javalayer 0.0.8, a pure-java mp3 decoder developed by ! the javalayer project. The big credit for this goes to Eric B. who ! wrote the decoder. ! ! The javalayer code is no longer duplicated in Tritonus. To compile ! from scratch, you need to check out javalayer from its own cvs (see ! http://sourceforge.net/projects/javalayer/). Make sure javalayer is ! in a directory 'javalayer' that is in the same directory as ! 'tritonus'. In this case, if you issue ant int Tritonus, it will build ! javalayer, too. Alternatively, if you want a different location, ! change the path to javalayer in build.xml. For a runnable program, see DecodingAudioPlayer.java or --- 5,14 ---- ------------ This version of Tritonus includes mp3 decoding support. This is due to ! using javalayer 1.0, a pure-java mp3 decoder developed by ! the javalayer project. Thanks to Eric B., who wrote the decoder. ! ! To compile from scratch, you need jl1.0.jar (see ! http://sourceforge.net/projects/javalayer/) in the classpath. ! In this case, an ant build will include the mp3 plugin. For a runnable program, see DecodingAudioPlayer.java or *************** *** 79,83 **** Thanks: ! Many thanks to Mark Taylor, who leads development of LAME. ! He was open to my (Florians) proposals and let me work on LAME to make the integration into Tritonus possible. --- 74,78 ---- Thanks: ! Many thanks to Mark Taylor, development lead of LAME. ! He was open to my (Florian's) proposals and let me work on LAME to make the integration into Tritonus possible. |
|
From: Florian B. <fl...@us...> - 2008-11-09 22:45:36
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1018/src/classes/org/tritonus/share/sampled/file Modified Files: TAudioFileReader.java Log Message: - improved debugging - mp3 conversion provider: - clean up - make sure that it really only converts formats that are supported - add unit test - use MP3 alias for MPEG2L3 (since JavaZoom uses that) - depend on jl1.0.jar rather than javalayer.jar - update instructions (fixes funded by Eduard van den Bongard, thanks!) Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java Index: TAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileReader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TAudioFileReader.java 7 Jan 2008 16:07:46 -0000 1.3 --- TAudioFileReader.java 9 Nov 2008 22:45:28 -0000 1.4 *************** *** 110,114 **** throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(File): begin"); } long lFileLengthInBytes = file.length(); InputStream inputStream = new FileInputStream(file); --- 110,114 ---- throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(File): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = file.length(); InputStream inputStream = new FileInputStream(file); *************** *** 143,147 **** { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(URL): begin"); } long lFileLengthInBytes = getDataLength(url); InputStream inputStream = url.openStream(); --- 143,147 ---- { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(URL): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = getDataLength(url); InputStream inputStream = url.openStream(); *************** *** 176,180 **** { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(InputStream): begin"); } long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; inputStream.mark(getMarkLimit()); --- 176,180 ---- { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioFileFormat(InputStream): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; inputStream.mark(getMarkLimit()); *************** *** 240,244 **** throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(File): begin"); } long lFileLengthInBytes = file.length(); InputStream inputStream = new FileInputStream(file); --- 240,244 ---- throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(File): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = file.length(); InputStream inputStream = new FileInputStream(file); *************** *** 279,283 **** throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(URL): begin"); } long lFileLengthInBytes = getDataLength(url); InputStream inputStream = url.openStream(); --- 279,283 ---- throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(URL): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = getDataLength(url); InputStream inputStream = url.openStream(); *************** *** 318,322 **** throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream): begin"); } long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; AudioInputStream audioInputStream = null; --- 318,322 ---- throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream): begin (class: "+getClass().getSimpleName()+")"); } long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED; AudioInputStream audioInputStream = null; *************** *** 363,367 **** throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): begin"); } if (isRereading()) { --- 363,367 ---- throws UnsupportedAudioFileException, IOException { ! if (TDebug.TraceAudioFileReader) {TDebug.out("TAudioFileReader.getAudioInputStream(InputStream, long): begin (class: "+getClass().getSimpleName()+")"); } if (isRereading()) { |
|
From: Florian B. <fl...@us...> - 2008-04-08 15:07:03
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21834/src/classes/org/tritonus/share/sampled/convert Modified Files: TAsynchronousFilteredAudioInputStream.java Log Message: fix CDDA plugin (uses m_circularBuffer field in TAsynchronousFilteredAIS) Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TAsynchronousFilteredAudioInputStream.java Index: TAsynchronousFilteredAudioInputStream.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TAsynchronousFilteredAudioInputStream.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TAsynchronousFilteredAudioInputStream.java 3 Mar 2008 15:34:32 -0000 1.3 --- TAsynchronousFilteredAudioInputStream.java 8 Apr 2008 15:06:49 -0000 1.4 *************** *** 61,65 **** ! private TCircularBuffer m_circularBuffer; private int m_nMinAvailable; private byte[] m_abSingleByte; --- 61,66 ---- ! // must be protected because it's accessed by the native CDDA lib ! protected TCircularBuffer m_circularBuffer; private int m_nMinAvailable; private byte[] m_abSingleByte; |
|
From: Florian B. <fl...@us...> - 2008-03-03 15:34:35
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24034/src/classes/org/tritonus/share/sampled/convert Modified Files: TEncodingFormatConversionProvider.java TSimpleFormatConversionProvider.java TFormatConversionProvider.java TAsynchronousFilteredAudioInputStream.java TSynchronousFilteredAudioInputStream.java Log Message: - fix wrong exception if native ogg lib is not available with tritonus_vorbis - remove some compiler warnings Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TEncodingFormatConversionProvider.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TSimpleFormatConversionProvider.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TFormatConversionProvider.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TAsynchronousFilteredAudioInputStream.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TSynchronousFilteredAudioInputStream.java Index: TEncodingFormatConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TEncodingFormatConversionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TEncodingFormatConversionProvider.java 13 Feb 2006 12:21:50 -0000 1.2 --- TEncodingFormatConversionProvider.java 3 Mar 2008 15:34:31 -0000 1.3 *************** *** 67,70 **** --- 67,72 ---- extends TSimpleFormatConversionProvider { + + /** create an instance. The given formats can be set to null. */ protected TEncodingFormatConversionProvider( Collection<AudioFormat> sourceFormats, *************** *** 96,99 **** --- 98,102 ---- * default mode of calculating the frame size is not appropriate. */ + @Override public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) { if (TDebug.TraceAudioConverter) { Index: TSimpleFormatConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TSimpleFormatConversionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TSimpleFormatConversionProvider.java 3 Jun 2007 19:53:10 -0000 1.2 --- TSimpleFormatConversionProvider.java 3 Mar 2008 15:34:31 -0000 1.3 *************** *** 75,78 **** --- 75,84 ---- m_sourceEncodings = new ArraySet<AudioFormat.Encoding>(); m_targetEncodings = new ArraySet<AudioFormat.Encoding>(); + if (sourceFormats == null) { + sourceFormats = new ArraySet<AudioFormat>(); + } + if (targetFormats == null) { + targetFormats = new ArraySet<AudioFormat>(); + } m_sourceFormats = sourceFormats; m_targetFormats = targetFormats; *************** *** 111,114 **** --- 117,121 ---- + @Override public AudioFormat.Encoding[] getSourceEncodings() { *************** *** 118,121 **** --- 125,129 ---- + @Override public AudioFormat.Encoding[] getTargetEncodings() { *************** *** 126,129 **** --- 134,138 ---- // overwritten of FormatConversionProvider + @Override public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding) { *************** *** 134,137 **** --- 143,147 ---- // overwritten of FormatConversionProvider + @Override public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding) { *************** *** 147,150 **** --- 157,161 ---- * override this method. */ + @Override public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { *************** *** 167,170 **** --- 178,182 ---- * override this method. */ + @Override public AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat) { Index: TFormatConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TFormatConversionProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TFormatConversionProvider.java 20 Jan 2005 07:47:16 -0000 1.1 --- TFormatConversionProvider.java 3 Mar 2008 15:34:32 -0000 1.2 *************** *** 54,57 **** --- 54,58 ---- // $$fb2000-10-04: use AudioSystem.NOT_SPECIFIED for all fields. + @Override public AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream audioInputStream) { *************** *** 86,89 **** --- 87,91 ---- result against null. */ + @Override public boolean isConversionSupported( AudioFormat targetFormat, Index: TAsynchronousFilteredAudioInputStream.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TAsynchronousFilteredAudioInputStream.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TAsynchronousFilteredAudioInputStream.java 13 Feb 2006 12:21:50 -0000 1.2 --- TAsynchronousFilteredAudioInputStream.java 3 Mar 2008 15:34:32 -0000 1.3 *************** *** 148,151 **** --- 148,152 ---- + @Override public int read() throws IOException *************** *** 173,176 **** --- 174,178 ---- + @Override public int read(byte[] abData) throws IOException *************** *** 184,187 **** --- 186,190 ---- + @Override public int read(byte[] abData, int nOffset, int nLength) throws IOException *************** *** 198,201 **** --- 201,205 ---- + @Override public long skip(long lSkip) throws IOException *************** *** 215,218 **** --- 219,223 ---- + @Override public int available() throws IOException *************** *** 223,226 **** --- 228,232 ---- + @Override public void close() throws IOException *************** *** 231,234 **** --- 237,241 ---- + @Override public boolean markSupported() { *************** *** 238,241 **** --- 245,249 ---- + @Override public void mark(int nReadLimit) { *************** *** 244,247 **** --- 252,256 ---- + @Override public void reset() throws IOException Index: TSynchronousFilteredAudioInputStream.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/convert/TSynchronousFilteredAudioInputStream.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** TSynchronousFilteredAudioInputStream.java 3 Jun 2007 19:53:46 -0000 1.5 --- TSynchronousFilteredAudioInputStream.java 3 Mar 2008 15:34:32 -0000 1.6 *************** *** 167,170 **** --- 167,171 ---- + @Override public int read() throws IOException { *************** *** 206,209 **** --- 207,211 ---- * this method may read less than nLength bytes. */ + @Override public final int read(byte[] abData, int nOffset, int nLength) throws IOException { *************** *** 259,262 **** --- 261,265 ---- + @Override public long skip(long nSkip) throws IOException { *************** *** 269,272 **** --- 272,276 ---- + @Override public int available() throws IOException { *************** *** 276,279 **** --- 280,284 ---- + @Override public void close() throws IOException { *************** *** 285,288 **** --- 290,294 ---- + @Override public void mark(int readlimit) { int readLimitFrames=readlimit/newFrameSize; *************** *** 292,295 **** --- 298,302 ---- + @Override public void reset() throws IOException { *************** *** 298,301 **** --- 305,309 ---- + @Override public boolean markSupported() { return originalStream.markSupported(); |
|
From: Florian B. <fl...@us...> - 2008-03-03 15:34:35
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/convert/vorbis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24034/src/classes/org/tritonus/sampled/convert/vorbis Modified Files: VorbisFormatConversionProvider.java Log Message: - fix wrong exception if native ogg lib is not available with tritonus_vorbis - remove some compiler warnings Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/convert/vorbis/VorbisFormatConversionProvider.java Index: VorbisFormatConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/convert/vorbis/VorbisFormatConversionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** VorbisFormatConversionProvider.java 13 Feb 2006 11:21:50 -0000 1.2 --- VorbisFormatConversionProvider.java 3 Mar 2008 15:34:32 -0000 1.3 *************** *** 35,39 **** import java.util.Arrays; - import java.util.Iterator; import java.util.Random; --- 35,38 ---- *************** *** 42,49 **** import javax.sound.sampled.AudioSystem; ! import org.tritonus.lowlevel.ogg.Packet; ! import org.tritonus.lowlevel.ogg.Page; ! import org.tritonus.lowlevel.ogg.StreamState; ! import org.tritonus.lowlevel.ogg.SyncState; import org.tritonus.lowlevel.vorbis.Block; import org.tritonus.lowlevel.vorbis.Comment; --- 41,45 ---- import javax.sound.sampled.AudioSystem; ! import org.tritonus.lowlevel.ogg.*; import org.tritonus.lowlevel.vorbis.Block; import org.tritonus.lowlevel.vorbis.Comment; *************** *** 115,119 **** private static final int DEFAULT_MIN_BITRATE = 32; ! /** Constructor. --- 111,116 ---- private static final int DEFAULT_MIN_BITRATE = 32; ! // TODO: refresh from time to time to allow adding the lib at runtime... ! private static boolean LIB_AVAILABLE = Ogg.isLibraryAvailable(); /** Constructor. *************** *** 122,130 **** { super(Arrays.asList(INPUT_FORMATS), ! Arrays.asList(INPUT_FORMATS)//, ! //Arrays.asList(OUTPUT_FORMATS), /* true, // new behaviour false*/); // bidirectional .. constants UNIDIR../BIDIR..? if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.<init>(): begin"); } if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.<init>(): end"); } --- 119,129 ---- { super(Arrays.asList(INPUT_FORMATS), ! Arrays.asList(INPUT_FORMATS) /* true, // new behaviour false*/); // bidirectional .. constants UNIDIR../BIDIR..? + if (!LIB_AVAILABLE) { + disable(); + } if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.<init>(): begin"); } if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.<init>(): end"); } *************** *** 133,138 **** --- 132,141 ---- + @Override public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream) { + if (!LIB_AVAILABLE) { + throw new IllegalArgumentException("format conversion not supported: ogg/vorbis native library not found."); + } if (TDebug.TraceAudioConverter) { TDebug.out(">VorbisFormatConversionProvider.getAudioInputStream(): begin"); } /** The AudioInputStream to return. *************** *** 182,185 **** --- 185,191 ---- protected AudioFormat getDefaultTargetFormat(AudioFormat targetFormat, AudioFormat sourceFormat) { + if (!LIB_AVAILABLE) { + throw new IllegalArgumentException("format conversion not supported: ogg/vorbis native library not found."); + } if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.getDefaultTargetFormat(): target format: " + targetFormat); } if (TDebug.TraceAudioConverter) { TDebug.out("VorbisFormatConversionProvider.getDefaultTargetFormat(): source format: " + sourceFormat); } *************** *** 187,194 **** // return first of the matching formats // pre-condition: the predefined target formats (FORMATS2) must be well-defined ! ! Iterator iterator = getCollectionTargetFormats().iterator(); ! while (iterator.hasNext()) { - AudioFormat format = (AudioFormat) iterator.next(); if (AudioFormats.matches(targetFormat, format)) { --- 193,198 ---- // return first of the matching formats // pre-condition: the predefined target formats (FORMATS2) must be well-defined ! ! for (AudioFormat format: getCollectionTargetFormats()) { if (AudioFormats.matches(targetFormat, format)) { *************** *** 256,259 **** --- 260,266 ---- AudioSystem.NOT_SPECIFIED, 262144, 16384); + if (!LIB_AVAILABLE) { + throw new IllegalArgumentException("format conversion not supported: ogg/vorbis native library not found."); + } if (TDebug.TraceAudioConverter) TDebug.out(">EncodedVorbisAudioInputStream.<init>(): begin"); m_decodedStream = inputStream; *************** *** 510,515 **** ! public void close() ! throws IOException { super.close(); --- 517,522 ---- ! @Override ! public void close() throws IOException { super.close(); *************** *** 565,569 **** // private List m_songComments = new ArrayList(); // is altered later in a dubious way ! private int convsize = -1; // BUFFER_SIZE * 2; // TODO: further checking private byte[] convbuffer = new byte[CONVSIZE]; --- 572,577 ---- // private List m_songComments = new ArrayList(); // is altered later in a dubious way ! //$$fb field not used ! //private int convsize = -1; // BUFFER_SIZE * 2; // TODO: further checking private byte[] convbuffer = new byte[CONVSIZE]; *************** *** 579,582 **** --- 587,593 ---- { super(outputFormat, AudioSystem.NOT_SPECIFIED); + if (!LIB_AVAILABLE) { + throw new IllegalArgumentException("format conversion not supported: ogg/vorbis native library not found."); + } if (TDebug.TraceAudioConverter) { TDebug.out("DecodedVorbisAudioInputStream.<init>(): begin"); } m_oggBitStream = bitStream; *************** *** 791,795 **** private void setupVorbisStructures() { ! convsize = BUFFER_SIZE / m_vorbisInfo.getChannels(); m_vorbisDspState.initSynthesis(m_vorbisInfo); m_vorbisBlock.init(m_vorbisDspState); --- 802,807 ---- private void setupVorbisStructures() { ! //$$fb field not used... ! //convsize = BUFFER_SIZE / m_vorbisInfo.getChannels(); m_vorbisDspState.initSynthesis(m_vorbisInfo); m_vorbisBlock.init(m_vorbisDspState); *************** *** 970,974 **** /** Read raw data from to ogg bitstream. ! Reads from {@ #m_oggBitStream m_oggBitStream} a specified number of bytes into a buffer, starting at a specified buffer index. --- 982,986 ---- /** Read raw data from to ogg bitstream. ! Reads from {@link #m_oggBitStream m_oggBitStream} a specified number of bytes into a buffer, starting at a specified buffer index. *************** *** 1019,1022 **** --- 1031,1035 ---- /** */ + @Override public void close() throws IOException { |
|
From: Florian B. <fl...@us...> - 2008-03-03 15:34:34
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24034/src/classes/org/tritonus/share/sampled Modified Files: AudioFileTypes.java Encodings.java AudioFormatSet.java Log Message: - fix wrong exception if native ogg lib is not available with tritonus_vorbis - remove some compiler warnings Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/AudioFileTypes.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/Encodings.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/AudioFormatSet.java Index: AudioFileTypes.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/AudioFileTypes.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AudioFileTypes.java 22 Nov 2006 15:44:29 -0000 1.3 --- AudioFileTypes.java 3 Mar 2008 15:34:32 -0000 1.4 *************** *** 122,126 **** */ public static AudioFileFormat.Type getType(String name, String extension) { ! AudioFileFormat.Type res=(AudioFileFormat.Type) types.get(name); if (res==null) { // it is not already in the string set. --- 122,126 ---- */ public static AudioFileFormat.Type getType(String name, String extension) { ! AudioFileFormat.Type res = types.get(name); if (res==null) { // it is not already in the string set. Index: Encodings.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/Encodings.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Encodings.java 22 Nov 2006 15:46:27 -0000 1.3 --- Encodings.java 3 Mar 2008 15:34:32 -0000 1.4 *************** *** 111,115 **** */ public static AudioFormat.Encoding getEncoding(String name) { ! AudioFormat.Encoding res=(AudioFormat.Encoding) encodings.get(name); if (res==null) { // it is not already in the string set. Create a new encoding instance. --- 111,115 ---- */ public static AudioFormat.Encoding getEncoding(String name) { ! AudioFormat.Encoding res=encodings.get(name); if (res==null) { // it is not already in the string set. Create a new encoding instance. *************** *** 151,160 **** StringHashedSet<AudioFormat.Encoding> iteratedSources=new StringHashedSet<AudioFormat.Encoding>(); StringHashedSet<AudioFormat.Encoding> retrievedTargets=new StringHashedSet<AudioFormat.Encoding>(); ! Iterator sourceFormats=encodings.iterator(); while (sourceFormats.hasNext()) { ! AudioFormat.Encoding source=(AudioFormat.Encoding) sourceFormats.next(); iterateEncodings(source, iteratedSources, retrievedTargets); } ! return (AudioFormat.Encoding[]) retrievedTargets.toArray( new AudioFormat.Encoding[retrievedTargets.size()]); } --- 151,160 ---- StringHashedSet<AudioFormat.Encoding> iteratedSources=new StringHashedSet<AudioFormat.Encoding>(); StringHashedSet<AudioFormat.Encoding> retrievedTargets=new StringHashedSet<AudioFormat.Encoding>(); ! Iterator<AudioFormat.Encoding> sourceFormats=encodings.iterator(); while (sourceFormats.hasNext()) { ! AudioFormat.Encoding source=sourceFormats.next(); iterateEncodings(source, iteratedSources, retrievedTargets); } ! return retrievedTargets.toArray( new AudioFormat.Encoding[retrievedTargets.size()]); } Index: AudioFormatSet.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/AudioFormatSet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AudioFormatSet.java 14 Dec 2006 21:46:03 -0000 1.4 --- AudioFormatSet.java 3 Mar 2008 15:34:32 -0000 1.5 *************** *** 76,79 **** --- 76,80 ---- } + @Override public boolean add(AudioFormat elem) { if (elem==null) { *************** *** 88,94 **** } AudioFormat comp= elem; ! Iterator it=iterator(); while (it.hasNext()) { ! if (AudioFormats.equals(comp, (AudioFormat) it.next())) { return true; } --- 89,95 ---- } AudioFormat comp= elem; ! Iterator<AudioFormat> it=iterator(); while (it.hasNext()) { ! if (AudioFormats.equals(comp, it.next())) { return true; } *************** *** 102,108 **** } AudioFormat comp= elem; ! Iterator it=iterator(); while (it.hasNext()) { ! AudioFormat thisElem=(AudioFormat) it.next(); if (AudioFormats.equals(comp, thisElem)) { return thisElem; --- 103,109 ---- } AudioFormat comp= elem; ! Iterator<AudioFormat> it=iterator(); while (it.hasNext()) { ! AudioFormat thisElem=it.next(); if (AudioFormats.equals(comp, thisElem)) { return thisElem; *************** *** 128,134 **** return null; } ! Iterator it=iterator(); while (it.hasNext()) { ! AudioFormat thisElem=(AudioFormat) it.next(); if (AudioFormats.matches(elem, thisElem)) { return thisElem; --- 129,135 ---- return null; } ! Iterator<AudioFormat> it=iterator(); while (it.hasNext()) { ! AudioFormat thisElem=it.next(); if (AudioFormats.matches(elem, thisElem)) { return thisElem; *************** *** 145,152 **** --- 146,155 ---- + @Override public void add(int index, AudioFormat element) { throw new UnsupportedOperationException("unsupported"); } + @Override public AudioFormat set(int index, AudioFormat element) { throw new UnsupportedOperationException("unsupported"); |
|
From: Florian B. <fl...@us...> - 2008-03-03 15:34:34
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24034/src/classes/org/tritonus/sampled/file/vorbis Modified Files: VorbisAudioFileWriter.java VorbisAudioFileReader.java Log Message: - fix wrong exception if native ogg lib is not available with tritonus_vorbis - remove some compiler warnings Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileWriter.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileReader.java Index: VorbisAudioFileWriter.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** VorbisAudioFileWriter.java 13 Feb 2006 12:21:50 -0000 1.2 --- VorbisAudioFileWriter.java 3 Mar 2008 15:34:32 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- extends THeaderlessAudioFileWriter { + private static final AudioFileFormat.Type[] FILE_TYPES = { Index: VorbisAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileReader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** VorbisAudioFileReader.java 16 Feb 2008 10:21:57 -0000 1.6 --- VorbisAudioFileReader.java 3 Mar 2008 15:34:32 -0000 1.7 *************** *** 41,48 **** import org.tritonus.share.sampled.file.TAudioFileReader; ! import org.tritonus.lowlevel.ogg.Page; ! import org.tritonus.lowlevel.ogg.Packet; ! import org.tritonus.lowlevel.ogg.SyncState; ! import org.tritonus.lowlevel.ogg.StreamState; --- 41,45 ---- import org.tritonus.share.sampled.file.TAudioFileReader; ! import org.tritonus.lowlevel.ogg.*; *************** *** 58,62 **** --- 55,62 ---- + // TODO: refresh from time to time to allow adding the lib at runtime... + private static boolean LIB_AVAILABLE = Ogg.isLibraryAvailable(); + public VorbisAudioFileReader() { *************** *** 66,73 **** --- 66,77 ---- + @Override protected AudioFileFormat getAudioFileFormat(InputStream inputStream, long lFileSizeInBytes) throws UnsupportedAudioFileException, IOException { + if (!LIB_AVAILABLE) { + throw new UnsupportedAudioFileException("ogg reading not supported: ogg/vorbis native library not found."); + } if (TDebug.TraceAudioFileReader) { TDebug.out(">VorbisAudioFileReader.getAudioFileFormat(): begin"); } //$fb catch unsatisfied link error if native lib is not available |
|
From: Florian B. <fl...@us...> - 2008-03-03 15:34:34
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24034/src/classes/org/tritonus/share/sampled/file Modified Files: TAudioFileWriter.java THeaderlessAudioFileWriter.java TAudioFileFormat.java HeaderlessAudioOutputStream.java Log Message: - fix wrong exception if native ogg lib is not available with tritonus_vorbis - remove some compiler warnings Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileWriter.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/THeaderlessAudioFileWriter.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileFormat.java http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/HeaderlessAudioOutputStream.java Index: TAudioFileWriter.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileWriter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TAudioFileWriter.java 13 Feb 2006 17:40:07 -0000 1.4 --- TAudioFileWriter.java 3 Mar 2008 15:34:32 -0000 1.5 *************** *** 107,110 **** --- 107,111 ---- // implementing the interface + @Override public AudioFileFormat.Type[] getAudioFileTypes() { *************** *** 114,117 **** --- 115,119 ---- // implementing the interface + @Override public boolean isFileTypeSupported(AudioFileFormat.Type fileType) { *************** *** 122,125 **** --- 124,128 ---- // implementing the interface + @Override public AudioFileFormat.Type[] getAudioFileTypes( AudioInputStream audioInputStream) *************** *** 142,145 **** --- 145,149 ---- // implementing the interface + @Override public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream audioInputStream) { *************** *** 157,160 **** --- 161,165 ---- // implementing the interface + @Override public int write(AudioInputStream audioInputStream, AudioFileFormat.Type fileType, *************** *** 227,230 **** --- 232,236 ---- // implementing the interface + @Override public int write(AudioInputStream audioInputStream, AudioFileFormat.Type fileType, *************** *** 306,310 **** //$$fb 2000-07-18: BUFFER_LENGTH must be a multiple of frame size... ! int nBufferSize=((int)BUFFER_LENGTH/outputFormat.getFrameSize())*outputFormat.getFrameSize(); byte[] abBuffer = new byte[nBufferSize]; while (true) --- 312,316 ---- //$$fb 2000-07-18: BUFFER_LENGTH must be a multiple of frame size... ! int nBufferSize=(BUFFER_LENGTH/outputFormat.getFrameSize())*outputFormat.getFrameSize(); byte[] abBuffer = new byte[nBufferSize]; while (true) *************** *** 370,377 **** TDebug.out("class: "+getClass().getName()); } ! Iterator audioFormats = getSupportedAudioFormats(fileType); while (audioFormats.hasNext()) { ! AudioFormat handledFormat = (AudioFormat) audioFormats.next(); if (TDebug.TraceAudioFileWriter) { TDebug.out("matching against format : " + handledFormat); } if (AudioFormats.matches(handledFormat, audioFormat)) --- 376,383 ---- TDebug.out("class: "+getClass().getName()); } ! Iterator<AudioFormat> audioFormats = getSupportedAudioFormats(fileType); while (audioFormats.hasNext()) { ! AudioFormat handledFormat = audioFormats.next(); if (TDebug.TraceAudioFileWriter) { TDebug.out("matching against format : " + handledFormat); } if (AudioFormats.matches(handledFormat, audioFormat)) Index: THeaderlessAudioFileWriter.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/THeaderlessAudioFileWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** THeaderlessAudioFileWriter.java 20 Jan 2005 07:47:17 -0000 1.1 --- THeaderlessAudioFileWriter.java 3 Mar 2008 15:34:32 -0000 1.2 *************** *** 62,65 **** --- 62,66 ---- + @Override protected AudioOutputStream getAudioOutputStream( AudioFormat audioFormat, Index: TAudioFileFormat.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/TAudioFileFormat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TAudioFileFormat.java 20 Jan 2005 07:47:17 -0000 1.1 --- TAudioFileFormat.java 3 Mar 2008 15:34:32 -0000 1.2 *************** *** 96,99 **** --- 96,100 ---- + @Override public Map<String, Object> properties() { Index: HeaderlessAudioOutputStream.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/file/HeaderlessAudioOutputStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** HeaderlessAudioOutputStream.java 20 Jan 2005 07:47:17 -0000 1.1 --- HeaderlessAudioOutputStream.java 3 Mar 2008 15:34:32 -0000 1.2 *************** *** 51,54 **** --- 51,55 ---- } + @Override protected void writeHeader() throws IOException { |
|
From: Florian B. <fl...@us...> - 2008-02-27 15:00:29
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26472/src/classes/org/tritonus/share/sampled Modified Files: FloatSampleBuffer.java Log Message: - added FloatSampleBuffer.setRawChannel() - improved docs and comments Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/share/sampled/FloatSampleBuffer.java Index: FloatSampleBuffer.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/share/sampled/FloatSampleBuffer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** FloatSampleBuffer.java 7 Jan 2008 15:59:42 -0000 1.9 --- FloatSampleBuffer.java 27 Feb 2008 15:00:32 -0000 1.10 *************** *** 1073,1078 **** --- 1073,1082 ---- /** + * Get the actual audio data of one channel.<br> + * Modifying this array will modify the audio samples of this + * FloatSampleBuffer. <br> * NOTE: the returned array may be larger than sampleCount. So in any case, * sampleCount is to be respected. + * @throws IllegalArgumentException if channel is out of bounds */ public float[] getChannel(int channel) { *************** *** 1085,1088 **** --- 1089,1114 ---- /** + * Low-level method to directly set the array for the given channel. + * Normally, you do not need this method, as you can conveniently + * resize the array with <code>changeSampleCount()</code>. This method + * may be useful for advanced optimization techniques. + * @param channel the channel to replace + * @param data the audio sample array + * @return the audio data array that was replaced + * @throws IllegalArgumentException if channel is out of bounds or data is null + * @see #changeSampleCount(int, boolean) + */ + public float[] setRawChannel(int channel, float[] data) { + if (data == null) { + throw new IllegalArgumentException( + "cannot set a channel to a null array"); + } + float[] ret = getChannel(channel); + channels[channel] = data; + return ret; + } + + /** + * Get an array of all channels. * @return all channels as array */ |
|
From: Florian B. <fl...@us...> - 2008-02-27 15:00:29
|
Update of /cvsroot/tritonus/tritonus In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26472 Modified Files: build-common.xml Log Message: - added FloatSampleBuffer.setRawChannel() - improved docs and comments Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/build-common.xml Index: build-common.xml =================================================================== RCS file: /cvsroot/tritonus/tritonus/build-common.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** build-common.xml 7 Jan 2008 17:59:48 -0000 1.27 --- build-common.xml 27 Feb 2008 15:00:26 -0000 1.28 *************** *** 149,153 **** </jar> ! <!-- (pure java) VORBIS: --> <jar jarfile="${dist}/tritonus_pvorbis-${version}.jar"> <fileset dir="${build}" > --- 149,153 ---- </jar> ! <!-- (pure java, standalone) VORBIS not finished! --> <jar jarfile="${dist}/tritonus_pvorbis-${version}.jar"> <fileset dir="${build}" > *************** *** 292,296 **** if="jorbis-present" > ! <!-- JORBIS: --> <jar jarfile="${dist}/tritonus_jorbis-${version}.jar"> <fileset dir="${build}" > --- 292,296 ---- if="jorbis-present" > ! <!-- JORBIS (depends on the jorbis/jogg jars): --> <jar jarfile="${dist}/tritonus_jorbis-${version}.jar"> <fileset dir="${build}" > |
|
From: Florian B. <fl...@us...> - 2008-02-16 10:22:01
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16750/tritonus/src/classes/org/tritonus/sampled/file/vorbis Modified Files: VorbisAudioFileReader.java Log Message: really fix error passed on to AudioSystem if native lib is not found Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileReader.java Index: VorbisAudioFileReader.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/file/vorbis/VorbisAudioFileReader.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** VorbisAudioFileReader.java 7 Jan 2008 16:13:29 -0000 1.5 --- VorbisAudioFileReader.java 16 Feb 2008 10:21:57 -0000 1.6 *************** *** 71,86 **** { if (TDebug.TraceAudioFileReader) { TDebug.out(">VorbisAudioFileReader.getAudioFileFormat(): begin"); } - SyncState oggSyncState = new SyncState(); - StreamState oggStreamState = new StreamState(); - Page oggPage; - Packet oggPacket; - //$fb catch unsatisfied link error if native lib is not available try { ! oggPage = new Page(); ! oggPacket = new Packet(); ! } catch (UnsatisfiedLinkError ule) { ! throw new UnsupportedAudioFileException(ule.getMessage()); ! } int bytes = 0; --- 71,81 ---- { if (TDebug.TraceAudioFileReader) { TDebug.out(">VorbisAudioFileReader.getAudioFileFormat(): begin"); } //$fb catch unsatisfied link error if native lib is not available try { ! ! SyncState oggSyncState = new SyncState(); ! StreamState oggStreamState = new StreamState(); ! Page oggPage = new Page(); ! Packet oggPacket = new Packet(); int bytes = 0; *************** *** 101,105 **** int nResult = oggSyncState.write(abBuffer, bytes); if (TDebug.TraceAudioFileReader) { TDebug.out("SyncState.write() returned " + nResult); } ! // Get the first page. if (oggSyncState.pageOut(oggPage) != 1) --- 96,100 ---- int nResult = oggSyncState.write(abBuffer, bytes); if (TDebug.TraceAudioFileReader) { TDebug.out("SyncState.write() returned " + nResult); } ! // Get the first page. if (oggSyncState.pageOut(oggPage) != 1) *************** *** 151,155 **** throw new UnsupportedAudioFileException("not a Vorbis stream: can't read first page of Ogg bitstream data"); } ! if (oggStreamState.packetOut(oggPacket) != 1) { --- 146,150 ---- throw new UnsupportedAudioFileException("not a Vorbis stream: can't read first page of Ogg bitstream data"); } ! if (oggStreamState.packetOut(oggPacket) != 1) { *************** *** 303,306 **** --- 298,305 ---- if (TDebug.TraceAudioFileReader) { TDebug.out("<VorbisAudioFileReader.getAudioFileFormat(): end"); } return audioFileFormat; + + } catch (UnsatisfiedLinkError ule) { + throw new UnsupportedAudioFileException(ule.getMessage()); + } } } |
|
From: Florian B. <fl...@us...> - 2008-01-14 15:02:00
|
Update of /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/convert In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv516/src/classes/org/tritonus/sampled/convert Modified Files: SampleRateConversionProvider.java Log Message: sample rate converter: fixed deadlock when underlying source stream temporarily provides 0 samples only Direct links to online-CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tritonus/tritonus/src/classes/org/tritonus/sampled/convert/SampleRateConversionProvider.java Index: SampleRateConversionProvider.java =================================================================== RCS file: /cvsroot/tritonus/tritonus/src/classes/org/tritonus/sampled/convert/SampleRateConversionProvider.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** SampleRateConversionProvider.java 3 Jun 2007 22:08:25 -0000 1.8 --- SampleRateConversionProvider.java 14 Jan 2008 15:01:57 -0000 1.9 *************** *** 6,10 **** /* ! * Copyright (c) 2001,2006 by Florian Bomers <http://www.bomers.de> * * --- 6,10 ---- /* ! * Copyright (c) 2001,2006,2008 by Florian Bomers <http://www.bomers.de> * [...1828 lines suppressed...] } } + @Override public float getSampleRate() { return this.sampleRate; } + @Override public float getFrameRate() { return this.sampleRate; *************** *** 1061,1063 **** } ! /*** SampleRateConversionProvider.java ***/ --- 1186,1188 ---- } ! /** * SampleRateConversionProvider.java ** */ |