设置我的代码,以便按下按钮并播放声音:
//button code
var image = Ti.UI.createImageView({
image : '/images/ok-button-up.png',
width : 185,
height : Ti.UI.SIZE,
touchEnabled : 'true',
});
//sound code
var sound = Ti.Media.createSound({
url: "sounds/sound.wav",
preload: true
});
//event
image.addEventListener('click', function(e){
sound.play();
});
我在控制台中收到此错误:
[WARN] : AudioSystem: AudioFlinger server died!
[WARN] : IMediaDeathNotifier: media server died
[ERROR] : MediaPlayer: error (100, 0)
[ERROR] : MediaPlayer: Should have subtitle controller already set
[ERROR] : MediaPlayer: Error (100,0)
[INFO] : ServiceManager: Waiting for service media.audio_flinger...
[INFO] : APSAnalyticsService: Analytics Service Started
[INFO] : APSAnalyticsService: Stopping Analytics Service
[INFO] : ServiceManager: Waiting for service media.audio_flinger...
[INFO] : ServiceManager: Waiting for service media.audio_flinger...
[INFO] : ServiceManager: Waiting for service media.audio_flinger...
我正在使用Titanium SDK版本5.3.1.GA
我正在使用Genymotion模拟器,运行Google Nexus 5 - 4.4.4 - API 19
感谢任何帮助