Android TTS会停止音乐播放器

时间:2011-10-07 05:49:43

标签: android audio text-to-speech

在我的应用程序中,我使用

Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);

我的应用程序中的texttospeech输出。

当我启动Android音乐播放器并且正在听音乐然后启动我的应用程序时,音乐立即退出播放。 (HTC Desire)

如何解决音乐继续播放?

目录下载:

10-07 08:39:33.783: ERROR/Tialawl.FindYourRun(11382): before Intent
10-07 08:39:33.793: ERROR/Tialawl.FindYourRun(11382): before check
10-07 08:39:33.793: ERROR/Tialawl.FindYourRun(11382): before start
10-07 08:39:33.793: INFO/ActivityManager(96): Starting activity: Intent { act=android.speech.tts.engine.CHECK_TTS_DATA cmp=com.svox.pico/.CheckVoiceData }
10-07 08:39:33.873: INFO/MediaPlaybackService(6625): get ACTION_MEDIA_MOUNTED signal...
10-07 08:39:33.873: DEBUG/MediaPlaybackService(6625): reloadQueue(), (q != null && q.length() > 1)...
10-07 08:39:33.873: DEBUG/MediaPlaybackService(6625): setCategory(0, -1, -1, -2, , -1)
10-07 08:39:33.973: INFO/MediaPlayer(6625): MediaPlayer reset()
10-07 08:39:33.983: VERBOSE/MediaPlayerService(67): [166] reset
10-07 08:39:33.983: DEBUG/AwesomePlayer(67): [U5B] reset (382)
10-07 08:39:33.983: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:33.983: WARN/TimedEventQueue(67): Event 212 was not found in the queue, already cancelled?
10-07 08:39:33.983: VERBOSE/AudioSink(67): stop
10-07 08:39:33.983: VERBOSE/AudioSink(67): close
10-07 08:39:33.983: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.003: DEBUG/MediaPlaybackService(6625): setDataSource path=content://media/external/audio/media/80
10-07 08:39:34.003: INFO/MediaPlayer(6625): MediaPlayer reset()
10-07 08:39:34.003: INFO/MediaPlayer(6625): MediaPlayer setDataSource(context, uri)
10-07 08:39:34.003: INFO/MediaPlayer(6625): MediaPlayer setDataSource(context, uri,headers)
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): Client(167) constructor
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): Create new client(167) from pid 6625, fd=27, offset=0, length=576460752303423487
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): setDataSource fd=27, offset=0, length=576460752303423487
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): st_dev  = 45825
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): st_mode = 32829
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): st_uid  = 1000
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): st_gid  = 1015
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): st_size = 3876992
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): calculated length = 3876992
10-07 08:39:34.013: VERBOSE/AudioCache(67): We only support url check function now.
10-07 08:39:34.013: VERBOSE/AudioCache(67): isQCPFileFormat() url=(null)
10-07 08:39:34.013: INFO/(67): Has ID3 info, size = 24624
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67): player type = 4
10-07 08:39:34.013: DEBUG/MediaPlayerService(67): player type = STAGEFRIGHT_PLAYER
10-07 08:39:34.013: VERBOSE/MediaPlayerService(67):  create StagefrightPlayer
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset (382)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] setDataSource (319)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] setDataSource_l (339)
10-07 08:39:34.023: DEBUG/MediaExtractor(67): [U5B] Create (47)
10-07 08:39:34.023: VERBOSE/MediaExtractor(67): Autodetected media content as 'audio/mpeg' with confidence 0.30
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] setDataSource_l (350)
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): disconnect(166) from pid 6625
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset (382)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset (382)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset (382)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (388)
10-07 08:39:34.023: DEBUG/AwesomePlayer(67): [U5B] reset_l (478)
10-07 08:39:34.023: DEBUG/MediaPlaybackService(6625): setDataSource finished
10-07 08:39:34.023: DEBUG/MediaPlaybackService(6625): prepare
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): [167] setAudioStreamType(3)
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): Client(166) destructor pid = 6625
10-07 08:39:34.023: VERBOSE/AudioSink(67): close
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): disconnect(166) from pid 6625
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): [167] prepareAsync
10-07 08:39:34.023: VERBOSE/MediaPlayerService(67): [167] notify (0x41690, 5, 0, 0)
10-07 08:39:34.033: VERBOSE/AlarmManager(96): Adding Alarm{466033b8 type 2 com.google.android.location} Jan. 02 07:15:53 nachm.
10-07 08:39:34.043: VERBOSE/MediaPlayerService(67): [167] notify (0x41690, 1, 0, 0)
10-07 08:39:34.043: DEBUG/MediaPlaybackService(6625): prepare finished
10-07 08:39:34.043: VERBOSE/MediaPlayerService(67): getDuration
10-07 08:39:34.043: VERBOSE/MediaPlayerService(67): [167] getDuration = 225000
10-07 08:39:34.043: DEBUG/MediaPlaybackService(6625): mMediaPlayer.getDuration(): 225000
10-07 08:39:34.043: DEBUG/MediaPlaybackService(6625): mMediaPlayer.getDuration(): 225000
10-07 08:39:34.043: VERBOSE/MediaPlayerService(67): [167] seekTo(0)
10-07 08:39:34.043: VERBOSE/MediaPlayerService(67): [167] notify (0x41690, 4, 0, 0)
10-07 08:39:34.053: INFO/EMMC(396): Action mounted + path: /mnt/sdcard
10-07 08:39:34.083: ERROR/MediaScannerService(396): Failed to delete file /data/data/com.android.providers.media/pause_scan
10-07 08:39:34.083: INFO/ActivityManager(96): Displayed activity com.tialawl.findyourrun/.FindYourRun: 1448 ms (total 1448 ms)
10-07 08:39:34.133: ERROR/Tialawl.FindYourRun(11382): onActivityResult

1 个答案:

答案 0 :(得分:0)

我假设你在欲望上运行2.2,并且你会在导航中遇到同样的问题。

您可以使用Music Mod代替股票播放器,或通过生根和升级到2.3来解决此问题。我的理解是,2.2既有新旧方式进行声音和画外音,虽然TTS支持新方式,但Desire附带的播放器却没有。

相关问题