Skip to content

Commit 292f7ec

Browse files
author
Maciej Makowski
committed
ci: yarn format
1 parent e794ed9 commit 292f7ec

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

apps/common-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"react-dom": "18.2.0",
3737
"react-native": "0.76.0",
3838
"react-native-audio-api": "workspace:*",
39+
"react-native-dotenv": "^3.4.11",
3940
"react-native-gesture-handler": "^2.20.2",
4041
"react-native-reanimated": "^3.16.1",
4142
"react-native-safe-area-context": "^4.12.0",

packages/react-native-audio-api/android/src/main/cpp/AudioDecoder/AudioDecoder.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#include "AudioDecoder.h"
22

33
#define MINIAUDIO_IMPLEMENTATION
4+
#include <android/log.h>
45
#include "miniaudio.h"
56

67
#include "AudioArray.h"
78
#include "AudioBus.h"
89

9-
#include <android/log.h>
10-
#define LOG_TAG "AudioDecoder"
11-
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
12-
1310
namespace audioapi {
1411

1512
AudioDecoder::AudioDecoder(int sampleRate) : sampleRate_(sampleRate) {}
@@ -20,7 +17,11 @@ AudioBus *AudioDecoder::decodeWithFilePath(const std::string &path) const {
2017
ma_decoder_config_init(ma_format_f32, 2, sampleRate_);
2118
ma_result result = ma_decoder_init_file(path.c_str(), &config, &decoder);
2219
if (result != MA_SUCCESS) {
23-
LOGE("Failed to initialize decoder for file: %s", path.c_str());
20+
__android_log_print(
21+
ANDROID_LOG_ERROR,
22+
"AudioDecoder",
23+
"Failed to initialize decoder for file: %s",
24+
path.c_str());
2425
return new AudioBus(1, 1, 1);
2526
}
2627

@@ -34,7 +35,11 @@ AudioBus *AudioDecoder::decodeWithFilePath(const std::string &path) const {
3435
ma_uint64 framesDecoded;
3536
ma_decoder_read_pcm_frames(&decoder, buffer, totalFrameCount, &framesDecoded);
3637
if (framesDecoded == 0) {
37-
LOGE("Failed to read any frames from decoder");
38+
__android_log_print(
39+
ANDROID_LOG_ERROR,
40+
"AudioDecoder",
41+
"Failed to decode audio file: %s",
42+
path.c_str());
3843
}
3944

4045
for (int i = 0; i < decoder.outputChannels; ++i) {

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5740,6 +5740,7 @@ __metadata:
57405740
react-dom: "npm:18.2.0"
57415741
react-native: "npm:0.76.0"
57425742
react-native-audio-api: "workspace:*"
5743+
react-native-dotenv: "npm:^3.4.11"
57435744
react-native-gesture-handler: "npm:^2.20.2"
57445745
react-native-reanimated: "npm:^3.16.1"
57455746
react-native-safe-area-context: "npm:^4.12.0"

0 commit comments

Comments
 (0)