本文整理汇总了C++中MediaPlayer::setAudioStreamType方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaPlayer::setAudioStreamType方法的具体用法?C++ MediaPlayer::setAudioStreamType怎么用?C++ MediaPlayer::setAudioStreamType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPlayer
的用法示例。
在下文中一共展示了MediaPlayer::setAudioStreamType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMediaPlayer
static void
com_media_ffmpeg_FFMpegPlayer_setAudioStreamType(JNIEnv *env, jobject thiz, int streamtype)
{
MediaPlayer* mp = getMediaPlayer(env, thiz);
if (mp == NULL ) {
jniThrowException(env, "java/lang/IllegalStateException", NULL);
return;
}
process_media_player_call( env, thiz, mp->setAudioStreamType(streamtype) , NULL, NULL );
}
示例2: getMediaPlayer
static void
wseemann_media_FFmpegMediaPlayer_setAudioStreamType(JNIEnv *env, jobject thiz, int streamtype)
{
__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "setAudioStreamType: %d", streamtype);
MediaPlayer* mp = getMediaPlayer(env, thiz);
if (mp == NULL ) {
jniThrowException(env, "java/lang/IllegalStateException", NULL);
return;
}
process_media_player_call( env, thiz, mp->setAudioStreamType(streamtype) , NULL, NULL );
}
示例3: newMediaPlayer
MediaPlayer* CameraService::newMediaPlayer(const char *file) {
MediaPlayer* mp = new MediaPlayer();
if (mp->setDataSource(file, NULL) == NO_ERROR) {
mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE);
mp->prepare();
} else {
LOGE("Failed to load CameraService sounds: %s", file);
return NULL;
}
return mp;
}
示例4: bootMusic
void BootAnimation::bootMusic()
{
int index;
MediaPlayer* mp = new MediaPlayer();
if((access(SYSTEM_BOOTMUSIC_FILE,F_OK))!=-1){
if (mp->setDataSource(SYSTEM_BOOTMUSIC_FILE, NULL) == NO_ERROR) {
mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE);
mp->prepare();
mp->setLooping(true);
}
AudioSystem::getStreamVolumeIndex(AUDIO_STREAM_ENFORCED_AUDIBLE, &index);
if (index != 0) {
mp->seekTo(0);
mp->start();
}
}
}
示例5: newMediaPlayer
MediaPlayer* CameraService::newMediaPlayer(const char *file) {
#ifdef MTK_CAMERAPROFILE_SUPPORT
AutoCPTLog cptlog(Event_CS_newMediaPlayer);
#endif
#ifdef MTK_CAMERA_BSP_SUPPORT
LOG1("[CameraService::newMediaPlayer] + (%s)\r\n", file);
#endif
MediaPlayer* mp = new MediaPlayer();
if (mp->setDataSource(file, NULL) == NO_ERROR) {
mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE);
mp->prepare();
} else {
ALOGE("Failed to load CameraService sounds: %s", file);
return NULL;
}
#ifdef MTK_CAMERA_BSP_SUPPORT
LOG1("[CameraService::newMediaPlayer] -\r\n");
#endif
return mp;
}