开发者

Titanium Extracting first 10 secs of audio from Ti.MediaSound Object

I need to extract first Ten(10) secs from an audio 开发者_如何学运维file.

We have the following code.

var file = recording.stop(); 
sound = Titanium.Media.createSound({sound:file});

I need to extract first 10 seconds from sound object.

How we can do this?

Also, How to merge two sound objects.

ex:

sound1 has 10 secs and sound2 has 15secs.

I want sound3 which is sound1 + sound2,

which should play both sound1 and sound2 continuously.

Thanks in Advance.


var sound = Ti.Media.createSound({
    sound: file,
    duration: 10
});

That will get you the first 10 seconds of the sound however even with the looping set to true you will need to create your own custom timers to alternate between the sounds playing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