开发者

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

开发者 https://www.devze.com 2023-03-12 07:34 出处:网络
I need to extract first Ten(10) secs from an audio 开发者_如何学运维file. We have the following code.

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

精彩评论

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