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

Java AudioRecorder类代码示例

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

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



AudioRecorder类属于com.badlogic.gdx.audio包,在下文中一共展示了AudioRecorder类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) {
	if (noDevice) return new AudioRecorder() {
		@Override
		public void read (short[] samples, int offset, int numSamples) {
		}

		@Override
		public void dispose () {
		}
	};
	return new JavaSoundAudioRecorder(samplingRate, isMono);
}
 
开发者ID:Xemiru,项目名称:Undertailor,代码行数:13,代码来源:OpenALAudio.java


示例2: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) {
	if (soundPool == null) {
		throw new GdxRuntimeException("Android audio is not enabled by the application config.");
	}
	return new AndroidAudioRecorder(samplingRate, isMono);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:AndroidAudio.java


示例3: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
    if (noDevice) {
        return new AudioRecorder() {
            @Override
            public void read(short[] samples, int offset, int numSamples) {
            }

            @Override
            public void dispose() {
            }
        };
    }
    return new JavaSoundAudioRecorder(samplingRate, isMono);
}
 
开发者ID:kovertopz,项目名称:libGDX-LWJGL-Audio,代码行数:16,代码来源:OpenALAudio.java


示例4: run

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public void run() 
{
	int ticks = Math.max(1, config.bufferSize / PdBase.blockSize());
	
	short [] inBuffer = new short[config.bufferSize * config.inputChannels];
	short [] outBuffer = new short[config.bufferSize * config.outputChannels];
	
	AudioDevice device = createAudioDevice();
	
	AudioRecorder recorder = null;
	if(config.inputChannels > 0){
		recorder = Gdx.audio.newAudioRecorder(config.sampleRate, config.inputChannels < 2);
	}
	PdBase.openAudio(config.inputChannels, config.outputChannels, config.sampleRate);
	PdBase.computeAudio(true);
	
	final Runnable pollRunnable = new Runnable() {
		
		@Override
		public void run() {
			PdBase.pollPdMessageQueue();
			PdBase.pollMidiQueue();
			requirePolling = true;
		}
	};
	
	long nanoDuration = (long)(1e9 * (double)config.bufferSize / (double)config.sampleRate);
	
	long realTime = System.nanoTime();
	long logicTime = realTime;
	
	while(processing){
		if(recorder != null){
			recorder.read(inBuffer, 0, inBuffer.length);
		}
		
		realTime = System.nanoTime();
		long waitTime = (logicTime - realTime) / 1000000;
		if(waitTime > 0){
			try {
				Thread.sleep(waitTime);
			} catch (InterruptedException e) {
			}
		}else{
			logicTime = realTime;
		}
		logicTime += nanoDuration;
		
		PdBase.process(ticks, inBuffer, outBuffer);
		
		device.writeSamples(outBuffer, 0, outBuffer.length);
		
		if(requirePolling){
			Gdx.app.postRunnable(pollRunnable);
		}
	}
	
	device.dispose();
	
	if(recorder != null){
		recorder.dispose();
	}
}
 
开发者ID:mgsx-dev,项目名称:gdx-pd,代码行数:65,代码来源:PdAudioThread.java


示例5: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
    throw new GdxRuntimeException("AudioDevice not supported by TeaVM backend");
}
 
开发者ID:konsoletyper,项目名称:teavm-libgdx,代码行数:5,代码来源:TeaVMAudio.java


示例6: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) {
	throw new GdxRuntimeException("AudioRecorder not supported by GWT backend");
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:5,代码来源:GwtAudio.java


示例7: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
	return new MockAudioRecorder();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:5,代码来源:MockAudio.java


示例8: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:6,代码来源:IOSAudio.java


示例9: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
	return new TestAudioRecorder();
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:5,代码来源:MockAudio.java


示例10: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
	throw new ServerAudioException();
}
 
开发者ID:Olloth,项目名称:LibGDXServer,代码行数:5,代码来源:ServerAudio.java


示例11: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
public final AudioRecorder newAudioRecorder(int paramInt, boolean paramBoolean)
{
  return new AndroidAudioRecorder(paramInt, paramBoolean);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:5,代码来源:AndroidAudio.java


示例12: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
/** Creates a new {@link AudioRecorder}. The AudioRecorder has to be disposed after it is no longer used.
 * 
 * @param samplingRate the sampling rate in Hertz
 * @param isMono whether the recorder records in mono or stereo
 * @return the AudioRecorder
 * 
 * @throws GdxRuntimeException in case the recorder could not be created */
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono);
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:Audio.java


示例13: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
/**
 * Creates a new {@link AudioRecorder}. The AudioRecorder has to be disposed after it is no longer used.
 *
 * @param samplingRate the sampling rate in Hertz
 * @param isMono whether the recorder records in mono or stereo
 * @return the AudioRecorder
 *
 * @throws GdxRuntimeException in case the recorder could not be created
 */
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono);
 
开发者ID:kovertopz,项目名称:libGDX-LWJGL-Audio,代码行数:11,代码来源:Audio.java


示例14: newAudioRecorder

import com.badlogic.gdx.audio.AudioRecorder; //导入依赖的package包/类
public abstract AudioRecorder newAudioRecorder(int paramInt, boolean paramBoolean); 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:2,代码来源:Audio.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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