Skip to content

Commit

Permalink
feat: update translations
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsek committed Nov 20, 2024
1 parent 3822884 commit ea951c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 0 additions & 5 deletions packages/react-native-audio-api/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ project(react-native-audio-api)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 20)

# Detect the operating system
if(APPLE)
set(HAVE_ACCELERATE TRUE)
endif()

# Detect the processor and SIMD support
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(HAVE_ARM_NEON_INTRINSICS TRUE)
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native-audio-api/ios/AudioAPIModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#import <React/RCTBridgeModule.h>
#endif // RCT_NEW_ARCH_ENABLED

#ifndef HAVE_ACCELERATE
#define HAVE_ACCELERATE
#endif

#import <React/RCTEventEmitter.h>

@interface AudioAPIModule : RCTEventEmitter
Expand Down
10 changes: 9 additions & 1 deletion packages/react-native-audio-api/ios/AudioPlayer/AudioPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ - (int)getSampleRate

- (int)getBufferSizeInFrames
{
return (int)(self.audioSession.IOBufferDuration * self.audioSession.sampleRate);
// Note: might be important in the future.
// For some reason audioSession.IOBufferDuration is always 0.01, which for sample rate of 48k
// gives exactly 480 frames, while at the same time frameCount requested by AVAudioSourceEngine
// might vary f.e. between 555-560.
// preferredIOBufferDuration seems to be double the value (resulting in 960 frames),
// which is safer to base our internal AudioBus sizes.
// Buut no documentation => no guarantee :)
// If something is crackling when it should play silence, start here 📻
return (int)(self.audioSession.preferredIOBufferDuration * self.audioSession.sampleRate);
}

- (void)start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default class AudioScheduledSourceNode extends AudioNode {

this.hasBeenStarted = true;
(this.node as IAudioScheduledSourceNode).start(when);
this.hasBeenStarted = true;
}

public stop(when: number = 0): void {
Expand Down

0 comments on commit ea951c9

Please sign in to comment.