Loading...
Searching...
No Matches
juce_AudioFormat.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API AudioFormat
{
public:
//==============================================================================
virtual ~AudioFormat();
//==============================================================================
const String& getFormatName() const;
//==============================================================================
virtual StringArray getFileExtensions() const;
virtual bool canHandleFile (const File& fileToTest);
virtual Array<int> getPossibleSampleRates() = 0;
virtual Array<int> getPossibleBitDepths() = 0;
virtual bool canDoStereo() = 0;
virtual bool canDoMono() = 0;
virtual bool isCompressed();
virtual bool isChannelLayoutSupported (const AudioChannelSet& channelSet);
virtual StringArray getQualityOptions();
//==============================================================================
virtual AudioFormatReader* createReaderFor (InputStream* sourceStream,
bool deleteStreamIfOpeningFails) = 0;
virtual MemoryMappedAudioFormatReader* createMemoryMappedReader (const File& file);
virtual MemoryMappedAudioFormatReader* createMemoryMappedReader (FileInputStream* fin);
virtual AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex) = 0;
virtual AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
const AudioChannelSet& channelLayout,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);
protected:
AudioFormat (String formatName, StringArray fileExtensions);
AudioFormat (StringRef formatName, StringRef fileExtensions);
private:
//==============================================================================
String formatName;
StringArray fileExtensions;
};
} // namespace juce
juce::Array
Definition juce_Array.h:56
juce::AudioChannelSet
Definition juce_AudioChannelSet.h:47
juce::AudioFormatReader
Definition juce_AudioFormatReader.h:44
juce::AudioFormatWriter
Definition juce_AudioFormatWriter.h:44
juce::AudioFormat::getFileExtensions
virtual StringArray getFileExtensions() const
Definition juce_AudioFormat.cpp:53
juce::AudioFormat::isChannelLayoutSupported
virtual bool isChannelLayoutSupported(const AudioChannelSet &channelSet)
Definition juce_AudioFormat.cpp:68
juce::AudioFormat::createMemoryMappedReader
virtual MemoryMappedAudioFormatReader * createMemoryMappedReader(const File &file)
Definition juce_AudioFormat.cpp:57
juce::AudioFormat::createWriterFor
virtual AudioFormatWriter * createWriterFor(OutputStream *streamToWriteTo, double sampleRateToUse, unsigned int numberOfChannels, int bitsPerSample, const StringPairArray &metadataValues, int qualityOptionIndex)=0
juce::AudioFormat::canDoStereo
virtual bool canDoStereo()=0
juce::AudioFormat::getQualityOptions
virtual StringArray getQualityOptions()
Definition juce_AudioFormat.cpp:55
juce::AudioFormat::canDoMono
virtual bool canDoMono()=0
juce::AudioFormat::canHandleFile
virtual bool canHandleFile(const File &fileToTest)
Definition juce_AudioFormat.cpp:43
juce::AudioFormat::AudioFormat
AudioFormat(String formatName, StringArray fileExtensions)
Definition juce_AudioFormat.cpp:29
juce::AudioFormat::getPossibleBitDepths
virtual Array< int > getPossibleBitDepths()=0
juce::AudioFormat::createReaderFor
virtual AudioFormatReader * createReaderFor(InputStream *sourceStream, bool deleteStreamIfOpeningFails)=0
juce::AudioFormat::getFormatName
const String & getFormatName() const
Definition juce_AudioFormat.cpp:52
juce::AudioFormat::getPossibleSampleRates
virtual Array< int > getPossibleSampleRates()=0
juce::AudioFormat::isCompressed
virtual bool isCompressed()
Definition juce_AudioFormat.cpp:54
juce::FileInputStream
Definition juce_FileInputStream.h:35
juce::File
Definition juce_File.h:45
juce::InputStream
Definition juce_InputStream.h:37
juce::MemoryMappedAudioFormatReader
Definition juce_MemoryMappedAudioFormatReader.h:47
juce::OutputStream
Definition juce_OutputStream.h:38
juce::StringArray
Definition juce_StringArray.h:35
juce::StringPairArray
Definition juce_StringPairArray.h:35
juce::StringRef
Definition juce_StringRef.h:62
juce::String
Definition juce_String.h:53