12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /*
- * audio_parameter1.h
- *
- * Created on: 2022年5月6日
- * Author: pengzc
- */
- #ifndef JNI_VOIP_AUDIO_PARAMETER_H_
- #define JNI_VOIP_AUDIO_PARAMETER_H_
- #include <string>
- namespace base {
- enum SampleFormat {
- SAMPLE_FMT_U8, ///< unsigned 8 bits
- SAMPLE_FMT_S16, ///< signed 16 bits
- SAMPLE_FMT_S32, ///< signed 32 bits
- SAMPLE_FMT_FLT, ///< float
- SAMPLE_FMT_DBL, ///< double
- SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar
- SAMPLE_FMT_S16P, ///< signed 16 bits, planar
- SAMPLE_FMT_S32P, ///< signed 32 bits, planar
- SAMPLE_FMT_FLTP, ///< float, planar
- SAMPLE_FMT_DBLP, ///< double, planar
- SAMPLE_FMT_S64, ///< signed 64 bits
- SAMPLE_FMT_S64P, ///< signed 64 bits, planar
- };
- enum SampleRate {
- SAMPLE_RATE_8000 = 8000, /* 8kHz sampling rate */
- SAMPLE_RATE_11025 = 11025, /* 11.025kHz sampling rate */
- SAMPLE_RATE_12000 = 12000, /* 12kHz sampling rate */
- SAMPLE_RATE_16000 = 16000, /* 16kHz sampling rate */
- SAMPLE_RATE_22050 = 22050, /* 22.05kHz sampling rate */
- SAMPLE_RATE_24000 = 24000, /* 24kHz sampling rate */
- SAMPLE_RATE_32000 = 32000, /* 32kHz sampling rate */
- SAMPLE_RATE_44100 = 44100, /* 44.1kHz sampling rate */
- SAMPLE_RATE_48000 = 48000, /* 48kHz sampling rate */
- SAMPLE_RATE_96000 = 96000, /* 96kHz sampling rate */
- };
- enum ChannelLayout {
- };
- struct AudioParameter {
- int number_of_channels;
- int sample_rate;
- int sample_format;
- AudioParameter() {
- number_of_channels = 0;
- sample_rate = 0;
- sample_format = 0;
- }
- AudioParameter(int number_of_channels, int sample_rate, int sample_format) {
- this->number_of_channels = number_of_channels;
- this->sample_rate = sample_rate;
- this->sample_format = sample_format;
- }
- std::string ToString();
- };
- } /* namespace base */
- bool operator==(const base::AudioParameter& a, const base::AudioParameter& b);
- bool operator!=(const base::AudioParameter& a, const base::AudioParameter& b);
- #endif /* JNI_VOIP_AUDIO_PARAMETER_H_ */
|