Skip to content

Commit

Permalink
Enhance: can chose voice file format from wav/ogg/aac.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakamoto committed Apr 12, 2015
1 parent eb6b58c commit f01c11c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ This is the clinet librray of HOYA Voice Text Web API for .NET.
Istllation
----------

You can install via nuget.org **with pre-release switch.**
You can install via nuget.org

PM> Install-Package VoiceTextWebAPI.Client -pre
PM> Install-Package VoiceTextWebAPI.Client

Usage
-----

```CSharp
```csharp
using VoiceTextWebAPI.Client;
...
public async void btn_OnClick()
Expand All @@ -26,7 +26,8 @@ public async void btn_OnClick()
EmotionLevel = EmotionLevel.High,
Volume = 50,
Speed = 120,
Pitch = 120
Pitch = 120,
Format = Format.WAV
};
var bytes = await client.GetVoiceAsync("こんにちは。");
File.WriteAllBytes(".\\result.wav", bytes);
Expand All @@ -35,4 +36,4 @@ public async void btn_OnClick()

License
-------
Copyright (c) 2014 @jsakamoto. Licensed under the MIT license.
Copyright (c) 2014 @jsakamoto. Licensed under the MIT license.
15 changes: 15 additions & 0 deletions VoiceTextWebAPI.Client/Format.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VoiceTextWebAPI.Client
{
public enum Format
{
WAV,
OGG,
AAC
}
}
4 changes: 2 additions & 2 deletions VoiceTextWebAPI.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct(".NET Client for VoiceText Web API")]
[assembly: AssemblyCopyright("Copyright © J.Sakamoto 2014, MIT License")]
[assembly: AssemblyCopyright("Copyright © J.Sakamoto 2014-2015, MIT License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,4 +32,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.1")]
4 changes: 4 additions & 0 deletions VoiceTextWebAPI.Client/VoiceTextClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class VoiceTextClient

public int Volume { get; set; }

public Format Format { get; set; }

public string APIKey { get; set; }

public Uri APIEndPoint { get; set; }
Expand All @@ -36,6 +38,7 @@ public VoiceTextClient()
this.Pitch = 100;
this.Speed = 100;
this.Volume = 100;
this.Format = Format.WAV;
}

public byte[] GetVoice(string text)
Expand Down Expand Up @@ -80,6 +83,7 @@ private FormUrlEncodedContent BuildHttpRequestContent(string text)
{"pitch", this.Pitch.ToString()},
{"speed", this.Speed.ToString()},
{"volume", this.Volume.ToString()},
{"format", this.Format.ToString().ToLower()},
};
if (this.Emotion != Emotion.Default)
{
Expand Down
1 change: 1 addition & 0 deletions VoiceTextWebAPI.Client/VoiceTextWebAPI.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<ItemGroup>
<Compile Include="Emotion.cs" />
<Compile Include="EmotionLevel.cs" />
<Compile Include="Format.cs" />
<Compile Include="Speaker.cs" />
<Compile Include="VoiceTextClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
4 changes: 3 additions & 1 deletion VoiceTextWebAPI.Client/VoiceTextWebAPI.Client.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$-beta</version>
<version>$version$</version>
<title>$title$</title>
<authors>J.Sakamoto</authors>
<owners>J.Sakamoto</owners>
Expand All @@ -18,6 +18,8 @@
</description>
<releaseNotes>
<![CDATA[
v.1.3
- Can chose voice file format from wav/ogg/aac.
v.1.2
- Add speaker "Bear"(Berserk Bear)!
v.1.1
Expand Down

0 comments on commit f01c11c

Please sign in to comment.