7

How can I get Audacity to work with Opus files? Is there a plugin I can get?

I've heard that I can point Audacity to a framework for encoding/decoding and delegate the work to the framework, since Audacity doesn't support .opus yet.

How should I go about adding .opus support to Audacity?

Edit 0: (After trying the external program and the file not appearing): Export Audio Program Output

Edit 1: After Recompiling A file with the file name now appears in the folder, but it appears to be unplayable. After Recompiling

Sarah Szabo
  • 1,463
  • 6
  • 28
  • 55
  • 1
    audacity should open an .opus file just fine (does so here) As far as exporting to .opus then use external program option (ffmpeg), read here http://forum.audacityteam.org/viewtopic.php?p=268956&sid=c58f3fb830bbc42bc032521784b0c15c#p268956 – doug Jun 27 '17 at 02:57
  • @doug I have taken the substantial liberty of expanding on your succinct comment to produce a full answer... – andrew.46 Jun 27 '17 at 09:19

3 Answers3

6

As Doug has pointed out Audacity has the ability to easily import Opus files under Ubuntu 17.04 and also the ability to export as Opus with a small work around. To illustrate:

1. Importing Opus Files with Audacity

Audacity easily imports Opus files either by:

  1. Drag and drop the Opus files directly onto the main Audacity window
  2. File --> Import --> Audio from the Audacity main window

This has tested without flaw on my installation of Audacity 2.1.2 under Ubuntu 17.04.

2. Exporting Opus Files with Audacity

Audacity can export as Opus but does not have the capability to directly export as Opus or to use the conventional 'Custom FFmpeg Export' setting.

Instead go to:

File --> Export --> External Program

and change the Command options to something like the following:

enter image description here

And to make copying and pasting a little easier here is the command line:

ffmpeg -i - -c:a libopus -b:a 128k "%f"

And this should give you the results you are after...

Notes:

andrew.46
  • 37,085
  • 25
  • 149
  • 228
  • I tried the command in the export audio/external program window, but the file doesn't appear. I get an output from `libopus`, I'll post the output. – Sarah Szabo Jul 02 '17 at 19:44
  • @SarahSzabo Your copy of FFmpeg does not have support for encoding with libopus, is this the repository version for 17.04? I will double check when I get home away from this Windows computer... – andrew.46 Jul 02 '17 at 22:55
  • This was the output of `ffmpeg -version`: `ffmpeg -version ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (Ubuntu 6.3.0-12ubuntu2) 20170406` I just got it from git. – Sarah Szabo Jul 02 '17 at 23:07
  • @SarahSzabo OIC. Bear in mind that Zesty already has a decent and reasonably fully featured version of FFmpeg in the standard repositories, you might be better off using this? However if you have compiled your own copy recompile adding `--enable-libopus ` to your ./configure string and make sure you have the opus '-devel' packages installed: `sudo apt-get install libopus-dev` ... – andrew.46 Jul 02 '17 at 23:55
  • I installed the opus-devel packages, and then recompiled with the flags specified. I edited the post to clarify. – Sarah Szabo Jul 03 '17 at 00:58
  • @SarahSzabo This is because you have not actually compiled from git, you have used a release version and thus quality encoding is not available. Try `ffmpeg -i - -c:a libopus -b:a 128k "%f"` for your 'external command' and then all should be well :) – andrew.46 Jul 03 '17 at 02:07
2

There is need for ffmpeg to export opus. First, install opus-tools with:

sudo apt install opus-tools

Then, one can simply use something like:

opusenc --bitrate 192 - "%f".ogg

instead of the ffmpeg command.

This works fine with Audacity 2.1.3 and opusenc 0.1.9.

EDIT

ffmpeg does not support quality settings for opus. Here is part of the output using today's 3.4 git snapshot of ffmpeg when trying something like

ffmpeg -i - -c:a libopus -q:a 7  "%f"

as command:

[libopus @ 0x3f065c0] No bit rate set. Defaulting to 96000 bps.
[libopus @ 0x3f065c0] Quality-based encoding not supported, please specify a bitrate and VBR setting.
hanky
  • 31
  • 3
-1

The simple method I use on pc is (this is my method, it hasn't been copied from elsewhere, and I'm on Windows 10 not Ubuntu, but this may help someone):

  • Open Audacity
  • Open your file browser and navigate to the audio file in the Whatsapp Audio folder (whether the file is on your pc, tablet or phone)
  • Click the red record button in Audacity
  • Play the audio file
  • When recording stops, click the square Stop button (important)
  • File / Export / Export as WAV / Save to your computer

If this doesn't work for you, you need to search online re how to set up Audacity to record through your speakers or headset.

Zanna
  • 69,223
  • 56
  • 216
  • 327