Audio - Software for high Quality Edit and Opus-Export?

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,024
I am not sure whether this is the right place to ask this question but I will give it a try.

The problem:
A while ago I made a couple of .opus-music files for a visual novel. So far so good. At the moment I am doing the final touches on a mayor part of my game, that includes retouching the audio. I noticed that my menu-music starts very loud and some other music-files are more quiet.

So I though to myself, no problem, lets fix this with Audacity. I loaded up the original high-quality- / high-bitrate-file to fix that menu-music. I added a 5 seconds "fade-in" to "soften" the start. Then I wanted to export to my target-format: Opus at 128k bitrate.

Out of all available formats this has the highest quality on low or medium bitrates for consumer-grade-audio with excellent compression! Audacity does not support exporting to Opus nativly. FFmpeg must be installed using the "ffmpeg-win-2.2.2.exe"-Installer. Said and done.

At this point I get this error:
FFmpeg : ERROR - Can't open audio codec 0x4f505553
A quick google-search reveals that Opus-export apparently is not supported:

You don't have permission to view the spoiler content. Log in or register now.

At this point I could export to other in-between-formats and then use FFmpeg to convert back to Opus but that is a bad solution and can cause quality-loss. Even with a lossless .wav-file at the same sample-rate I could lose quality due to the way (floating-point?)-numbers are saved.

What solution I am NOT looking for?
Please no suggestions / discussion about other audio-formats. I very carefully picked Opus for reasons!

What solution I am looking for?
A priceless (not necessarily open-source, but it would be nice) software that allows me to edit and export to Opus in ONE! encoding-pass. I use the word priceless here on purpose because the word "free" can have two different meanings (free beer or free speech).

Any idea what software could do that or how to fix/work around that? Obviously FFmpeg alone supports opus without problems. So I would need a way to pass the Audacity data to FFmpeg in the command-line manually!?

You don't have permission to view the spoiler content. Log in or register now.

Well shit - that ended up being a wall of text. :frown:

EDIT:
I also just had the idea to try .webm as container, which supports opus. But Audacity only offers the older libvorbis for compression. :FeelsBadMan:

EDIT2:
As temporary work-around for my specific menu-music-problem I ended up using FFmpeg audio-filters like this to add a 5 second fade-in:
Code:
ffmpeg.exe -i %1 -filter:a afade=t=in:ss=0:d=5 -vn -acodec libopus -b:a 128k -map_metadata -1 "%~n1.opus"
 

gue5t

Active Member
Sep 11, 2016
594
1,035
...
At this point I could export to other in-between-formats and then use FFmpeg to convert back to Opus but that is a bad solution and can cause quality-loss. Even with a lossless .wav-file at the same sample-rate I could lose quality due to the way (floating-point?)-numbers are saved.
...
I might be wrong but I believe Audacity supports 32bit float WAV files so there should be no loss in quality if you can't directly export to the desired format.

P.S. I remember it supported 64bit float uncompressed files as well if you need them.
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,024
Hey gue5t,

yes it supports 32- and 64-bit float.

I have talked to a friend who creates music for 15 years now and we did dig deep into this. We came to the conclusion that the best way to do this is by analyzing the source format first. We used FFprobe on a source .mp3 as example. That spits out:
Code:
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
(Yes I know low quality example, mp3-format please die already)

To convert 100% lossless we must use the same settings to export:
44100 Hz sample rate
stereo = 2 channels
s16p = signed 16-bits per sample, p-is irrelevant (explained here: )

We exported with Audacity by using:
Code:
Save as type: Other uncompressed files
Header: WAV (Microsoft)
Encoding: Signed 16-bit PCM
He then used some professional software (I forgot the name) to compare the content of the source- and exported file. 100% match.

We did more tests for this specific source-file and got these results:
s16p to s24 = no match
s16p to s32 = match
s16p to any float format = no match
Don't ask me why, I don't know. Some IT-expert number-conversion-stuff going on here.

In the end I think it is to much effort and it is easy to make mistakes this way. I guess I will avoid Audacity until it can export Opus directly.