diff --git a/ndk/src/audio.rs b/ndk/src/audio.rs index 0be6e1c3..0a8db22d 100644 --- a/ndk/src/audio.rs +++ b/ndk/src/audio.rs @@ -146,6 +146,12 @@ pub enum AudioFormat { /// AudioTrack#write(float[], int, int, int). #[doc(alias = "AAUDIO_FORMAT_PCM_FLOAT")] PCM_Float = ffi::AAUDIO_FORMAT_PCM_FLOAT as ffi::aaudio_format_t, + /// This format uses 32-bit integer PCM. + /// Typically used in high-resolution audio processing. + /// The maximum range of the data is -2_147_483_648 to 2_147_483_647 + #[cfg(feature = "api-level-31")] + #[doc(alias = "AAUDIO_FORMAT_PCM_I32")] + PCM_I32 = ffi::AAUDIO_FORMAT_PCM_I32 as ffi::aaudio_format_t, #[doc(hidden)] #[num_enum(catch_all)] @@ -989,6 +995,10 @@ pub struct AudioStream { error_callback: Option, } +// AAudioStream is safe to be send, but not sync. +// See https://developer.android.com/ndk/guides/audio/aaudio/aaudio +unsafe impl Send for AudioStream {} + impl fmt::Debug for AudioStream { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("AAudioStream")