How to pass float value, where data type is CMTime?

I am creating an application in which I need to mix songs. I performed this, but the problem is that I am using the following function.

- (BOOL)insertTimeRange:(CMTimeRange)timeRange ofTrack:(AVAssetTrack *)track atTime:(CMTime)startTime error:(NSError **)error; 

I need to pass the CMTime value in the atTime parameter, but it does not take the Float value, and I need to add another song with some floating point value. Is it possible how?

+6
source share
1 answer

You can use one of the functions CMTimeMake...() . You must specify a time point and a timeline value. The first is a 64-bit integer; you can just crop or round your float to convert it to an integer or use a necessarily high timeline:

 CMTime tm = CMTimeMake(53425, 10000); // @ 5.3425 sec 
+14
source

All Articles