-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc8639e
commit 9e89e27
Showing
4 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using LibSasara.Model; | ||
using LibSasara.VoiSona; | ||
using LibSasara.VoiSona.Model.Talk; | ||
|
||
ConsoleApp.Run<Label>(args); | ||
|
||
public class Label: ConsoleAppBase | ||
{ | ||
[RootCommand] | ||
public async ValueTask<int> ExportAsync( | ||
[Option("t", "path to a target tstprj file")] | ||
string pathToPrj, | ||
[Option("d", "path to export lab files")] | ||
string? destination = "" | ||
) | ||
{ | ||
if(!Path.Exists(pathToPrj)){ | ||
return 1; | ||
} | ||
if(!Directory.Exists(destination)){ | ||
destination = Path.GetDirectoryName(pathToPrj); | ||
if (string.IsNullOrEmpty(destination)) return 1; | ||
} | ||
|
||
|
||
var tstprj = await LibVoiSona | ||
.LoadAsync<TstPrj>(pathToPrj); | ||
var labs = tstprj | ||
.GetAllTracks() | ||
.SelectMany(v => v.Utterances) | ||
.Where(v => v.Text != "") | ||
.Select(v => (v.Text, v.Label)) | ||
; | ||
foreach(var lab in labs){ | ||
var name = $"{destination}{Path.DirectorySeparatorChar}{lab.Text}.lab"; | ||
string content = lab.Label!.ToString(); | ||
await File | ||
.WriteAllTextAsync(name, content); | ||
} | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>latest</LangVersion> | ||
|
||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
<TrimMode>partial</TrimMode> | ||
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols> | ||
<DebuggerSupport>false</DebuggerSupport> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<Target Name="MakeZipPackage" AfterTargets="Publish"> | ||
<MakeDir Directories="$(OutputPath)/../../../../../VoiSonaTalkLab/publish/" /> | ||
<Delete Files="$(OutputPath)/LibSasara.xml" /> | ||
<Delete Files="$(OutputPath)/LibSasara.VoiSona.xml" /> | ||
<Delete Files="$(OutputPath)/$(AssemblyName).pdb" /> | ||
<Delete Files="$(OutputPath)/publish/$(AssemblyName).pdb" /> | ||
<Delete Files="$(OutputPath)/publish/*.xml" /> | ||
<Delete Files="$(OutputPath)/publish/LibSasara.xml" /> | ||
<Delete Files="$(OutputPath)/publish/LibSasara.VoiSona.xml" /> | ||
<ZipDirectory SourceDirectory="$(OutputPath)/publish/" DestinationFile="$(OutputPath)/../../../../../VoiSonaTalkLab/publish/$(AssemblyName)-$(RuntimeIdentifier)-v.$(Version).zip" Overwrite="true" /> | ||
<Message Text="Actions After Publish" Importance="high" /> | ||
</Target> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="ConsoleAppFramework" Version="4.2.4" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\LibSasara.VoiSona\LibSasara.VoiSona.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Sample; VoiSonaTalkLab | ||
|
||
timing label files (`*.lab`) exporter from VoiSona Talk project file (`*.tstprj`). | ||
|
||
## Requirements | ||
|
||
- Windows x64 (Win 7.0 >=) | ||
- macOS x64 (macOS 10.12 Sierra >=) | ||
- macOS arm64 (macOS 10.15 "Catalina" >=) | ||
- Linux x64 | ||
|
||
*Only Windows has been tested. | ||
|
||
## Download | ||
|
||
[Releases](https://github.com/InuInu2022/LibSasara/releases) | ||
|
||
## Usage | ||
|
||
```cmd | ||
//windows | ||
VoiSonaTalkLab.exe -t path\to\yourawesomeproject.tstprj -d pato\to\exportlabfiles\ | ||
//mac, linux | ||
VoiSonaTalkLab -t path/to/yourawesomeproject.tstprj -d pato/to/exportlabfiles/ | ||
``` | ||
|
||
Please check `--help` command. |