Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24082] Ti.Media.soundPlayer is not working on Android KitKat (4.4)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-12-05T18:24:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsAndroid
Labelsn/a
ReporterMostafizur Rahman
AssigneeFrankie Merzadyan
Created2016-10-28T19:40:04.000+0000
Updated2017-01-17T18:52:09.000+0000

Description

Hello, Ti.Media.soundPlayer is not working on Android KitKat (4.4). The sound is not playing. Although its working fine on android 5.1.1. *Testing Environment:* Operating System Name = Mac OS X Version = 10.11.3 Architecture = 64bit # CPUs = 4 Memory = 4294967296 Node.js Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium CLI CLI Version = 5.0.9 Titanium SDK SDK Version = 5.5.1.GA SDK Path = /Users/GSLMAC3/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/mobilesdk/osx/5.5.1.GA Android devices: Samsung Galxy tab 3 v 4.4.2, Samsung Galaxy Grand Prime (5.1.1) *Test Code:* app.js
var win = Titanium.UI.createWindow({  
    title:'Audio Test',
    backgroundColor:'#fff',
    layout: 'vertical'

});

var audioPlayer = Ti.Media.createSound({
        url : 'whatsupdogs.wav',
        allowBackground : true
});
audioPlayer.play();
win.open();
*Testing Result:* Ti.Media.soundPlayer is not working on Android KitKat (4.4).

Attachments

FileDateSize
whatsupdogs.wav2016-11-08T14:55:14.000+000051268

Comments

  1. Gary Mathews 2016-11-07

    I cannot reproduce the problem. The WAV file I used played fine on my Android 4.4 emulator.
  2. Gary Mathews 2016-11-07

    [~mrahman] Could you provide the audio file you are attempting to play? I believe it may not be encoded correctly.
  3. Farzad Merzadyan 2016-11-15

    PR: https://github.com/appcelerator/titanium_mobile/pull/8607 *Test case: (Android 4.4.2) you should not be getting this error in log output:* {noformat} (KrollRuntimeThread) [104,104] Error setting file descriptor: java.io.IOException: setDataSourceFD failed.: status=0x80000000 at android.media.MediaPlayer._setDataSource(Native Method) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1277) at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:107) at ti.modules.titanium.media.TiSound.play(TiSound.java:216) at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:155) at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:196) at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:319) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:146) at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) {noformat}
       var win = Titanium.UI.createWindow({
       	title:'Audio Test',
       	backgroundColor:'#fff',
       	layout: 'vertical'
       	
       });
       
       var audioPlayer = Ti.Media.createSound({
       	url : 'whatsupdogs.wav',
       	allowBackground : true
       });
       audioPlayer.play();
       win.open();
       
  4. Gary Mathews 2016-12-05

    master: https://github.com/appcelerator/titanium_mobile/pull/8657
  5. Samir Mohammed 2017-01-17

    Verified fixed; the provided sound file is able to be played on 4.4.4 devices and 4.4.2 devices. *Environement*
       Appcelerator Command-Line Interface, version 6.1.0
       Samsung Galaxy s4 (Android version 4.4.4)
       Samsung Galaxy s5 (octa-core) (Android version 4.4.2)
       Operating System Name: Mac OS X El Capitan
       Operating System Version: 10.11.6
       Node.js Version: 4.6.0
       npm: 4.2.8
       Titanium SDK Version: 6.1.0.v20170115172707
       Xcode: 8.2
       Appcelerator Studio: 4.8.1.201612050850
       

JSON Source