Skip to content

Commit

Permalink
ci: yarn format
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Makowski committed Dec 10, 2024
1 parent e794ed9 commit 292f7ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/common-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#include "AudioDecoder.h"

#define MINIAUDIO_IMPLEMENTATION
#include <android/log.h>
#include "miniaudio.h"

#include "AudioArray.h"
#include "AudioBus.h"

#include <android/log.h>
#define LOG_TAG "AudioDecoder"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

namespace audioapi {

AudioDecoder::AudioDecoder(int sampleRate) : sampleRate_(sampleRate) {}
Expand All @@ -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);
}

Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 292f7ec

Please sign in to comment.