Closed GoodnessEzeokafor closed 4 years ago
def master(request,pk): track = get_object_or_404(Mastering, pk=pk) print("TARGET TRACK PATH:",track.target_track.path) print("TARGET REFERENCE PATH:",track.reference_track.path) mastered = mg.process( target=track.target_track.path, reference=track.reference_track.path, results=[
# mg.pcm24('my_song_master_24bit.wav')
mg.pcm16(f'{settings.MEDIA_URL}{track.user.username}/mastered/my_song_master_16bit.wav'),
mg.pcm24(f'{settings.MEDIA_URL}{track.user.username}/mastered/my_song_master_24bit.wav'),
],
)
return HttpResponse("MASTER")
https://github.com/bastibe/SoundFile/issues/227
It seems PySoundFile can't write to this directory.
Sory Doesn't the result argument creates and writes to the directory????
Here's how PySoundFile library works. https://pysoundfile.readthedocs.io/en/latest/#soundfile.write It doesn't create a directory if it doesn't exist and have no args to change this behaviour. Your app need to prepare these dirs on its own.
ok thanks alot will definetely try this
@sergree any script on how to download the mastered tracks in django ?????
Soon, this month
lols, i did a little hack
just added the file path to my context
context = { 'mastered1':f'/media/mastered/{track.user.id}/{track.name_of_track}/my_song_master_16bit.wav', 'mastered2':f'/media/mastered/{track.user.id}/{track.name_of_track}/my_song_master_24bit.wav' }
in my html file
`
`
http://127.0.0.1:8000/dashboard/track/8/master 3.0.2 RuntimeError Error opening './media/goody/mastered/my_song_master_16bit.wav': System error. /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages/soundfile.py in _error_check, line 1357 /home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/bin/python 3.6.9 ['/home/goodness/Documents/django_dev/MeshakProj', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python36.zip', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/lib-dynload', '/usr/lib/python3.6', '/home/goodness/.local/share/virtualenvs/MeshakProj--GI6wqXg/lib/python3.6/site-packages'] Thu, 30 Jan 2020 10:52:20 +0100