11/*
22 * 11/19/04 1.0 moved to LGPL.
3- *
4- * 12/12/99 0.0.7 Renamed class, additional constructor arguments
5- * and larger write buffers. mdm@techie.com.
3+ *
4+ * 12/12/99 0.0.7 Renamed class, additional constructor arguments
5+ * and larger write buffers. mdm@techie.com.
66 *
77 * 15/02/99 Java Conversion by E.B ,javalayer@javazoom.net
8- *
8+ *
99 *-----------------------------------------------------------------------
1010 * This program is free software; you can redistribute it and/or modify
1111 * it under the terms of the GNU Library General Public License as published
2929
3030/**
3131 * Implements an Obuffer by writing the data to
32- * a file in RIFF WAVE format.
33- *
32+ * a file in RIFF WAVE format.
33+ *
3434 * @since 0.0
3535 */
3636
3737
3838public class WaveFileObuffer extends Obuffer
3939{
40- private short [] buffer ;
41- private short [] bufferp ;
42- private int channels ;
40+ private short [] buffer ;
41+ private short [] bufferp ;
42+ private int channels ;
4343 private WaveFile outWave ;
4444
4545 /**
46- * Creates a new WareFileObuffer instance.
47- *
48- * @param number_of_channels
49- * The number of channels of audio data
50- * this buffer will receive.
51- *
52- * @param freq The sample frequency of the samples in the buffer.
53- *
54- * @param fileName The filename to write the data to.
46+ * Creates a new WareFileObuffer instance.
47+ *
48+ * @param number_of_channels
49+ * The number of channels of audio data
50+ * this buffer will receive.
51+ *
52+ * @param freq The sample frequency of the samples in the buffer.
53+ *
54+ * @param fileName The filename to write the data to.
5555 */
5656 public WaveFileObuffer (int number_of_channels , int freq , String FileName )
5757 {
58- if (FileName ==null )
59- throw new NullPointerException ("FileName" );
60-
61- buffer = new short [OBUFFERSIZE ];
62- bufferp = new short [MAXCHANNELS ];
63- channels = number_of_channels ;
64-
65- for (int i = 0 ; i < number_of_channels ; ++i )
66- bufferp [i ] = (short )i ;
67-
68- outWave = new WaveFile ();
69-
58+ if (FileName ==null )
59+ throw new NullPointerException ("FileName" );
60+
61+ buffer = new short [OBUFFERSIZE ];
62+ bufferp = new short [MAXCHANNELS ];
63+ channels = number_of_channels ;
64+
65+ for (int i = 0 ; i < number_of_channels ; ++i )
66+ bufferp [i ] = (short )i ;
67+
68+ outWave = new WaveFile ();
69+
7070 int rc = outWave .OpenForWrite (FileName ,freq ,(short )16 ,(short )channels );
7171 }
7272
@@ -85,31 +85,31 @@ public void append(int channel, short value)
8585 short [] myBuffer = new short [2 ];
8686 public void write_buffer (int val )
8787 {
88-
88+
8989 int k = 0 ;
9090 int rc = 0 ;
91-
92- rc = outWave .WriteData (buffer , bufferp [0 ]);
93- // REVIEW: handle RiffFile errors.
94- /*
91+
92+ rc = outWave .WriteData (buffer , bufferp [0 ]);
93+ // REVIEW: handle RiffFile errors.
94+ /*
9595 for (int j=0;j<bufferp[0];j=j+2)
9696 {
97-
97+
9898 //myBuffer[0] = (short)(((buffer[j]>>8)&0x000000FF) | ((buffer[j]<<8)&0x0000FF00));
9999 //myBuffer[1] = (short) (((buffer[j+1]>>8)&0x000000FF) | ((buffer[j+1]<<8)&0x0000FF00));
100100 myBuffer[0] = buffer[j];
101101 myBuffer[1] = buffer[j+1];
102102 rc = outWave.WriteData (myBuffer,2);
103103 }
104- */
104+ */
105105 for (int i = 0 ; i < channels ; ++i ) bufferp [i ] = (short )i ;
106106 }
107107
108108 public void close ()
109109 {
110- outWave .Close ();
110+ outWave .Close ();
111111 }
112-
112+
113113 /**
114114 *
115115 */
@@ -128,7 +128,7 @@ public void set_stop_flag()
128128 *
129129 public static Obuffer create_stdout_obuffer(MPEG_Args maplay_args)
130130 {
131- Obuffer thebuffer = null;
131+ Obuffer thebuffer = null;
132132 int mode = maplay_args.MPEGheader.mode();
133133 int which_channels = maplay_args.which_c;
134134 if (mode == Header.single_channel || which_channels != MPEG_Args.both)
0 commit comments