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.

73 lines
2.8KB

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