java.lang.Object | |
↳ | org.opencdnunion.media.streamer.capture.AudioPlayerCapture |
Audio player capture.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | AudioPlayerCapture.OnCompletionListener | The interface On completion listener. | |||||||||
interface | AudioPlayerCapture.OnErrorListener | The interface on audio play error listener. | |||||||||
interface | AudioPlayerCapture.OnPreparedListener | The interface on media prepared listener. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AUDIO_PLAYER_TYPE_AUDIOTRACK | The constant AUDIO_PLAYER_TYPE_AUDIOTRACK. | |||||||||
int | AUDIO_PLAYER_TYPE_OPENSLES | The constant AUDIO_PLAYER_TYPE_OPENSLES. | |||||||||
int | ERROR_IO | The constant ERROR_IO. | |||||||||
int | ERROR_UNKNOWN | The constant ERROR_UNKNOWN. | |||||||||
int | ERROR_UNSUPPORTED | The constant ERROR_UNSUPPORTED. | |||||||||
int | STATE_IDLE | The constant STATE_IDLE. | |||||||||
int | STATE_PREPARING | The constant STATE_PREPARING. | |||||||||
int | STATE_STARTED | The constant STATE_STARTED. | |||||||||
int | STATE_STOPPING | The constant STATE_STOPPING. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AudioPlayerCapture(Context context)
Instantiates a new Audio player capture.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AudioFilterMgt |
getAudioFilterMgt()
Gets audio filter mgt.
| ||||||||||
long |
getDuration()
Gets duration.
| ||||||||||
boolean |
getMute()
Gets mute.
| ||||||||||
long |
getPosition()
Gets position.
| ||||||||||
SrcPin<AudioBufFrame> |
getSrcPin()
Gets src pin.
| ||||||||||
float |
getVolume()
Gets volume.
| ||||||||||
void |
pause()
Pause.
| ||||||||||
void |
release()
Release.
| ||||||||||
void |
resume()
Resume.
| ||||||||||
void |
seek(long ms)
Seek.
| ||||||||||
void |
setAudioPlayerType(int type)
Set audio player type.
| ||||||||||
void |
setMute(boolean mute)
Sets mute.
| ||||||||||
void |
setOnCompletionListener(AudioPlayerCapture.OnCompletionListener listener)
Sets on completion listener.
| ||||||||||
void |
setOnErrorListener(AudioPlayerCapture.OnErrorListener listener)
Sets on error listener.
| ||||||||||
void |
setOnPreparedListener(AudioPlayerCapture.OnPreparedListener listener)
Sets on prepared listener.
| ||||||||||
void |
setVolume(float volume)
Sets volume.
| ||||||||||
void |
start(String url)
Start audio player.
| ||||||||||
void |
start(String url, boolean loop)
Start audio player.
| ||||||||||
void |
stop()
Stop.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
The constant AUDIO_PLAYER_TYPE_AUDIOTRACK.
The constant AUDIO_PLAYER_TYPE_OPENSLES.
The constant ERROR_IO.
The constant ERROR_UNKNOWN.
The constant ERROR_UNSUPPORTED.
The constant STATE_IDLE.
The constant STATE_PREPARING.
The constant STATE_STARTED.
The constant STATE_STOPPING.
Instantiates a new Audio player capture.
context | the context |
---|
Gets duration.
Gets mute.
Gets position.
Gets volume.
Pause.
Release.
Resume.
Seek.
ms | the time seek to, in miliseconds |
---|
Set audio player type.
type | type in AUDIO_PLAYER_TYPE_AUDIOTRACK or AUDIO_PLAYER_TYPE_OPENSLES. |
---|
Sets mute.
mute | true to mute, false to unmute |
---|
Sets on completion listener.
listener | the listener |
---|
Sets on error listener.
listener | the listener |
---|
Sets on prepared listener.
listener | the listener |
---|
Sets volume.
volume | the volume, should be 0.0f-1.0f |
---|
Start audio player.
url | the url. prefix "file://" for absolute path, and prefix "assets://" for resource in assets folder, also prefix "http://", "https://" supported. |
---|
Start audio player.
url | the url. prefix "file://" for absolute path, and prefix "assets://" for resource in assets folder, also prefix "http://", "https://" supported. |
---|---|
loop | set if in loop play mode |
Stop.