| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace cricket { | 31 namespace cricket { |
| 32 | 32 |
| 33 class AudioFrame { | 33 class AudioFrame { |
| 34 public: | 34 public: |
| 35 AudioFrame() | 35 AudioFrame() |
| 36 : audio10ms_(NULL), | 36 : audio10ms_(NULL), |
| 37 length_(0), | 37 length_(0), |
| 38 sampling_frequency_(8000), | 38 sampling_frequency_(8000), |
| 39 stereo_(false) { | 39 stereo_(false) { |
| 40 } | 40 } |
| 41 AudioFrame(int16* audio, size_t audio_length, int sample_freq, bool stereo) | 41 AudioFrame(int16_t* audio, size_t audio_length, int sample_freq, bool stereo) |
| 42 : audio10ms_(audio), | 42 : audio10ms_(audio), |
| 43 length_(audio_length), | 43 length_(audio_length), |
| 44 sampling_frequency_(sample_freq), | 44 sampling_frequency_(sample_freq), |
| 45 stereo_(stereo) { | 45 stereo_(stereo) {} |
| 46 } | |
| 47 | 46 |
| 48 int16* GetData() { return audio10ms_; } | 47 int16_t* GetData() { return audio10ms_; } |
| 49 size_t GetSize() const { return length_; } | 48 size_t GetSize() const { return length_; } |
| 50 int GetSamplingFrequency() const { return sampling_frequency_; } | 49 int GetSamplingFrequency() const { return sampling_frequency_; } |
| 51 bool GetStereo() const { return stereo_; } | 50 bool GetStereo() const { return stereo_; } |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 // TODO(janahan): currently the data is not owned by this class. | 53 // TODO(janahan): currently the data is not owned by this class. |
| 55 // add ownership when we come up with the first use case that requires it. | 54 // add ownership when we come up with the first use case that requires it. |
| 56 int16* audio10ms_; | 55 int16_t* audio10ms_; |
| 57 size_t length_; | 56 size_t length_; |
| 58 int sampling_frequency_; | 57 int sampling_frequency_; |
| 59 bool stereo_; | 58 bool stereo_; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 } // namespace cricket | 61 } // namespace cricket |
| 63 #endif // TALK_MEDIA_BASE_AUDIOFRAME_H_ | 62 #endif // TALK_MEDIA_BASE_AUDIOFRAME_H_ |
| OLD | NEW |