File indexing completed on 2025-12-10 10:23:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef Sound_H
0022 #define Sound_H
0023
0024 #include <memory>
0025
0026 class Object;
0027 class Stream;
0028
0029
0030
0031 enum SoundKind
0032 {
0033 soundEmbedded,
0034 soundExternal
0035 };
0036
0037 enum SoundEncoding
0038 {
0039 soundRaw,
0040 soundSigned,
0041 soundMuLaw,
0042 soundALaw
0043 };
0044
0045 class POPPLER_PRIVATE_EXPORT Sound
0046 {
0047 public:
0048
0049 static std::unique_ptr<Sound> parseSound(Object *obj);
0050
0051
0052 ~Sound();
0053
0054 Sound(const Sound &) = delete;
0055 Sound &operator=(const Sound &) = delete;
0056
0057 const Object *getObject() const { return &streamObj; }
0058 Stream *getStream();
0059
0060 SoundKind getSoundKind() const { return kind; }
0061 const std::string &getFileName() const { return fileName; }
0062 double getSamplingRate() const { return samplingRate; }
0063 int getChannels() const { return channels; }
0064 int getBitsPerSample() const { return bitsPerSample; }
0065 SoundEncoding getEncoding() const { return encoding; }
0066
0067 Sound *copy() const;
0068
0069 private:
0070
0071 explicit Sound(const Object *obj, bool readAttrs = true);
0072
0073 Object streamObj;
0074 SoundKind kind;
0075 std::string fileName;
0076 double samplingRate;
0077 int channels;
0078 int bitsPerSample;
0079 SoundEncoding encoding;
0080 };
0081
0082 #endif