Rename CodingMode to Application

Makes it more in line with the Opus terminology
This commit is contained in:
Jean-Marc Valin
2016-07-20 17:03:07 -04:00
committed by Tad Hardesty
parent 4173ad0371
commit 0117ef5011
2 changed files with 7 additions and 7 deletions

View File

@@ -32,9 +32,9 @@ const OPUS_GET_SAMPLE_RATE: c_int = 4029; // out *i32
const OPUS_SET_BITRATE: c_int = 4002; // in i32
const OPUS_GET_BITRATE: c_int = 4003; // out *i32
/// The possible coding modes for the codec.
/// The possible applications for the codec.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum CodingMode {
pub enum Application {
/// Best for most VoIP/videoconference applications where listening quality and intelligibility matter most.
Voip = 2048,
/// Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input.
@@ -121,7 +121,7 @@ pub struct Encoder {
impl Encoder {
/// Create and initialize an encoder.
pub fn new(sample_rate: u32, channels: Channels, mode: CodingMode) -> Result<Encoder> {
pub fn new(sample_rate: u32, channels: Channels, mode: Application) -> Result<Encoder> {
let mut error = 0;
let ptr = unsafe { ffi::opus_encoder_create(
sample_rate as i32,