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.

72 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #if JUCE_USE_LAME_AUDIO_FORMAT || defined (DOXYGEN)
  18. //==============================================================================
  19. /**
  20. An AudioFormat class which can use an installed version of the LAME mp3
  21. encoder to encode a file.
  22. This format can't read MP3s, it just writes them. Internally, the
  23. AudioFormatWriter object that is returned writes the incoming audio data
  24. to a temporary WAV file, and then when the writer is deleted, it invokes
  25. the LAME executable to convert the data to an MP3, whose data is then
  26. piped into the original OutputStream that was used when first creating
  27. the writer.
  28. @see AudioFormat
  29. */
  30. class JUCE_API LAMEEncoderAudioFormat : public AudioFormat
  31. {
  32. public:
  33. /** Creates a LAMEEncoderAudioFormat that expects to find a working LAME
  34. executable at the location given.
  35. */
  36. LAMEEncoderAudioFormat (const File& lameExecutableToUse);
  37. ~LAMEEncoderAudioFormat();
  38. bool canHandleFile (const File&);
  39. Array<int> getPossibleSampleRates();
  40. Array<int> getPossibleBitDepths();
  41. bool canDoStereo();
  42. bool canDoMono();
  43. bool isCompressed();
  44. StringArray getQualityOptions();
  45. AudioFormatReader* createReaderFor (InputStream*, bool deleteStreamIfOpeningFails);
  46. AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse,
  47. unsigned int numberOfChannels, int bitsPerSample,
  48. const StringPairArray& metadataValues, int qualityOptionIndex);
  49. private:
  50. File lameApp;
  51. class Writer;
  52. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LAMEEncoderAudioFormat)
  53. };
  54. #endif