mirror of
https://github.com/darksaid98/mediaplex.git
synced 2026-12-02 06:28:51 +00:00
switch to libopus 1.3.1
This commit is contained in:
1 parent
2043d09058
commit
157bee33a6
400 files changed
+99699
-20
No files matched your search
+2
-2
@@ -135,7 +135,7 @@ extern "C" {
|
||||
#[doc = " This must be one of 8000, 12000, 16000,"]
|
||||
#[doc = " 24000, or 48000."]
|
||||
#[doc = " @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal"]
|
||||
#[doc = " @param [in] application <tt>int</tt>: Coding mode (one of @ref OPUS_APPLICATION_VOIP, @ref OPUS_APPLICATION_AUDIO, or @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)"]
|
||||
#[doc = " @param [in] application <tt>int</tt>: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)"]
|
||||
#[doc = " @param [out] error <tt>int*</tt>: @ref opus_errorcodes"]
|
||||
#[doc = " @note Regardless of the sampling rate and number channels selected, the Opus encoder"]
|
||||
#[doc = " can switch to a lower audio bandwidth or number of channels if the bitrate"]
|
||||
@@ -159,7 +159,7 @@ extern "C" {
|
||||
#[doc = " This must be one of 8000, 12000, 16000,"]
|
||||
#[doc = " 24000, or 48000."]
|
||||
#[doc = " @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal"]
|
||||
#[doc = " @param [in] application <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY)"]
|
||||
#[doc = " @param [in] application <tt>int</tt>: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY)"]
|
||||
#[doc = " @retval #OPUS_OK Success or @ref opus_errorcodes"]
|
||||
pub fn opus_encoder_init(
|
||||
st: *mut OpusEncoder,
|
||||
|
||||
+5
-3
@@ -25,11 +25,13 @@ fn get_decode_error(decoded_samples: i32) -> &'static str {
|
||||
|
||||
#[napi]
|
||||
pub fn get_opus_version() -> String {
|
||||
let ver = unsafe { opus_get_version_string() };
|
||||
let version_string = unsafe { opus_get_version_string() };
|
||||
let version_cstr = unsafe { core::ffi::CStr::from_ptr(version_string) };
|
||||
|
||||
let c_str = unsafe { std::ffi::CStr::from_ptr(ver).to_str() };
|
||||
// fallback to libopus v1.3.1 (cloned), it was cloned from 1.3.1 branch
|
||||
let version_string = version_cstr.to_str().unwrap_or("libopus v1.3.1 (cloned)").to_owned();
|
||||
|
||||
return c_str.unwrap_or("unknown").to_string();
|
||||
return version_string;
|
||||
}
|
||||
|
||||
#[napi(js_name = "OpusEncoder")]
|
||||
|
||||
Reference in new issue
Block a user