public abstract class MP3Driver extends Object implements AudioDriver
Modifier and Type | Class and Description |
---|---|
static class |
MP3Driver.MP3File
File based driver to create a MP3 file.
|
static class |
MP3Driver.MP3Stream
Driver to write into an MP3 encoded output stream.
|
Modifier and Type | Field and Description |
---|---|
protected int |
cbr
MP3: Constant bit rate (-1=auto)
|
protected OutputStream |
out
Output stream to write the encoded MP3 to.
|
protected ByteBuffer |
sampleBuffer
Sample buffer to be encoded as MP3.
|
protected boolean |
vbr
Use variable bit rate mode?
|
protected int |
vbrQuality
MP3: Variable bit rate quality (0=best, 5=medium, 9=worst)
|
Constructor and Description |
---|
MP3Driver() |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
buffer()
Return the bytebuffer intended to hold the audio data.
|
void |
close()
Free the audio device.
|
protected abstract OutputStream |
getOut(String recordingFilename) |
void |
open(AudioConfig cfg,
String recordingFilename,
CPUClock cpuClock)
Open audio interface.
|
void |
setCbr(int cbr) |
void |
setVbr(boolean isVbr) |
void |
setVbrQuality(int vbrQuality) |
void |
write()
Write the complete contents of ByteBuffer to audio device.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pause
protected ByteBuffer sampleBuffer
protected int cbr
protected int vbrQuality
protected boolean vbr
protected OutputStream out
public void setCbr(int cbr)
public void setVbrQuality(int vbrQuality)
public void setVbr(boolean isVbr)
public void open(AudioConfig cfg, String recordingFilename, CPUClock cpuClock) throws IOException, LineUnavailableException
AudioDriver
open
in interface AudioDriver
cfg
- Configuration requested.recordingFilename
- name for a recordingIOException
LineUnavailableException
public void write() throws InterruptedException
AudioDriver
write
in interface AudioDriver
InterruptedException
public void close()
AudioDriver
close
in interface AudioDriver
public ByteBuffer buffer()
AudioDriver
buffer
in interface AudioDriver
protected abstract OutputStream getOut(String recordingFilename) throws IOException
IOException
Copyright © 2018 Ken Händel. All rights reserved.