本文整理汇总了Java中com.jcraft.jorbis.Info类的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Info类属于com.jcraft.jorbis包,在下文中一共展示了Info类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
private void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
buffer = null;
bytes = 0;
oy.init();
}
示例2: init_jorbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
oggSyncState_ = new SyncState();
oggStreamState_ = new StreamState();
oggPage_ = new Page();
oggPacket_ = new Packet();
vorbisInfo = new Info();
vorbisComment = new Comment();
vorbisDspState = new DspState();
vorbisBlock = new Block(vorbisDspState);
buffer = null;
bytes = 0;
currentBytes = 0L;
oggSyncState_.init();
}
示例3: fromVorbisInfo
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initialize an {@code AudioTrack} from Vorbis {@code Info}.
*
* @param info Vorbis info
* @return Audio track
*/
public static AudioTrack fromVorbisInfo(Info info) {
int encoding = AudioFormat.ENCODING_PCM_16BIT;
int rate = info.rate;
int channel;
if (info.channels == 2) {
channel = AudioFormat.CHANNEL_OUT_STEREO;
} else {
channel = AudioFormat.CHANNEL_OUT_MONO;
}
int bufferSize = AudioTrack.getMinBufferSize(rate, channel, encoding);
bufferSize *= 8;
return new AudioTrack(AudioManager.STREAM_MUSIC,
rate, channel, encoding, bufferSize,
AudioTrack.MODE_STREAM);
}
示例4: openOutput
import com.jcraft.jorbis.Info; //导入依赖的package包/类
private void openOutput() throws IOException {
AudioFormat audioFormat = new AudioFormat((float) vorbisInfo.rate, 16, vorbisInfo.channels, true, false);
DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, AudioSystem.NOT_SPECIFIED);
if (!AudioSystem.isLineSupported(info))
{
throw new IOException("line format " + info + "not supported");
}
try
{
out = (SourceDataLine) AudioSystem.getLine(info);
out.open(audioFormat);
}
catch (LineUnavailableException e) {
throw new IOException("audio unavailable: " + e.toString());
}
out.start();
updateVolume(volume);
}
示例5: initJavaSound
import com.jcraft.jorbis.Info; //导入依赖的package包/类
private void initJavaSound(int channels, int rate) {
try {
AudioFormat audioFormat = new AudioFormat(rate, 16,
channels, true, // PCM_Signed
false // littleEndian
);
DataLine.Info info = new DataLine.Info(SourceDataLine.class,
audioFormat, AudioSystem.NOT_SPECIFIED);
if (!AudioSystem.isLineSupported(info)) {
throw new Exception("Line " + info + " not supported.");
}
outputLine = (SourceDataLine) AudioSystem.getLine(info);
// outputLine.addLineListener(this);
outputLine.open(audioFormat);
this.rate = rate;
this.channels = channels;
setBalance(balance);
setGain(gain);
} catch (Exception ex) {
LOGGER.log(Level.WARNING, "can not init sound system", ex);
}
}
示例6: initJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
private void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
buffer = null;
bytes = 0;
oy.init();
}
示例7: initJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
private void initJOrbis(){
oy=new SyncState();
os=new StreamState();
og=new Page();
op=new Packet();
vi=new Info();
vc=new Comment();
vd=new DspState();
vb=new Block(vd);
buffer=null;
bytes=0;
oy.init();
}
示例8: ADecoder
import com.jcraft.jorbis.Info; //导入依赖的package包/类
public ADecoder(){
info = new Info();
info.init();
comment = new Comment();
comment.init();
dsp = new DspState();
block = new Block(dsp);
}
示例9: initializeJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initializes OGG player
*/
private void initializeJOrbis() {
joggPacket = new Packet();
joggPage = new Page();
joggStreamState = new StreamState();
joggSyncState = new SyncState();
jorbisDspState = new DspState();
jorbisBlock = new Block(jorbisDspState);
jorbisComment = new Comment();
jorbisInfo = new Info();
joggSyncState.init();
}
示例10: initJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initialize JOrbis.
*/
void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
oy.init();
}
示例11: initializeJOrbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initializes JOrbis.
*/
private void initializeJOrbis()
{
joggPacket = new Packet();
joggPage = new Page();
joggStreamState = new StreamState();
joggSyncState = new SyncState();
jorbisDspState = new DspState();
jorbisBlock = new Block(jorbisDspState);
jorbisComment = new Comment();
jorbisInfo = new Info();
// Initialize SyncState
joggSyncState.init();
}
示例12: init_jorbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
oggSyncState_ = new SyncState();
oggStreamState_ = new StreamState();
oggPage_ = new Page();
oggPacket_ = new Packet();
vorbisInfo = new Info();
vorbisComment = new Comment();
vorbisDspState = new DspState();
vorbisBlock = new Block(vorbisDspState);
buffer = null;
bytes = 0;
oggSyncState_.init();
}
示例13: init
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initialize states.
*/
private void init() {
ogg_sync_state = new SyncState();
ogg_stream_state = new StreamState();
ogg_page = new Page();
ogg_packet = new Packet();
vorbis_info = new Info();
vorbis_comment = new Comment();
vorbis_dsp_state = new DspState();
vorbis_block = new Block(vorbis_dsp_state);
ogg_sync_state.init();
}
示例14: init_jorbis
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
m_oggSyncState = new SyncState();
m_oggStreamState = new StreamState();
m_oggPage = new Page();
m_oggPacket = new Packet();
m_vorbisInfo = new Info();
m_vorbisComment = new Comment();
m_vorbisDspState = new DspState();
m_vorbisBlock = new Block(m_vorbisDspState);
m_oggSyncState.init();
}
示例15: StreamService
import com.jcraft.jorbis.Info; //导入依赖的package包/类
/**
* Constructor for {@code StreamService}.
*/
public StreamService() {
/*
* Stream consumer
*/
this.consumer = new Decoder.Consumer() {
@Override
public void onRead(byte[] data, int off, int len) {
if (audio != null &&
audio.getState() == AudioTrack.STATE_INITIALIZED) {
audio.write(data, off, len);
}
}
@Override
public void onMeta(Meta meta) {
currentMeta = meta;
Message message = Message.obtain(
null, StreamServiceMessage.Type.META);
message.getData().putParcelable(
StreamServiceMessage.Response.VALUE, meta);
broadcast(message);
}
@Override
public void onInfo(Info info) {
audio = AudioUtils.fromVorbisInfo(info);
audio.play();
Message message = Message.obtain(
null, StreamServiceMessage.Type.STATUS);
message.getData().putInt(
StreamServiceMessage.Response.VALUE,
StreamServiceMessage.Response.STATUS_STARTED);
broadcast(message);
}
@Override
public void onFinish() {
if (audio != null &&
audio.getState() == AudioTrack.STATE_INITIALIZED) {
audio.release();
}
currentMeta = null;
Message message = Message.obtain(
null, StreamServiceMessage.Type.STATUS);
message.getData().putInt(
StreamServiceMessage.Response.VALUE,
StreamServiceMessage.Response.STATUS_STOPPED);
broadcast(message);
}
};
}