Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-emissions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-emissions
Commits
3412cfde
Commit
3412cfde
authored
Dec 27, 2019
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create-sound-waveforms: create waveform from mp3 if ogg doesn't exist
parent
9da11f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
emissions/management/commands/create-sound-waveforms.py
emissions/management/commands/create-sound-waveforms.py
+6
-1
No files found.
emissions/management/commands/create-sound-waveforms.py
View file @
3412cfde
...
...
@@ -48,7 +48,12 @@ class Command(BaseCommand):
def
create
(
self
,
soundfile
):
# create a raw output, with a single channel and 4000Hz samples of 8bits
cmd
=
[
'sox'
,
soundfile
.
get_format_path
(
'ogg'
),
'-t'
,
'raw'
,
'-c'
,
'1'
,
'-r'
,
'4000'
,
sound_filename
=
soundfile
.
get_format_path
(
'ogg'
)
if
not
os
.
path
.
exists
(
sound_filename
):
sound_filename
=
soundfile
.
get_format_path
(
'mp3'
)
if
not
os
.
path
.
exists
(
sound_filename
):
return
cmd
=
[
'sox'
,
sound_filename
,
'-t'
,
'raw'
,
'-c'
,
'1'
,
'-r'
,
'4000'
,
'-e'
'unsigned-integer'
,
'-b'
,
'8'
,
'-'
]
wave_array
=
subprocess
.
check_output
(
cmd
)
for
filename
,
n_samples
in
((
'waveform.json'
,
200
),
(
'waveform-500.json'
,
500
)):
...
...
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