当前位置: 首页>>代码示例>>Java>>正文


Java TDebug.out方法代码示例

本文整理汇总了Java中org.tritonus.share.TDebug.out方法的典型用法代码示例。如果您正苦于以下问题:Java TDebug.out方法的具体用法?Java TDebug.out怎么用?Java TDebug.out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tritonus.share.TDebug的用法示例。


在下文中一共展示了TDebug.out方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isConversionSupported

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Add conversion support for any MpegEncoding source with FrameRate or FrameSize not empty.
 * @param targetFormat
 * @param sourceFormat
 * @return
 */
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);
	}

	boolean conversion = super.isConversionSupported(targetFormat, sourceFormat);
	if (conversion == false)
	{
		AudioFormat.Encoding enc = sourceFormat.getEncoding();
		if (enc instanceof MpegEncoding)
		{
			if ((sourceFormat.getFrameRate() != AudioSystem.NOT_SPECIFIED) || (sourceFormat.getFrameSize() != AudioSystem.NOT_SPECIFIED))
			{
				conversion = true;
			}
		}
	}
	return conversion;
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:31,代码来源:MpegFormatConversionProvider.java

示例2: parseText

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Parse Text Frames.
 *
 * @param bframes
 * @param offset
 * @param size
 * @param skip
 * @return
 */
