public class MediaRecorderBuilder extends Object
Constructor and Description |
---|
MediaRecorderBuilder() |
Modifier and Type | Method and Description |
---|---|
MediaRecorderBuilder |
audioChannels(int numChannels)
Set the number of audio channels in the media recorder.
|
MediaRecorderBuilder |
bitRate(int bitRate)
Sets the bit rate for the recorder.
|
Media |
build()
Builds the MediaRecorder with the given settings.
|
int |
getAudioChannels()
Gets the current audio channels settings.
|
int |
getBitRate()
Gets the current bit rate.
|
String |
getMimeType()
Gets the current mimetype.
|
String |
getPath()
Gets the current output path.
|
int |
getSamplingRate()
Gets the current sampling rate.
|
boolean |
isRedirectToAudioBuffer()
True if the media recorder should redirect output to an audio buffer instead
of a file.
|
MediaRecorderBuilder |
mimeType(String mimeType)
Sets the mimetype to use for encoding the audio file.
|
MediaRecorderBuilder |
path(String path)
Sets the output path where the audio recording should be saved.
|
MediaRecorderBuilder |
redirectToAudioBuffer(boolean redirect)
Set this flag to true to redirect the microphone input to an audio buffer.
|
MediaRecorderBuilder |
samplingRate(int samplingRate)
Sets the sampling rate for the recorder.
|
public MediaRecorderBuilder audioChannels(int numChannels)
numChannels
- The number of audio channels in the media recorder.public MediaRecorderBuilder bitRate(int bitRate)
bitRate
- The bit rate for the recorder.public MediaRecorderBuilder samplingRate(int samplingRate)
samplingRate
- The sample rate for the recorder.public MediaRecorderBuilder mimeType(String mimeType)
mimeType
- The mimetype to use for encoding the audio file.MediaManager.getAvailableRecordingMimeTypes()
public MediaRecorderBuilder path(String path)
path
- The output path where the recording should be saved as
a FileSystemStorage
pathpublic MediaRecorderBuilder redirectToAudioBuffer(boolean redirect)
redirect
- True to redirect output to an audio buffer. The path(java.lang.String)
parameter would then be used as the path to the audio buffer instead of the output file.public Media build() throws IOException
IOException
IllegalStateException
- If path(java.lang.String)
is not set.public int getAudioChannels()
public int getBitRate()
public int getSamplingRate()
public String getMimeType()
public String getPath()
public boolean isRedirectToAudioBuffer()