morse2au 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
 - data/lib/morse2au.rb +7 -7
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 822fa6fe839fda9a7605a04c0d7902230bf6642f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e1ceff39e88f1ff8b0f6bdfb01790dc37be6b54c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1204056cea09143a306892641416b862c7abf12e01904a2135ecb3dbfb9f6d12266702469ebf45435cd2a82c9603691d284d62a43e6b8fae6518caf2a46a5a47
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 69f8e033a2b972db11227941d34d35e6a59e456e4fbe876cdee61cd5ac5f1d954ac4747c4b9cfb5afe8552700130e0fc4b17a7df36dd85889aa242a3f91b85f3
         
     | 
    
        data/lib/morse2au.rb
    CHANGED
    
    | 
         @@ -4,14 +4,14 @@ require 'au/Au.rb' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            # Generate an .au file of Morse code
         
     | 
| 
       5 
5 
     | 
    
         
             
            #
         
     | 
| 
       6 
6 
     | 
    
         
             
            # Initialize:
         
     | 
| 
       7 
     | 
    
         
            -
            #   >>  
     | 
| 
      
 7 
     | 
    
         
            +
            #   >> Morse2Au.initialize("/home/matt/output.au", 0.5)
         
     | 
| 
       8 
8 
     | 
    
         
             
            #
         
     | 
| 
       9 
9 
     | 
    
         
             
            # Arguments:
         
     | 
| 
       10 
10 
     | 
    
         
             
            #   file: (String)
         
     | 
| 
       11 
11 
     | 
    
         
             
            #   rate: (Float)
         
     | 
| 
       12 
12 
     | 
    
         
             
            #
         
     | 
| 
       13 
13 
     | 
    
         
             
            # Convert a string:
         
     | 
| 
       14 
     | 
    
         
            -
            #    >>  
     | 
| 
      
 14 
     | 
    
         
            +
            #    >> Morse2Au.strToMorse("CQ CQ")
         
     | 
| 
       15 
15 
     | 
    
         
             
            #
         
     | 
| 
       16 
16 
     | 
    
         
             
            # Arguments:
         
     | 
| 
       17 
17 
     | 
    
         
             
            #   text: (String)
         
     | 
| 
         @@ -42,7 +42,7 @@ class Morse2Au 
     | 
|
| 
       42 
42 
     | 
    
         
             
            	#
         
     | 
| 
       43 
43 
     | 
    
         
             
            	# Arguments:
         
     | 
| 
       44 
44 
     | 
    
         
             
            	# 
         
     | 
| 
       45 
     | 
    
         
            -
            	#  duration: ( 
     | 
| 
      
 45 
     | 
    
         
            +
            	#  duration: (Float)
         
     | 
| 
       46 
46 
     | 
    
         
             
            	#
         
     | 
| 
       47 
47 
     | 
    
         
             
            	def self.addBeep(duration)
         
     | 
| 
       48 
48 
     | 
    
         
             
            		0.step(duration, 1.0/@@sample_rate) do |t|
         
     | 
| 
         @@ -54,7 +54,7 @@ class Morse2Au 
     | 
|
| 
       54 
54 
     | 
    
         
             
            	#
         
     | 
| 
       55 
55 
     | 
    
         
             
            	# Arguments:
         
     | 
| 
       56 
56 
     | 
    
         
             
            	#
         
     | 
| 
       57 
     | 
    
         
            -
            	# 
     | 
| 
      
 57 
     | 
    
         
            +
            	#  duration: (Float)
         
     | 
| 
       58 
58 
     | 
    
         
             
            	#
         
     | 
| 
       59 
59 
     | 
    
         
             
            	def self.addSilence(duration)
         
     | 
| 
       60 
60 
     | 
    
         
             
            		0.step(duration, 1.0/@@sample_rate) do |i|
         
     | 
| 
         @@ -63,7 +63,7 @@ class Morse2Au 
     | 
|
| 
       63 
63 
     | 
    
         
             
            	end
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
       65 
65 
     | 
    
         
             
            	#
         
     | 
| 
       66 
     | 
    
         
            -
            	# Add a .
         
     | 
| 
      
 66 
     | 
    
         
            +
            	# Add a "."
         
     | 
| 
       67 
67 
     | 
    
         
             
            	#
         
     | 
| 
       68 
68 
     | 
    
         
             
            	def self.addDit
         
     | 
| 
       69 
69 
     | 
    
         
             
            		self.addBeep(@@rel_speed)
         
     | 
| 
         @@ -71,7 +71,7 @@ class Morse2Au 
     | 
|
| 
       71 
71 
     | 
    
         
             
            	end
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
            	#
         
     | 
| 
       74 
     | 
    
         
            -
            	# Add a -
         
     | 
| 
      
 74 
     | 
    
         
            +
            	# Add a "-"
         
     | 
| 
       75 
75 
     | 
    
         
             
            	#
         
     | 
| 
       76 
76 
     | 
    
         
             
            	def self.addDah
         
     | 
| 
       77 
77 
     | 
    
         
             
            		self.addBeep(@@rel_speed * 4)
         
     | 
| 
         @@ -96,7 +96,7 @@ class Morse2Au 
     | 
|
| 
       96 
96 
     | 
    
         
             
            	# Convert a string to morse code
         
     | 
| 
       97 
97 
     | 
    
         
             
            	#
         
     | 
| 
       98 
98 
     | 
    
         
             
            	# Arguments:
         
     | 
| 
       99 
     | 
    
         
            -
            	# 
     | 
| 
      
 99 
     | 
    
         
            +
            	#  text: (String)
         
     | 
| 
       100 
100 
     | 
    
         
             
            	#
         
     | 
| 
       101 
101 
     | 
    
         
             
            	def self.strToMorse(text)
         
     | 
| 
       102 
102 
     | 
    
         
             
            		text.downcase!
         
     |