Skip to content

Commit

Permalink
update to version 1.3.1-beta.4
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpaulsen committed Jan 27, 2023
1 parent bcde0b6 commit 500b634
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 31 deletions.
4 changes: 2 additions & 2 deletions bin/android-aarch64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/android-x86_64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/ios-aarch64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/ios-x86_64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/linux-aarch64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/linux-x86_64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/macos-aarch64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/macos-x86_64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/windows-aarch64/odin.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion bin/windows-aarch64/odin.lib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/windows-x86_64/odin.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion bin/windows-x86_64/odin.lib
Git LFS file not shown
6 changes: 4 additions & 2 deletions include/odin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

#pragma once

/** @file */

#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>

#define ODIN_VERSION "1.3.0"
#define ODIN_VERSION "1.3.1-beta.4"

/**
* Supported channel layouts in audio functions.
Expand Down Expand Up @@ -450,7 +452,7 @@ typedef struct OdinApmConfig {
*/
float voice_activity_detection_release_probability;
/**
* Enables or disables voice activity detection (VAD)
* Enables or disables the input volume gate
*/
bool volume_gate;
/**
Expand Down
39 changes: 32 additions & 7 deletions test/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,39 @@ void handle_audio_data(ma_device *device, void *output, const void *input, ma_ui
}
else if (device->type == ma_device_type_playback)
{
/*
* Keep things simple and fill the miniaudio output buffer with mixed data from available ODIN output streams
*/
size_t samples_read = frame_count;
int error = odin_audio_mix_streams(room, output_streams, output_streams_len, output, &samples_read, OdinChannelLayout_Mono);
if (odin_is_error(error))
if (true /* wether or not to handle invidual streams */)
{
/**
* Walk through list of ODIN output streams to read and mix their data into the miniaudio output buffer
*/
float *samples = malloc(frame_count * sizeof(float));
for (size_t i = 0; i < output_streams_len; i++)
{

int error = odin_audio_read_data(output_streams[i], samples, frame_count, OdinChannelLayout_Mono);
if (odin_is_error(error))
{
print_error(error, "Failed to read audio data from media handle");
}
for (size_t i = 0; i < frame_count; ++i)
{
((float *)output)[i] += samples[i];
}
}
odin_audio_process_reverse(room, (float *)output, frame_count, OdinChannelLayout_Mono);
free(samples);
}
else
{
print_error(error, "Failed to read mixed audio data");
/*
* Keep things simple and fill the miniaudio output buffer with mixed data from available ODIN output streams
*/
size_t samples_read = frame_count;
int error = odin_audio_mix_streams(room, output_streams, output_streams_len, output, &samples_read, OdinChannelLayout_Mono);
if (odin_is_error(error))
{
print_error(error, "Failed to read mixed audio data");
}
}
}
}
Expand Down

0 comments on commit 500b634

Please sign in to comment.