Skip to content

Commit

Permalink
Fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Oct 11, 2024
1 parent fe996e6 commit a885957
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions flutter/sherpa_onnx/lib/src/offline_speaker_diarization.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Copyright (c) 2024 Xiaomi Corporation
import 'dart:convert';
import 'dart:ffi';
import 'dart:typed_data';

import 'package:ffi/ffi.dart';

import './sherpa_onnx_bindings.dart';
import './speaker_identification.dart';
import './utils.dart';

class OfflineSpeakerDiarizationSegment {
const OfflineSpeakerDiarizationSegment({
Expand Down Expand Up @@ -226,7 +224,7 @@ class OfflineSpeakerDiarization {

final ans = <OfflineSpeakerDiarizationSegment>[];
for (int i = 0; i != numSegments; ++i) {
final s = segments.elementAt(i);
final s = segments + i;

final tmp = OfflineSpeakerDiarizationSegment(
start: s.ref.start, end: s.ref.end, speaker: s.ref.speaker);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define SHERPA_ONNX_CSRC_OFFLINE_SPEAKER_DIARIZATION_PYANNOTE_IMPL_H_

#include <algorithm>
#include <memory>
#include <unordered_map>
#include <utility>
#include <vector>
Expand Down
3 changes: 2 additions & 1 deletion sherpa-onnx/jni/offline-speaker-diarization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Java_com_k2fsa_sherpa_onnx_OfflineSpeakerDiarization_processWithCallback(
jfloat *p = env->GetFloatArrayElements(samples, nullptr);
jsize n = env->GetArrayLength(samples);
auto segments =
sd->Process(p, n, callback_wrapper, (void *)arg).SortByStartTime();
sd->Process(p, n, callback_wrapper, reinterpret_cast<void *>(arg))
.SortByStartTime();
env->ReleaseFloatArrayElements(samples, p, JNI_ABORT);

return ProcessImpl(env, segments);
Expand Down

0 comments on commit a885957

Please sign in to comment.