Skip to content

Kiritow/C4droid-Audio-Player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C4droid-Audio-Player C4droid音频播放器

###OpenSLES Powered

class AudioPlayer 音频播放类 AudioPlayer

方法 Methods
public
AudioPlayer()

构造播放引擎,初始化引擎
Initialize a player with engine.

int load(_const char_ URI)*

加载音乐资源,准备播放
Load the music resource, ready to play.

int unload()

卸载音乐资源.(析构时将自动进行)
Unload the music resource.(Called automatically on destroyed)

int setplay(bool played)

设置播放状态(true:播放,false:暂停)
Set play status.(true for play,false for pause)

int getstate()

获取播放状态
Get play status.

int getdur_static()

仅在暂停时获取音乐长度(毫秒)
Get the length of music when the status is "Paused"

int getdur_dynamic()

立刻获取音乐长度(毫秒)
Get the length of music at once.

~AudioPlayer()

释放音乐资源,销毁播放引擎.
Unload the music resource and destroy the engine and the player itself.

示例代码 Example Code

int main()
{
    AudioPlayer a;
    a.load("example.mp3");
    a.setplay(true);
    usleep(a.getdur_dynamic()*1000);
    return 0;
}

About

OpenSLES Powered Audio Player on Android ( C4droid )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published