duration

Calculate two audio duration with frame

北城余情 提交于 2021-01-29 13:20:33
问题 I am stuck, I need a small logic. I have two audio durations x = "00:00:07:18" y = "00:00:06:00" H : M: S: F Answer should be x + y = 00:00:13:18 H=hours S= seconds M=minutes F=frame My question is if x = "00:00:03:14" y = "00:00:13:18" answer should be x + y = **00:00:17:02** If the frame is greater than 30 it should increase 1 in second. I am using power shell. How can I determine the logic to calculate both of this? 回答1: Calculation of the first 3 parts ( hour:minute:second ), we can

Aggregate in django with duration field

谁说我不能喝 提交于 2021-01-28 04:38:41
问题 My model is: class Mo(Model): dur = DurationField(default=timedelta(0)) price_per_minute = FloatField(default=0.0) minutes_int = IntegerField(default=0) # dublicates data from dur , only for test Some test data: for i in range(4): m = Mo(dur=timedelta(minutes=i), minutes_int=i, price_per_minute=10.0) m.save() I want to multiply the dur by price_per_minute and find Sum : r = Mo.objects.all().aggregate(res=Sum(F('dur')*F('price_per_minute'))) print(r['res']/(10e6 * 60)) but: Invalid connector

Time duration to string 2h instead 2h0m0s

落爺英雄遲暮 提交于 2021-01-27 12:20:44
问题 The default time.Duration String method formats the duration with adding 0s for minutes and 0m0s for hours. Is there function that I can use that will produce 5m instead 5m0s and 2h instead 2h0m0s ... or I have to implement my own? 回答1: Foreword: I released this utility in github.com/icza/gox, see timex.ShortDuration(). Not in the standard library, but it's really easy to create one: func shortDur(d time.Duration) string { s := d.String() if strings.HasSuffix(s, "m0s") { s = s[:len(s)-2] } if

Time duration to string 2h instead 2h0m0s

痴心易碎 提交于 2021-01-27 12:20:22
问题 The default time.Duration String method formats the duration with adding 0s for minutes and 0m0s for hours. Is there function that I can use that will produce 5m instead 5m0s and 2h instead 2h0m0s ... or I have to implement my own? 回答1: Foreword: I released this utility in github.com/icza/gox, see timex.ShortDuration(). Not in the standard library, but it's really easy to create one: func shortDur(d time.Duration) string { s := d.String() if strings.HasSuffix(s, "m0s") { s = s[:len(s)-2] } if

Exoplayer2 - ConcatenatingMediaSource, duration of all sources

六月ゝ 毕业季﹏ 提交于 2021-01-27 11:56:42
问题 I have basic code for playing couple of audio files via exoplayer ExtractorMediaSource audioSource = new ExtractorMediaSource(uri, dataSourceFactory, extractor, null, null); ExtractorMediaSource audioSource2 = new ExtractorMediaSource(uri2, dataSourceFactory2, extractor, null, null); ConcatenatingMediaSource concatenatedSource = new ConcatenatingMediaSource(audioSource, audioSource2); I'm trying to get duration off all media sources using code example from https://github.com/google/ExoPlayer

C# OpenXML PowerPoint How to get Slide Duration

寵の児 提交于 2021-01-05 09:14:31
问题 How can I get total slide duration time in PPTX file inculde effect? using (PresentationDocument doc = PresentationDocument.Open(@"C:\powerpoint\sample.pptx", true)) { // Get the presentation part of the document. PresentationPart presentationPart = doc.PresentationPart; // No presentation part? Something is wrong with the document. if (presentationPart == null) { throw new ArgumentException("fileName"); } Console.WriteLine(presentationPart.SlideParts.Count() + "count"); // I want to get like

C# OpenXML PowerPoint How to get Slide Duration

大兔子大兔子 提交于 2021-01-05 09:13:10
问题 How can I get total slide duration time in PPTX file inculde effect? using (PresentationDocument doc = PresentationDocument.Open(@"C:\powerpoint\sample.pptx", true)) { // Get the presentation part of the document. PresentationPart presentationPart = doc.PresentationPart; // No presentation part? Something is wrong with the document. if (presentationPart == null) { throw new ArgumentException("fileName"); } Console.WriteLine(presentationPart.SlideParts.Count() + "count"); // I want to get like

How to check if a 2 specific time falls in between 2 times (Shifts) in Excel?

丶灬走出姿态 提交于 2020-08-10 19:17:22
问题 1.I want to find out if an event with start time and end time falls "inside" or "Outside" working shifts for associates. 2.Segregate and calculate the production duration that falls within shift hours or outside shift hours. (The Shift timings are 5pm to 2am which would be the next day so that is something to look out of for.) In the attached image you can see that Row 2 : Stamp_IST is the starting time and Stamps_IST End is the end of that event (Production Hrs), For example in row 6 the