Skip to content

Commit

Permalink
Merge pull request facebookresearch#345 from tripathiarpan20/main
Browse files Browse the repository at this point in the history
minor device bug fixed with --no-split option
  • Loading branch information
adefossez committed Jul 19, 2022
2 parents 83f2ea8 + 428a970 commit ce9a04d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demucs/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ def encode_mp3(wav, path, samplerate=44100, bitrate=320, verbose=False):
encoder.set_quality(2) # 2-highest, 7-fastest
if not verbose:
encoder.silence()
if 'cuda' in str(wav.device):
wav = wav.cpu()
wav = wav.transpose(0, 1).numpy()
mp3_data = encoder.encode(wav.tobytes())
mp3_data += encoder.flush()
Expand Down

0 comments on commit ce9a04d

Please sign in to comment.