Using Blender as video player for in-sync audio in Audacity(without using Jack)

By this Blender add-on, Steve helped me out doing, audio can be send back and forth between the two apps:
https://github.com/tin2tin/audacity_tools_for_blender

And as demo’ed in this video, Blender can be used as video player for Audacity(as long as you use the play/stop button in Blender):
https://blender.chat/file-upload/4rjJTpPHLK5M7NBXY/2021-03-16%2018-59-15.mp4
Unfortunately, there doesn’t seem to be a way to send the playhead position from Audacity to Blender, so the playback could be initiated from Audacity too.

Nice to see your work in a public repository.

Although there are no firm plans at present, I’m hoping that may come in the future.

@steve Is there some gain added when audio is imported and exported in/out of Audacity?

Here’s the same strip in Blender, however the top one has been send to Audacity and back:

We already noticed it when importing into Audacity, that some red lines appeared, which wasn’t in Blender, so we compensated by adding envelope points to all strips lowering the volume a bit. The image above, is with this implemented, so there must also be some gain on exporting?

Is this a know thing? And if it is, how much do we need to compensate i/o?

There could be if the track gain slider is not at zero. By default it is at zero.
(Audio Tracks - Audacity Manual)

It is set to zero. I can’t really tell if it’s on the Blender(import) or the Audacity(import or export) side the gain is happening.

Try temporarily modifying the script to export somewhere else so that you can test the exported file outside of Blender.

Example, you could analyze the exported file with SoX (http://sox.sourceforge.net/)

sox <input file> -n stats

where is the input file name, and “-n” means “output to null”.

Good idea.

Could it be related to mono added as stereo and then exported from Audacity? In this process, is a volume gain to be expected?

When adding mono audio to a stereo track, the expected behaviour is that the same, unaltered audio will be added to both left and right channels.

When exporting a stereo track as mono, the expected behaviour is that the left and right channels will be mixed (added together) then scaled by a factor of (exactly) 0.5. If the export format has a lower bit format, then there may be “dither” added (shaped noise at around -72 dB peak), depending on your settings (see: https://manual.audacityteam.org/man/dither.html)