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, waitpauseprotected 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
AudioDriveropen in interface AudioDrivercfg - Configuration requested.recordingFilename - name for a recordingIOExceptionLineUnavailableExceptionpublic void write()
throws InterruptedException
AudioDriverwrite in interface AudioDriverInterruptedExceptionpublic void close()
AudioDriverclose in interface AudioDriverpublic ByteBuffer buffer()
AudioDriverbuffer in interface AudioDriverprotected abstract OutputStream getOut(String recordingFilename) throws IOException
IOExceptionCopyright © 2018 Ken Händel. All rights reserved.