protected String parseText(byte[] bframes, int offset, int size, int skip)
{
    String value = null;
    try
    {
        String[] ENC_TYPES = { "ISO-8859-1", "UTF16", "UTF-16BE", "UTF-8" };
        value = new String(bframes, offset + skip, size - skip, ENC_TYPES[bframes[offset]]);
        value = chopSubstring(value, 0, value.length());
    }
    catch (UnsupportedEncodingException e)
    {
        if (TDebug.TraceAudioFileReader) TDebug.out("ID3v2 Encoding error :" + e.getMessage());
    }
    return value;
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:25,代码来源:MpegAudioFileReader.java

示例3: readFromStream

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Reads from the oggBitStream_ a specified number of Bytes(bufferSize_) worth
 * starting at index and puts them in the specified buffer[].
 *
 * @param buffer
 * @param index
 * @param bufferSize_
 * @return             the number of bytes read or -1 if error.
 */
private int readFromStream(byte[] buffer, int index, int bufferSize_)
{
  int bytes = 0;
  try
  {
    bytes = oggBitStream_.read(buffer, index, bufferSize_);
  }
  catch(Exception e)
  {
    if(TDebug.TraceAudioConverter) TDebug.out("Cannot Read Selected Song");
    bytes = -1;
  }
  currentBytes = currentBytes + bytes;
  return bytes;
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:25,代码来源:DecodedVorbisAudioInputStream.java

示例4: getAudioFileFormat

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
  * Return the AudioFileFormat from the given file.
  */
 public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException
 {
if (TDebug.TraceAudioFileReader) TDebug.out("getAudioFileFormat(File file)");
   InputStream inputStream = null;
   try
   {	  
  inputStream = new BufferedInputStream(new FileInputStream(file));	
  inputStream.mark(MARK_LIMIT);	    
  AudioFileFormat aff = getAudioFileFormat(inputStream);
  inputStream.reset();
     // Get Vorbis file info such as length in seconds.
     VorbisFile vf = new VorbisFile(file.getAbsolutePath());      
     return getAudioFileFormat(inputStream,(int) file.length(), (int) Math.round((vf.time_total(-1))*1000));
   }
catch (JOrbisException e)
{
	throw new IOException(e.getMessage());
}
  finally
  {
    if (inputStream != null) inputStream.close();
  }
 }
 
开发者ID:fredsa,项目名称:forplay,代码行数:27,代码来源:VorbisAudioFileReader.java

示例5: readFromStream

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Reads from the oggBitStream_ a specified number of Bytes(bufferSize_) worth
 * starting at index and puts them in the specified buffer[].
 *
 * @return the number of bytes read or -1 if error.
 */
private int readFromStream(byte[] buffer, int index, int bufferSize_)
{
  int bytes = 0;
  try
  {
    bytes = oggBitStream_.read(buffer, index, bufferSize_);
  }
  catch (Exception e)
  {
    if (TDebug.TraceAudioFileReader)
    {
      TDebug.out("Cannot Read Selected Song");
    }
    bytes = -1;
  }
  return bytes;
}
 
开发者ID:tino1b2be,项目名称:DTMF-Decoder,代码行数:24,代码来源:VorbisAudioFileReader.java

示例6: chopSubstring

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Extract
 * @param s
 * @param start
 * @param end
 * @return
 */
private String chopSubstring(String s, int start, int end)
{
    String str = null;
    // 11/28/04 - String encoding bug fix.
    try
    {
        str = s.substring(start, end);
        int loc = str.indexOf('\0');
        if (loc != -1) str = str.substring(0, loc);
    }
    catch (StringIndexOutOfBoundsException e)
    {
        // Skip encoding issues.
        if (TDebug.TraceAudioFileReader) TDebug.out("Cannot chopSubString " + e.getMessage());
    }
    return str;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:25,代码来源:MpegAudioFileReader.java

示例7: getEncoderVersion

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public String getEncoderVersion() {
	byte[] string=new byte[300];
	int res=nGetEncoderVersion(string);
	if (res<0) {
		if (res==-1) {
			throw new RuntimeException("Unexpected error in Lame.getEncoderVersion()");
		}
		handleNativeException(res);
	}
	String sRes="";
	if (res>0) {
		try {
			sRes=new String(string, 0, res, "ISO-8859-1");
		} catch (UnsupportedEncodingException uee) {
			if (TDebug.TraceAllExceptions) {
				TDebug.out(uee);
			}
			sRes=new String(string, 0, res);
		}
	}
	return sRes;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:23,代码来源:Lame.java

示例8: readParameters

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * workaround for missing paramtrization possibilities 
 * for FormatConversionProviders
 */
private void readParameters() {
	String v=getStringProperty("quality", quality2string(DEFAULT_QUALITY));
	DEFAULT_QUALITY=string2quality(v.toLowerCase(), DEFAULT_QUALITY);
	DEFAULT_BITRATE=getIntProperty("bitrate", DEFAULT_BITRATE);
	v=getStringProperty("chmode", chmode2string(DEFAULT_CHANNEL_MODE));
	DEFAULT_CHANNEL_MODE=string2chmode(v.toLowerCase(), DEFAULT_CHANNEL_MODE);
	DEFAULT_VBR = getBooleanProperty("vbr", DEFAULT_VBR);
	// set the parameters back so that user program can verify them
	try {
		System.setProperty(PROPERTY_PREFIX + "quality", quality2string(DEFAULT_QUALITY));
		System.setProperty(PROPERTY_PREFIX + "bitrate", String.valueOf(DEFAULT_BITRATE));
		System.setProperty(PROPERTY_PREFIX + "chmode", chmode2string(DEFAULT_CHANNEL_MODE));
		System.setProperty(PROPERTY_PREFIX + "vbr", String.valueOf(DEFAULT_VBR));
	}
	catch (Throwable t)
	{
		if (TDebug.TraceAllExceptions)
		{
			TDebug.out(t);
		}
	}
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:27,代码来源:Lame.java

示例9: getIntProperty

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private static int getIntProperty(String strName, int def)	{
	String	strPropertyName = PROPERTY_PREFIX + strName;
	int	value = def;
	try {
		String strValue = System.getProperty(strPropertyName, String.valueOf(def));
		value=new Integer(strValue).intValue();
	}
	catch (Throwable e)
	{
		if (TDebug.TraceAllExceptions)
		{
			TDebug.out(e);
		}
	}
	return value;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:17,代码来源:Lame.java

示例10: closePhysicalStream

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
private void closePhysicalStream()
{
	if (TDebug.TraceAudioConverter) TDebug.out("DecodedJorbisAudioInputStream.closePhysicalStream(): begin");
	m_oggSyncState.clear();
	try
	{
		if (m_oggBitStream != null)
		{
			m_oggBitStream.close();
		}
		getCircularBuffer().close();
	}
	catch (Exception e)
	{
		if (TDebug.TraceAllExceptions) { TDebug.out(e); }
	}
	if (TDebug.TraceAudioConverter) TDebug.out("DecodedJorbisAudioInputStream.closePhysicalStream(): end");
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:19,代码来源:JorbisFormatConversionProvider.java

示例11: getAudioFileFormat

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Returns AudioFileFormat from URL.
 */
       @Override
public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException
{		
	if (TDebug.TraceAudioFileReader) {TDebug.out("MpegAudioFileReader.getAudioFileFormat(URL): begin"); }
	long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED;
	URLConnection conn = url.openConnection();
	// Tell shoucast server (if any) that SPI support shoutcast stream.
	conn.setRequestProperty ("Icy-Metadata", "1");		
	InputStream	inputStream = conn.getInputStream();
	AudioFileFormat	audioFileFormat = null;
	try
	{
		audioFileFormat = getAudioFileFormat(inputStream, lFileLengthInBytes);
	}
	finally
	{
		inputStream.close();
	}
	if (TDebug.TraceAudioFileReader) {TDebug.out("MpegAudioFileReader.getAudioFileFormat(URL): end"); }
	return audioFileFormat;
}
 
开发者ID:projectestac,项目名称:jclic,代码行数:25,代码来源:MpegAudioFileReader.java

示例12: getAudioFileFormat

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Returns AudioFileFormat from URL.
 */
public AudioFileFormat getAudioFileFormat(URL url)
		throws UnsupportedAudioFileException, IOException
{
	if (TDebug.TraceAudioFileReader)
	{
		TDebug.out("MpegAudioFileReader.getAudioFileFormat(URL): begin");
	}
	long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED;
	URLConnection conn = url.openConnection();
	// Tell shoucast server (if any) that SPI support shoutcast stream.
	conn.setRequestProperty("Icy-Metadata", "1");
	InputStream inputStream = conn.getInputStream();
	AudioFileFormat audioFileFormat = null;
	try
	{
		audioFileFormat = getAudioFileFormat(inputStream, lFileLengthInBytes);
	}
	finally
	{
		inputStream.close();
	}
	if (TDebug.TraceAudioFileReader)
	{
		TDebug.out("MpegAudioFileReader.getAudioFileFormat(URL): end");
	}
	return audioFileFormat;
}
 
开发者ID:JacobRoth,项目名称:romanov,代码行数:31,代码来源:MpegAudioFileReader.java

示例13: MpegFormatConversionProvider

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**	
 * Constructor.
 */
public MpegFormatConversionProvider()
{
	super(Arrays.asList(INPUT_FORMATS), Arrays.asList(OUTPUT_FORMATS));
	if (TDebug.TraceAudioConverter) 
	{
		TDebug.out(">MpegFormatConversionProvider()");
	}
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:12,代码来源:MpegFormatConversionProvider.java

示例14: getAudioInputStream

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream)
{
	if (TDebug.TraceAudioConverter) 
	{
		TDebug.out(">MpegFormatConversionProvider.getAudioInputStream(AudioFormat targetFormat, AudioInputStream audioInputStream):");
	}
	return new DecodedMpegAudioInputStream(targetFormat, audioInputStream);
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:9,代码来源:MpegFormatConversionProvider.java

示例15: skipFrames

import org.tritonus.share.TDebug; //导入方法依赖的package包/类
/**
 * Skip frames.
 * You don't need to call it severals times, it will exactly skip given frames number.
 * @param frames
 * @return bytes length skipped matching to frames skipped.
 */
public long skipFrames(long frames)
{
	if (TDebug.TraceAudioConverter) TDebug.out("skip(long frames) : begin");		
	int framesRead = 0;
	int bytesReads = 0;
	try
	{
		for (int i=0;i<frames;i++)
		{
			Header header = m_bitstream.readFrame();
			if (header != null)
			{
				int fsize = header.calculate_framesize();					
				bytesReads = bytesReads + fsize;
			} 
			m_bitstream.closeFrame();
			framesRead++;
		} 
	}
	catch (BitstreamException e)
	{
		if (TDebug.TraceAudioConverter) TDebug.out(e);
	}
	if (TDebug.TraceAudioConverter) TDebug.out("skip(long frames) : end");
	currentFrame = currentFrame + framesRead;
	return bytesReads;
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:34,代码来源:DecodedMpegAudioInputStream.java


注:本文中的org.tritonus.share.TDebug.out方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。