easyaudio_utils 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec93967424ff134b560c8c8a12db31f2c6082750ed0dd9a57f1c9426639fc582
4
- data.tar.gz: 75a47e89d58d03c76db37aa040eb368fc9b40d99685b14e4ae5f4699bbfa90ff
3
+ metadata.gz: f50a6a89e8841dc34323a1c21a449400cae0caacb8671328b4bf8b269a4a2a37
4
+ data.tar.gz: f7bf6bdf7dd187a738916520bdc42dcba2a54be2c3101af89c11000d33598e16
5
5
  SHA512:
6
- metadata.gz: cd31e92d0c190ba80c739afea6453f43590c9b08e91163907c22542b53ef803f4469646819fb08c2bd37a9b9f380a490413420574daefafaf0c682a4a35afa17
7
- data.tar.gz: c55becbdfbf3b788a60234f1833d5285d5cd6b11b1b4c2e21d3221c204e183a11341edbb1fe3efcf726f0389ff8d7bf4e45637e3eec06744c2299062e94c4570
6
+ metadata.gz: 3d08657f0b811b0761bf95d8f6d81109a6dbdbb9c370a497dc4770716e91d4694a6e1a4f491d828c44be4977b2a1baf3bdbae035c54a8b5e7defee4896cf2a94
7
+ data.tar.gz: 7cff7250a5b9b2ff73bd94578d6423e73b6206caa62cd29d26d960770afeac0024e602c6defd81cdf90a0b89e88f4a6c194689a4b28330b58497fea0fb08a026
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -3,15 +3,19 @@
3
3
  # file: easyaudio_utils.rb
4
4
 
5
5
  require 'wavtool'
6
+ require 'ogginfo'
6
7
 
7
8
  # requirements:
8
- # `apt-get install mplayer sox vorbis-tools
9
+ # `apt-get install mplayer sox vorbis-tools ffmpeg
9
10
 
10
11
  # installing youtube-dl:
11
12
  #
12
13
  # `sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/bin/youtube-dl`
13
14
  #
14
15
  # `sudo chmod a+rx /usr/bin/youtube-dl`
16
+ #
17
+ # note: avconv is included with ffmpeg
18
+ #
15
19
 
16
20
 
17
21
  module CommandHelper
@@ -43,6 +47,7 @@ class EasyAudioUtils
43
47
  * capture # records audio in FLAC format
44
48
  * concat_files # stiches wav files together
45
49
  * convert # converts a file from 1 format to another #wav #ogg
50
+ * cut # cuts the audio into a new file as defined by start time and duration
46
51
  * duration # return the duration for a wav or ogg
47
52
  * generate_silence # generates silence in a wav file
48
53
  * play # plays using mplayer
@@ -84,15 +89,23 @@ class EasyAudioUtils
84
89
 
85
90
  end
86
91
 
92
+ def cut(starttime, duration)
93
+
94
+ command = "avconv -i %s -ss %s -t %s %s" % \
95
+ [@file_in, starttime, duration, @file_out]
96
+ run command, show
97
+
98
+ end
99
+
87
100
  def duration()
88
101
 
89
102
  case File.extname(@file_in)
90
103
  when '.ogg'
91
- OggInfo.open(@file_in).length.to_i
104
+ OggInfo.open(@file_in).length
92
105
  when '.wav'
93
106
  WavTool.new().duration(@file_in)
94
107
  when '.mp3'
95
- Mp3Info.new(@file_in).length.to_i
108
+ Mp3Info.new(@file_in).length
96
109
  end
97
110
 
98
111
  end
@@ -100,7 +113,7 @@ class EasyAudioUtils
100
113
  # silence duration in seconds
101
114
  #
102
115
  def generate_silence(duration)
103
- WavTool.new(out: @out_file).silence duration: duration
116
+ WavTool.new(out: @file_out).silence duration: duration
104
117
  end
105
118
 
106
119
  alias record capture
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyaudio_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  iV3Y2C+RMq1lzH37GpnqYY/GbIvXMmQ7PO19tYLBCV/OUawXzR16PkiHVjIGnDyN
36
36
  PaGqcnyxdoovIOkXQxqj5+Zd
37
37
  -----END CERTIFICATE-----
38
- date: 2020-08-17 00:00:00.000000000 Z
38
+ date: 2020-08-27 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: c32
@@ -97,6 +97,26 @@ dependencies:
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: 0.8.10
100
+ - !ruby/object:Gem::Dependency
101
+ name: ruby-ogginfo
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '0.7'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 0.7.2
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.7'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 0.7.2
100
120
  description:
101
121
  email: james@jamesrobertson.eu
102
122
  executables: []
metadata.gz.sig CHANGED
Binary file