Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Oct 17, 2023
1 parent 66e5d87 commit b9d37eb
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 9 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@ jobs:
with:
dotnet-version: 6.0.x

# *********** REMOVE AFTER RELEASE **********************
- name: mkdir NuGet directory
run: mkdir -p ~/.nuget/NuGet/local-nuget

- name: Add local NuGet source
run: dotnet nuget add source local-nuget

- name: Pack Porcupine for local ref
run: dotnet pack -c Release
working-directory: resources/porcupine/binding/dotnet

- name: Copy Porcupine Nuget
run: cp ../../../resources/porcupine/binding/dotnet/Porcupine/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget

- name: Pack Rhino for local ref
run: dotnet pack -c Release
working-directory: resources/rhino/binding/dotnet

- name: Copy Rhino Nuget
run: cp ../../../resources/rhino/binding/dotnet/Rhino/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget

- name: Pack Picovoice for local ref
run: dotnet pack ../../../sdk/dotnet/Picovoice/Picovoice.csproj -c Release

- name: Copy Picovoice Nuget
run: cp ../../../sdk/dotnet/Picovoice/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget
# ******************************************************

- name: Dotnet build micdemo
run: dotnet build -c MicDemo.Release -v n

Expand Down Expand Up @@ -84,6 +112,34 @@ jobs:
with:
submodules: recursive

# *********** REMOVE AFTER RELEASE **********************
- name: mkdir NuGet directory
run: mkdir -p ~/.nuget/NuGet/local-nuget

- name: Add local NuGet source
run: dotnet nuget add source local-nuget

- name: Pack Porcupine for local ref
run: dotnet pack -c Release
working-directory: resources/porcupine/binding/dotnet

- name: Copy Porcupine Nuget
run: cp ../../../resources/porcupine/binding/dotnet/Porcupine/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget

- name: Pack Rhino for local ref
run: dotnet pack -c Release
working-directory: resources/rhino/binding/dotnet

- name: Copy Rhino Nuget
run: cp ../../../resources/rhino/binding/dotnet/Rhino/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget

- name: Pack Picovoice for local ref
run: dotnet pack ../../../sdk/dotnet/Picovoice/Picovoice.csproj -c Release

- name: Copy Picovoice Nuget
run: cp ../../../sdk/dotnet/Picovoice/bin/Release/*.nupkg ~/.nuget/NuGet/local-nuget
# ******************************************************

- name: Dotnet build micdemo
run: dotnet build -c MicDemo.Release -v n

Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Picovoice/Picovoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void Process(short[] pcm)

/// <summary>
/// Resets the internal state of Picovoice. It should be called before processing a new stream of audio
/// or when process was stopped while processing a stream of audio.
/// or when Picovoice was stopped while processing a stream of audio.
/// </summary>
public void Reset()
{
Expand Down
6 changes: 3 additions & 3 deletions sdk/dotnet/Picovoice/Picovoice.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.0;netstandard2.0</TargetFrameworks>
<Version>2.2.2</Version>
<Version>3.0.0</Version>
<Authors>Picovoice</Authors>
<Company />
<Product>Picovoice End-to-End Platform</Product>
Expand Down Expand Up @@ -35,10 +35,10 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Porcupine" Version="2.2.3">
<PackageReference Include="Porcupine" Version="3.0.0">
<PrivateAssets>analyzers</PrivateAssets>
</PackageReference>
<PackageReference Include="Rhino" Version="2.2.3">
<PackageReference Include="Rhino" Version="3.0.0">
<PrivateAssets>analyzers</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
8 changes: 3 additions & 5 deletions sdk/dotnet/PicovoiceTest/MainTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,18 @@ public void RunTestCase(string audioFileName, string expectedIntent, Dictionary<

[TestMethod]
public void TestReset()
{
void callback() => _picovoice.Reset();

{
_picovoice = Picovoice.Create(
_accessKey,
GetKeywordPath("en", "picovoice"),
callback,
() => _picovoice.Reset(),
GetContextPath("en", "coffee_maker"),
_inferenceCallback);

_inference = null;
ProcessFileHelper("picovoice-coffee.wav");

Assert.Null(_inference);
Assert.IsNull(_inference);
}

[TestMethod]
Expand Down

0 comments on commit b9d37eb

Please sign in to comment.