The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. #if JUCE_USE_MP3AUDIOFORMAT || DOXYGEN
  16. //==============================================================================
  17. /**
  18. Software-based MP3 decoding format (doesn't currently provide an encoder).
  19. IMPORTANT DISCLAIMER: By choosing to enable the JUCE_USE_MP3AUDIOFORMAT flag and
  20. to compile the MP3 code into your software, you do so AT YOUR OWN RISK! By doing so,
  21. you are agreeing that Raw Material Software Limited is in no way responsible for any patent,
  22. copyright, or other legal issues that you may suffer as a result.
  23. The code in juce_MP3AudioFormat.cpp is NOT guaranteed to be free from infringements of 3rd-party
  24. intellectual property. If you wish to use it, please seek your own independent advice about the
  25. legality of doing so. If you are not willing to accept full responsibility for the consequences
  26. of using this code, then do not enable the JUCE_USE_MP3AUDIOFORMAT setting.
  27. @tags{Audio}
  28. */
  29. class MP3AudioFormat : public AudioFormat
  30. {
  31. public:
  32. //==============================================================================
  33. MP3AudioFormat();
  34. ~MP3AudioFormat() override;
  35. //==============================================================================
  36. Array<int> getPossibleSampleRates() override;
  37. Array<int> getPossibleBitDepths() override;
  38. bool canDoStereo() override;
  39. bool canDoMono() override;
  40. bool isCompressed() override;
  41. StringArray getQualityOptions() override;
  42. //==============================================================================
  43. AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails) override;
  44. AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse,
  45. unsigned int numberOfChannels, int bitsPerSample,
  46. const StringPairArray& metadataValues, int qualityOptionIndex) override;
  47. using AudioFormat::createWriterFor;
  48. };
  49. #endif
  50. } // namespace juce