Support .Net framework 2.0 (#1062)
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
/// Copyright (c) 2024.5 by 东风破
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SherpaOnnx
|
||||
@@ -49,7 +48,15 @@ namespace SherpaOnnx
|
||||
// The caller should ensure all passed streams are ready for decoding.
|
||||
public void Decode(IEnumerable<OnlineStream> streams)
|
||||
{
|
||||
IntPtr[] ptrs = streams.Select(s => s.Handle).ToArray();
|
||||
// TargetFramework=net20 does not support System.Linq
|
||||
// IntPtr[] ptrs = streams.Select(s => s.Handle).ToArray();
|
||||
List<IntPtr> list = new List<IntPtr>();
|
||||
foreach (OnlineStream s in streams)
|
||||
{
|
||||
list.Add(s.Handle);
|
||||
}
|
||||
|
||||
IntPtr[] ptrs = list.ToArray();
|
||||
Decode(_handle.Handle, ptrs, ptrs.Length);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user