Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15830] iOS: Ti.Media.createSound "looping" set on creation fails

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
Labelsandroid, createsound, looping, sound
ReporterFokke Zandbergen
AssigneeUnknown
Created2013-09-06T08:12:56.000+0000
Updated2018-02-28T20:04:04.000+0000

Description

On iOS this works fine:
var music = Ti.Media.createSound({
    url: 'music.aac',
    looping: true
});
music.play();
On Android you need to set looping after creation and in the tests I ran even right before calling play(), or the music will stop after one or some loops.
var music = Ti.Media.createSound({
    url: 'music.aac',
    looping: true
});
music.looping = true;
music.play();

Logs

When the playback on Android stops, the logs show:
09-10 21:35:16.422: I/ALSAModule(1838): Terminated ALSA PLAYBACK device hifi
09-10 21:35:16.812: I/yamaha::media::UserDep(1838): UserDep::getRouteInfo(output: audioengine=0, devices=00000002h
09-10 21:35:16.812: I/yamaha::media::UserDep(1838):                       incall: onoff=0, devices=00000000h
09-10 21:35:16.812: I/yamaha::media::UserDep(1838):                       capture: onoff=0, devices=00000000h, audioSource=0
09-10 21:35:16.812: I/yamaha::media::UserDep(1838):                       playback: audio_onoff=0, line_onoff=0)

Steps to reproduce

Create a new app: titanium create -p ios,android -n testLoop -d . --id test.loop

As app.js use:

    var w = Ti.UI.createWindow({backgroundColor:'white'});
    var b = Ti.UI.createButton({title:'Play'});
    var m = Ti.Media.createSound({
        url: 'music.aac',
        looping: true
    });
    b.addEventListener('click', function () {
        m.play();
    });
    w.add(b);
    w.open();
    

Drop the attached music.acc (CCL) in the Resources folder.

Run the app on both iOS and Android and see the music stop on Android after one or some loops.

Attachments

FileDateSize
music.aac2013-09-10T19:37:31.000+0000121214

Comments

  1. Mauro Parra-Miranda 2013-09-09

    HEllo, I tested your iOS version in a device with Android 4.3, can't reproduce the issue. Anything in your logs? Any specific device? Best, Mauro
  2. Mauro Parra-Miranda 2013-09-09

    Tested, working fine.
  3. Fokke Zandbergen 2013-09-10

    Updated the description with exact step. Problem doesn't always occur after one loop, but sometimes after several. Setting looping after creation fixes it.
  4. Fokke Zandbergen 2013-11-26

    [~mpmiranda] did you try again after my update and comment on Sept 10th? I see you are on a closing-tickets spree but that shouldn't go without any decent response!

JSON Source