Closed gtreshchev closed 3 years ago
Hi @Respirant thank you for the bug report. The WavPack file you linked plays fine on Windows, but you said the error occurs when it is transcoded to .ogg. Can you upload the file, and can you note which Unix system/distribution you are using?
Hi. I'm sorry, I've uploaded the input file, not the output. Here's the output file with ogg format: PCM_FLT_ConvertedfromWv.zip
I used the following code for transcoding from .wv to .ogg:
NyquistIO loader;
std::shared_ptr<AudioData> fileData = std::make_shared<AudioData>();
auto memory = ReadFile(std::string("TestBeat_Float32.wv"));
loader.Load(fileData.get(), "wv", memory.buffer);
outputBuffer.reserve( fileData->samples.size()*2 );
hermite_resample( fileData->sampleRate / 48000.0f , fileData->samples, outputBuffer, (uint32_t)fileData->samples.size());
fileData->samples = outputBuffer;
int encoderStatus = encode_opus_to_disk({ fileData->channelCount, PCM_FLT, DITHER_NONE }, fileData.get(), "PCM_FLT_ConvertedfromWv.ogg");
I also noticed that the length of the transcoding audio is for some reason twice as long as the original audio. Here's an example of the original audio:
And here's transcoded one:
I tried to speed the audio up and change some code:
outputBuffer.reserve( (fileData->samples.size()*2)*2 );
hermite_resample( (fileData->sampleRate / 48000.0f) * 2, fileData->samples, outputBuffer, (uint32_t)fileData->samples.size()/2);
Afterwards the audio has been sped up, but it still has some kind of ripple background. 2XPCM_FLT_ConvertedfromWv.zip
This problem appears not only on UNIX systems, but also on Windows
Hi, I found that the error has been occured to due the sampling of the audio, which must be done before encoding. Since your library "does not provide comprehensive resampling functionality", it isn't an issue.
When converting audio files on Windows, no problems are observed, the quality is good. But for some reason, when working with UNIX system (Android), the sound quality becomes much worse. Here is an example of what happens when converting the "TestBeat_Float32.wv" file to the .ogg format on UNIX.
TestBeat_Float32.zip