Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
musicinformationretrieval-com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
A.S.
musicinformationretrieval-com
Commits
f2a1ad44
Commit
f2a1ad44
authored
Aug 01, 2018
by
Steve Tjoa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg
parent
db97d4b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
ffmpeg.py
ffmpeg.py
+19
-0
No files found.
ffmpeg.py
0 → 100644
View file @
f2a1ad44
"""
This script converts all wav files in a directory to mp3.
sox drum_samples_in/train/kick_01.wav -r 22050 --norm -b 16 -e signed-integer drum_samples_out/train/kick_01.wav remix -
sox in.wav --norm out.wav
sox in.wav out.wav remix -
sox in.wav -b 16 -e signed-integer out.wav
ffmpeg -i drum_samples_in/train/kick_01.wav drum_samples_out/train/kick_01.mp3
"""
from
pathlib
import
Path
import
os
for
p
in
Path
()
.
glob
(
'drum_samples_in/test/*.wav'
):
input_wav
=
p
.
resolve
()
output_stem
=
input_wav
.
stem
command
=
"ffmpeg -i {} drum_samples_out/test/{}.mp3"
.
format
(
input_wav
,
output_stem
)
print
(
command
)
os
.
system
(
command
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment