1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix compilation when JUCE_USE_LAME_AUDIO_FORMAT=1

This fixes a regression in 1ce35453db.
This commit is contained in:
attila 2025-06-13 12:26:49 +02:00 committed by Attila Szarvas
parent e926ecb9e9
commit f371fecb34
2 changed files with 8 additions and 9 deletions

View file

@ -43,14 +43,15 @@ public:
Writer (OutputStream* destStream, const String& formatName,
const File& appFile, int vbr, int cbr,
double sampleRateIn, unsigned int numberOfChannels,
int bitsPerSampleIn, const StringPairArray& metadata)
int bitsPerSampleIn, const StringMap& metadata)
: AudioFormatWriter (destStream, formatName, sampleRateIn,
numberOfChannels, (unsigned int) bitsPerSampleIn),
vbrLevel (vbr), cbrBitrate (cbr)
{
WavAudioFormat wavFormat;
writer = wavFormat.createWriterFor (tempWav.getFile().createOutputStream(),
std::unique_ptr<OutputStream> stream = tempWav.getFile().createOutputStream();
writer = wavFormat.createWriterFor (stream,
AudioFormatWriter::Options{}.withSampleRate (sampleRateIn)
.withNumChannels ((int) numberOfChannels)
.withBitsPerSample (bitsPerSampleIn)
@ -85,14 +86,12 @@ public:
addMetadataArg (metadata, "id3trackNumber", "--tn");
}
void addMetadataArg (const StringPairArray& metadata, const char* key, const char* lameFlag)
void addMetadataArg (const StringMap& metadata, const char* key, const char* lameFlag)
{
auto value = metadata.getValue (key, {});
if (value.isNotEmpty())
if (auto it = metadata.find (key); it != metadata.end())
{
args.add (lameFlag);
args.add (value);
args.add (it->second);
}
}
@ -207,7 +206,7 @@ AudioFormatReader* LAMEEncoderAudioFormat::createReaderFor (InputStream*, const
return nullptr;
}
std::unique_ptr<AudioFormatWriter> LAMEEncoderAudioFormat::createWriterFor (std::unique_ptr<OutputStream> streamToWriteTo,
std::unique_ptr<AudioFormatWriter> LAMEEncoderAudioFormat::createWriterFor (std::unique_ptr<OutputStream>& streamToWriteTo,
const AudioFormatWriterOptions& options)
{
if (streamToWriteTo == nullptr)

View file

@ -69,7 +69,7 @@ public:
bool isCompressed() override;
StringArray getQualityOptions() override;
std::unique_ptr<AudioFormatWriter> createWriterFor (std::unique_ptr<OutputStream> streamToWriteTo,
std::unique_ptr<AudioFormatWriter> createWriterFor (std::unique_ptr<OutputStream>& streamToWriteTo,
const AudioFormatWriterOptions& options) override;
AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails) override;