From 292f7ec1ed4cb8f370564692de6031836b9abc03 Mon Sep 17 00:00:00 2001 From: Maciej Makowski Date: Tue, 10 Dec 2024 13:46:53 +0100 Subject: [PATCH] ci: yarn format --- apps/common-app/package.json | 1 + .../src/main/cpp/AudioDecoder/AudioDecoder.cpp | 17 +++++++++++------ yarn.lock | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/common-app/package.json b/apps/common-app/package.json index ae52d4c2..622ff9f4 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -36,6 +36,7 @@ "react-dom": "18.2.0", "react-native": "0.76.0", "react-native-audio-api": "workspace:*", + "react-native-dotenv": "^3.4.11", "react-native-gesture-handler": "^2.20.2", "react-native-reanimated": "^3.16.1", "react-native-safe-area-context": "^4.12.0", diff --git a/packages/react-native-audio-api/android/src/main/cpp/AudioDecoder/AudioDecoder.cpp b/packages/react-native-audio-api/android/src/main/cpp/AudioDecoder/AudioDecoder.cpp index eb6646e2..8a3c0003 100644 --- a/packages/react-native-audio-api/android/src/main/cpp/AudioDecoder/AudioDecoder.cpp +++ b/packages/react-native-audio-api/android/src/main/cpp/AudioDecoder/AudioDecoder.cpp @@ -1,15 +1,12 @@ #include "AudioDecoder.h" #define MINIAUDIO_IMPLEMENTATION +#include #include "miniaudio.h" #include "AudioArray.h" #include "AudioBus.h" -#include -#define LOG_TAG "AudioDecoder" -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) - namespace audioapi { AudioDecoder::AudioDecoder(int sampleRate) : sampleRate_(sampleRate) {} @@ -20,7 +17,11 @@ AudioBus *AudioDecoder::decodeWithFilePath(const std::string &path) const { ma_decoder_config_init(ma_format_f32, 2, sampleRate_); ma_result result = ma_decoder_init_file(path.c_str(), &config, &decoder); if (result != MA_SUCCESS) { - LOGE("Failed to initialize decoder for file: %s", path.c_str()); + __android_log_print( + ANDROID_LOG_ERROR, + "AudioDecoder", + "Failed to initialize decoder for file: %s", + path.c_str()); return new AudioBus(1, 1, 1); } @@ -34,7 +35,11 @@ AudioBus *AudioDecoder::decodeWithFilePath(const std::string &path) const { ma_uint64 framesDecoded; ma_decoder_read_pcm_frames(&decoder, buffer, totalFrameCount, &framesDecoded); if (framesDecoded == 0) { - LOGE("Failed to read any frames from decoder"); + __android_log_print( + ANDROID_LOG_ERROR, + "AudioDecoder", + "Failed to decode audio file: %s", + path.c_str()); } for (int i = 0; i < decoder.outputChannels; ++i) { diff --git a/yarn.lock b/yarn.lock index 82b7c60d..0e5b5c28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5740,6 +5740,7 @@ __metadata: react-dom: "npm:18.2.0" react-native: "npm:0.76.0" react-native-audio-api: "workspace:*" + react-native-dotenv: "npm:^3.4.11" react-native-gesture-handler: "npm:^2.20.2" react-native-reanimated: "npm:^3.16.1" react-native-safe-area-context: "npm:^4.12.0"