How to reproduce:
Debug messages on stdout show that the audio time stretcher has been called:
AudioTimeStretcher::initialise
AudioTimeStretcher::calculateParameters
AudioTimeStretcher: channels = 1, ratio = 0.982962, n1 = 256, n2 = 252, wlen = 2048, max = 1024
making inbuf size 8298 (outbuf size is 6144, ratio 0.982962)
AudioTimeStretcher::~AudioTimeStretcher
AudioTimeStretcher::~AudioTimeStretcher: actual ratio = 0.982971, ideal = 0.982962, nominal = 0.984375)
AudioTimeStretcher::cleanup
The segment length is successfully modified, but there is no more audio in the segment, only a flat line.
I cannot reproduce this. If I try the steps above the audio is slower or faster appropriately !
Which Rosegarden version are you using ?
Do you have any preferences which are not default ?
Anything special about the audio ?
I tried with 23.12, the last git and another about two or three years old version (I currently don't remember).
I tried again with 23.12 and all preferences set to default, but it changes nothing.
The audio files are ordinary wave files.
Here are the descriptions of two short files before and after the stretch. The files have been recorded with RG itself.
Test 1 - Record audio files set in preferences as: 16 bits PCM WAV format
Test2 - Record audio files set in preferences as: 32 bits float WAV format
This is a bit of a puzzle !!
Tried lots of things but the re-scaling of the audio always works without problem for me.
Does anyone else have this problem ?
I always get an additional output:
20353 debug/[] - [AudioFileTimeStretcher] getStretchedAudioFile(): success, id is 6
Here is my output:
I think the
getStretchedAudioFile(): success
message is important. I can't see why it is not coming in your case.Message was not coming because I didn't run RG in debug mode.
OK - so I seem to have reproduced the problem.
Do you have libsndfile installed ? Version > 1.0.16 ?
If you have libsndfile the cmake output looks like:
Without libsndfile you will get:
Maybe libsndfile should be a required dependency ??!!??
Thank Philip, but this is not the cause of the problem: libsndfile 1.0.31 is installed here and its devel package as well. Moreover audio files can be read and write without any problem and I presume it's done with libsndfile.
Nevertheless, as it works on some system, I suspect the problem is related to a library.
Concerned libraries may be libfftw3 and libsamplerate.
I'll try to trace data inside the AudioTimeStretcher as soon as I'll have some time.
Oh well it was a nice theory.
No further ideas on this.
Does anyone else have this problem ?
The problem occurs in release mode only.
When RG has been compiled in debug mode, the audio time stretcher works fine.
I can confirm this.
Since most users will be using a release version this means the time stretcher is not really working at all !
That
#ifndef NDEBUG
looks suspicious !And indeed if I remove it everything works in release mode too
Please merge
Last edit: Ted Felix 2024-04-03
Thank you, Philip. You got it.
I confirm the stretcher works fine when the NDEBUG condition is removed.
Merged as [79d672]. Please test latest git.
Related
Commit: [79d672]