• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TDebug类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TDebug类属于org.tritonus.share包,在下文中一共展示了TDebug类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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:fredsa,项目名称:forplay,代码行数:25,代码来源:MpegAudioFileReader.java


示例3: 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


示例4: 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


示例5: 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


示例6: 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:fredsa,项目名称:forplay,代码行数:24,代码来源:VorbisAudioFileReader.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


示例16: MpegAudioFileReader

import org.tritonus.share.TDebug; //导入依赖的package包/类
public MpegAudioFileReader()
{
    super(MARK_LIMIT, true);
    if (TDebug.TraceAudioFileReader) TDebug.out(VERSION);
    try
    {
        weak = System.getProperty("mp3spi.weak");
    }
    catch (AccessControlException e)
    {
    }
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:13,代码来源:MpegAudioFileReader.java


示例17: 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:fredsa,项目名称:forplay,代码行数:30,代码来源:MpegAudioFileReader.java


示例18: getAudioInputStream

import org.tritonus.share.TDebug; //导入依赖的package包/类
/**
 * Return the AudioInputStream from the given InputStream.
 */
public AudioInputStream getAudioInputStream(InputStream inputStream) throws UnsupportedAudioFileException, IOException
{
    if (TDebug.TraceAudioFileReader) TDebug.out("MpegAudioFileReader.getAudioInputStream(InputStream inputStream)");
    if (!inputStream.markSupported()) inputStream = new BufferedInputStream(inputStream);
    return super.getAudioInputStream(inputStream);
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:10,代码来源:MpegAudioFileReader.java


示例19: continueFromBufferFull

import org.tritonus.share.TDebug; //导入依赖的package包/类
private void continueFromBufferFull()
{
  if(getCircularBuffer().availableWrite() < 2 * vorbisInfo.channels * bout)
  {
    if(TDebug.TraceAudioConverter) TDebug.out("Too much data in this data packet, better return, let the channel drain, and try again...");
    // Don't change play state.
    return;
  }
  getCircularBuffer().write(convbuffer, 0, 2 * vorbisInfo.channels * bout);
  // Don't change play state. Let outputSamples change play state, if necessary.
  outputSamples();
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:13,代码来源:DecodedVorbisAudioInputStream.java


示例20: dumpInternalState

import org.tritonus.share.TDebug; //导入依赖的package包/类
private void dumpInternalState()
{
	TDebug.out("m_lReadPos  = " + m_lReadPos + " ^= "+getReadPos());
	TDebug.out("m_lWritePos = " + m_lWritePos + " ^= "+getWritePos());
	TDebug.out("availableRead()  = " + availableRead());
	TDebug.out("availableWrite() = " + availableWrite());
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:8,代码来源:TCircularBuffer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OAuthAccessResourceRequest类代码示例发布时间:2022-05-23
下一篇:
Java BooleanHolder类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap