audio_analysis 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/audio_analysis.rb +13 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c6ee2bf1738a0fefba9106383ac99014910171a22d0e34f86b72a201a3d3ae5
|
4
|
+
data.tar.gz: e5d37d7b4215d3772ce5c46b35e3424134bcdf1f6cf59896eb0380364a7031f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce4fab5dc03e927721825c46999cb0d1e181ad4cd82086d917a69aeb577ce491bbaf4c3310d9849d8665c581059a355e3746ba3095a23b438489da233f3ec56
|
7
|
+
data.tar.gz: 3494f50f35eb17713fc752760a3625d58bdb0d48a94e350a3bfbc1cc939f667da73c4b0ac45fa02f37841371d5ab7e93d4486e721fbbdb2ccdaaf6a9dcef1f11
|
data/lib/audio_analysis.rb
CHANGED
@@ -1,19 +1,25 @@
|
|
1
1
|
class AudioAnalysis
|
2
2
|
def self.find_bpm(file_path)
|
3
|
-
`pip install -r lib/python_analysis/requirements.txt`
|
4
|
-
bpm = `python3 lib/python_analysis/bpm_analysis.py #{file_path}`
|
3
|
+
`pip install -r #{gem_path}/lib/python_analysis/requirements.txt`
|
4
|
+
bpm = `python3 #{gem_path}/lib/python_analysis/bpm_analysis.py #{file_path}`
|
5
5
|
bpm.to_f
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.find_key(file_path)
|
9
|
-
`pip install -r lib/python_analysis/requirements.txt`
|
10
|
-
`python3 lib/python_analysis/key_analysis.py #{file_path}`
|
9
|
+
`pip install -r #{gem_path}/lib/python_analysis/requirements.txt`
|
10
|
+
`python3 #{gem_path}/lib/python_analysis/key_analysis.py #{file_path}`
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.analyze(file_path)
|
14
|
-
`pip install -r lib/python_analysis/requirements.txt`
|
15
|
-
bpm = `python3 lib/python_analysis/bpm_analysis.py #{file_path}`
|
16
|
-
key =`python3 lib/python_analysis/key_analysis.py #{file_path}`
|
14
|
+
`pip install -r #{gem_path}/lib/python_analysis/requirements.txt`
|
15
|
+
bpm = `python3 #{gem_path}/lib/python_analysis/bpm_analysis.py #{file_path}`
|
16
|
+
key =`python3 #{gem_path}/lib/python_analysis/key_analysis.py #{file_path}`
|
17
17
|
{ bpm: bpm, key: key }
|
18
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def self.gem_path
|
23
|
+
Gem.datadir("audio_analysis")
|
24
|
+
end
|
19
25
|
end
|