komagata-talkedbun 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Masaki Komagata
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ = talkedbun
2
+
3
+ Talkedbun "喋饅頭" is japanese text-to-speech server.
4
+
5
+ == Installation
6
+
7
+ % sudo gem install komagata-talkedbun -s http://gems.github.com
8
+ % talkedbun
9
+ % open http://localhost:4567/
10
+
11
+ required SayKana, ffmpeg command.
12
+ now, MAC OS X only...
13
+
14
+ == Copyright
15
+
16
+ Copyright (c) 2009 Masaki Komagata <komagata@gmail.com>. See LICENSE for details.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ file = File.join(File.dirname(__FILE__), "..", "talkedbun.rb")
3
+ `ruby #{file}`
@@ -0,0 +1,3 @@
1
+ require "rubygems"
2
+ require "talkedbun"
3
+ run Sinatra::Application
@@ -0,0 +1,16 @@
1
+ require 'tmpdir'
2
+
3
+ module Talker
4
+ def self.talk(text)
5
+ path = "#{Dir.tmpdir}/#{text}"
6
+ cmd = "SayKana -s 70 -o #{path}.aiff #{text}"
7
+ system cmd
8
+
9
+ system "yes | ffmpeg -i #{path}.aiff -f mp3 #{path}"
10
+ sound = open(path) {|f| f.read }
11
+
12
+ File.delete "#{path}.aiff"
13
+ File.delete "#{path}"
14
+ sound
15
+ end
16
+ end
Binary file
@@ -0,0 +1,23 @@
1
+ $:.unshift 'lib'
2
+ require 'rubygems'
3
+ require 'sinatra'
4
+ require 'haml'
5
+ require 'sass'
6
+ require 'talker'
7
+
8
+ get '/' do
9
+ puts options.public
10
+ haml :index
11
+ end
12
+
13
+ get '/style.css' do
14
+ content_type 'text/css', :charset => 'utf-8'
15
+ sass :style
16
+ end
17
+
18
+ get '/:text' do
19
+ content_type 'audio/mp3'
20
+ Talker.talk(params[:text])
21
+ end
22
+
23
+
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class TalkedbunTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'talkedbun'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,28 @@
1
+ !!! XML
2
+ !!! Strict
3
+ %html{ html_attrs("ja") }
4
+ %head
5
+ %title Talkedbun - japanese text-to-speech server
6
+ %meta{ 'http-equiv' => 'Content-Language', :conent => 'ja' }
7
+ %meta{ 'http-equiv' => 'Content-Type', :conent => 'text/html', :charset => 'utf-8' }
8
+ %meta{ 'http-equiv' => 'Content-Style-Type', :conent => 'text/css' }
9
+ %meta{ 'http-equiv' => 'Content-Script-Type', :conent => 'text/javascript' }
10
+ %link{:href => "style.css", :rel => "stylesheet", :type => "text/css", :charset => "utf-8"}
11
+ %body
12
+ #header
13
+ %h1 Talkedbun
14
+ #content
15
+ .description
16
+ Talkedbun "喋饅頭" is japanese text-to-speech server.
17
+ %h2 Example
18
+ %ul
19
+ %li
20
+ %a{:href => "うえからくるぞ、きをつけろ!"} うえからくるぞ、きをつけろ!
21
+ %li
22
+ %a{:href => "ぐぐれかす"} ぐぐれかす
23
+ %li
24
+ %a{:href => "いくえふめい"} いくえふめい
25
+ .copy
26
+ &copy;
27
+ %a{:href => "/", :title => "Talkedbun"} Talkedbun
28
+ 2009
@@ -0,0 +1,51 @@
1
+ body
2
+ color: #fff
3
+ h1
4
+ font-family: Georgia, "Times New Roman", Times, serif
5
+ font-size: 50px
6
+ font-weight: bold
7
+ margin-right: 30px
8
+ letter-spacing: 0.1em
9
+ h2
10
+ font-size: 18px
11
+ margin: 20px 0 0 30px
12
+ a
13
+ color: #e8f2cf
14
+ a:hover
15
+ color: #bc0c0c
16
+ a:active
17
+ color: #bc0c0c
18
+ #header
19
+ text-align: right
20
+ background-image: url(/images/body.jpg)
21
+ width: 600px
22
+ height: 300px
23
+ margin: 20px auto 0 auto
24
+ border-width: 3px
25
+ border-color: #ccc
26
+ border-style: solid solid none solid
27
+ #content
28
+ background-color: #0e0e0c
29
+ color: #ccc
30
+ width: 600px
31
+ margin: 0 auto
32
+ padding-top: 10px
33
+ border-width: 3px
34
+ border-color: #ccc
35
+ border-style: none solid solid solid
36
+ ul
37
+ list-style-type: square
38
+ line-height: 1.7
39
+ margin-left: 40px
40
+ li
41
+ font-size: 20px
42
+ .description
43
+ text-align: center
44
+ border: 1px dotted #999
45
+ margin: 0 60px 0 60px
46
+ font-size: 14px
47
+ padding: 5px
48
+ .copy
49
+ font-size: 14px
50
+ text-align: center
51
+ margin-bottom: 20px
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: komagata-talkedbun
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Masaki Komagata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-27 00:00:00 -07:00
13
+ default_executable: talkedbun
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sinatra
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: haml
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.9
34
+ version:
35
+ description:
36
+ email: komagata@gmail.com
37
+ executables:
38
+ - talkedbun
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.rdoc
44
+ files:
45
+ - bin/talkedbun
46
+ - config.ru
47
+ - lib/talker.rb
48
+ - public/images/body.jpg
49
+ - talkedbun.rb
50
+ - views/index.haml
51
+ - views/style.sass
52
+ - LICENSE
53
+ - README.rdoc
54
+ has_rdoc: false
55
+ homepage: http://github.com/komagata/talkedbun
56
+ licenses:
57
+ post_install_message:
58
+ rdoc_options:
59
+ - --charset=UTF-8
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.3.5
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: Talkedbun is japanese text-to-speech server.
81
+ test_files:
82
+ - test/talkedbun_test.rb
83
+ - test/test_helper.rb