Recorded file prepended with silence

Hi,

Sometimes when I record with TE, the recorded WAV file is prepended with silence. For instance, I just now recorded about 8 seconds of audio but the resulting WAV file is 3:32 with the recorded audio sitting at the end of the file.

The resulting audio clip is of the right length, but since it gets its audio data from the beginning of the file (at least that is my guess), it only contains silence.

I haven’t been able to reproduce this in a controlled way but my feeling is that it only occurrs after recording has been stopped and later started again.

Any ideas for where to look are most welcome!

Erik

Can I double check what branch/commit you’re using? There was an issue similar to this we fixed a couple of months ago.

Ah! I can’t see right now which commit is was but the files are from 2021-08-19 so I should definitely try to update to the current version!

Thanks!

Yes, make sure you read this first: tracktion_engine/Engine_2.0_Transition.md at develop · Tracktion/tracktion_engine · GitHub

Sorry, just to be clear:

  • Which branch do you recommend using?
  • Does the master branch now contain TE 2.0? Or do I have to use the feature/engine_2_0 branch to get TE 2.0?
  • What about the develop branch?

Sorry, use the develop branch. I’ll clean up those other branches now. Most of them can be removed

Perfect, thanks!

I have now gone through my code and adapted time references to TE 2.0, and it compiles! :man_dancing: :dancer:

However, I get a linker error.

  "_src_callback_new", referenced from:
      tracktion::engine::HighQualityResamplerReader::HighQualityResamplerReader(std::__1::unique_ptr<tracktion::core::AudioReader, std::__1::default_delete<tracktion::core::AudioReader> >, double, tracktion::engine::ResamplingQuality) in include_tracktion_engine_playback.o
  "_src_callback_read", referenced from:
      tracktion::engine::HighQualityResamplerReader::readChunk(choc::buffer::BufferView<float, choc::buffer::SeparateChannelLayout> const&) in include_tracktion_engine_playback.o
  "_src_delete", referenced from:
      tracktion::engine::HighQualityResamplerReader::~HighQualityResamplerReader() in include_tracktion_engine_playback.o
  "_src_reset", referenced from:
      tracktion::engine::HighQualityResamplerReader::setPosition(long long) in include_tracktion_engine_playback.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is this also from the transition to TE 2.0?

Are you sure you re-Produced/CMaked?
Can you check the value of TRACKTION_BUILD_LIBSAMPLERATE in your AppConfig.h file? It should be 1 which is the default which should build those symbols.

Are you sure you re-Produced/CMaked?

Yes, I definitely re-exported the project with the Projucer. I did it again now a few times for testing.

Can you check the value of TRACKTION_BUILD_LIBSAMPLERATE in your AppConfig.h file?

In the Projucer, TRACKTION_BUILD_LIBSAMPLERATE is set to Default (Enabled). In AppConfig.h, that line is commented out:

#ifndef    TRACKTION_BUILD_LIBSAMPLERATE
 //#define   TRACKTION_BUILD_LIBSAMPLERATE 1
#endif

Explicitly changing it to Enabled uncomments the line in AppConfig.h, I don’t know if that is how it is supposed to work.

Anyway, I get the same linker error regardless of whether I enable it or not.

Do you have libsamplerate installed on your machine anywhere?

In tracktion_engine_playback.cpp is line 116 evaluating to true? I.e. #if __has_include(<samplerate.h>)?

If so, it might be skipping actually building the files.
The idea is that if you have it installed, you’ll link to that version.

Try changing that line to the following. Does it link then?

#if 0 //__has_include(<samplerate.h>)

That worked! Thanks a lot!

Ok. I might need to figure out a more elegant way to include libsamplerate if people might have it installed without realising. I’m trying to avoid adding preprocessor flags for everything as it makes testing and troubleshooting really hard.