Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 34 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,72 +19,66 @@ jobs:
build_type: Release
pcm_tests: ON

- name: "MacOS 14 arm64 (xc15)"
os: macos-14-xlarge
- name: "MacOS 27 arm64 (xc27)"
os: xcode-27
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcodes select 15.4
set_xcode_version_cmd: xcodes select 27.1

- name: "MacOS 14 x86_64 (xc15)"
os: macos-14-large
- name: "MacOS 26 arm64 (xc26)"
os: macos-26
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcodes select 15.4
set_xcode_version_cmd: xcodes select 26.6

- name: "MacOS 13 arm64 (xc14)"
os: macos-13-xlarge
- name: "MacOS 15 arm64 (xc16)"
os: macos-15
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcodes select 14.3.1
set_xcode_version_cmd: xcodes select 16.4

- name: "MacOS 13 x86_64 (xc14)"
os: macos-13-large
- name: "MacOS 15 x86_64 (xc16)"
os: macos-15-intel
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcodes select 14.3.1
set_xcode_version_cmd: xcodes select 16.4

- name: "MacOS 12 (xc13)"
os: macos-12
- name: "Ubuntu 26.04 (GCC-14)"
os: ubuntu-26.04
build_type: Release
pcm_tests: ON
set_xcode_version_cmd: xcodes select 13.4.1
cc: "gcc-14"
cxx: "g++-14"

- name: "Ubuntu 22.04 (GCC-11)"
os: ubuntu-22.04
- name: "Ubuntu 24.04 arm64 (GCC-13)"
os: ubuntu-24.04-arm
build_type: Release
pcm_tests: ON
cc: "gcc-11"
cxx: "g++-11"
cc: "gcc-13"
cxx: "g++-13"

- name: "Ubuntu 22.04 (GCC-10)"
os: ubuntu-22.04
- name: "Ubuntu 24.04 (GCC-13)"
os: ubuntu-24.04
build_type: Release
pcm_tests: ON
cc: "gcc-10"
cxx: "g++-10"
cc: "gcc-13"
cxx: "g++-13"

- name: "Ubuntu 20.04 (GCC-9)"
os: ubuntu-20.04
- name: "Ubuntu 24.04 (GCC-12)"
os: ubuntu-24.04
build_type: Release
pcm_tests: ON
cc: "gcc-9"
cxx: "g++-9"
cc: "gcc-12"
cxx: "g++-12"

- name: "Ubuntu 20.04 (GCC-8)"
os: ubuntu-20.04
build_type: Release
pcm_tests: ON
cc: "gcc-8"
cxx: "g++-8"

- name: "Code-Coverage (Ubuntu 20.04, GCC-9)"
os: ubuntu-20.04
- name: "Code-Coverage (Ubuntu 24.04, GCC-13)"
os: ubuntu-24.04
build_type: Coverage
pcm_tests: OFF
code_coverage: true
cc: "gcc-9"
cxx: "g++-9"
gcov: "gcov-9"
cc: "gcc-13"
cxx: "g++-13"
gcov: "gcov-13"


steps:
Expand Down Expand Up @@ -136,7 +130,7 @@ jobs:
sudo apt-get install -y lcov
lcov --version
echo $(which ${GCOV})
lcov --gcov-tool $(which ${GCOV}) -d . -c -o coverage.info
lcov --gcov-tool $(which ${GCOV}) -d . -c -o coverage.info --ignore-errors mismatch --exclude '*/test/*'

- name: Upload code coverage results
if: matrix.config.code_coverage == true
Expand Down
26 changes: 14 additions & 12 deletions audiostream/src/ni/media/audio/os/mac/core_audio_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,15 @@ void core_audio_source<Source>::setupInfo( audio::ifstream_info::container_type

auto info = buildOutStreamInfo( m_media, fileId, container );

AudioStreamBasicDescription description{.mFormatID = kAudioFormatLinearPCM,
.mChannelsPerFrame = UInt32( info.num_channels() ),
.mSampleRate = Float64( info.sample_rate() ),
.mFormatFlags = formatToAudioFormatFlags( info.format() ),
.mFramesPerPacket = 1,
.mBitsPerChannel = UInt32( info.bits_per_sample() ),
.mBytesPerPacket = UInt32( info.bytes_per_frame() ),
.mBytesPerFrame = UInt32( info.bytes_per_frame() )};
auto description = AudioStreamBasicDescription{};
description.mSampleRate = Float64( info.sample_rate() );
description.mFormatID = kAudioFormatLinearPCM;
description.mFormatFlags = formatToAudioFormatFlags( info.format() );
description.mBytesPerPacket = UInt32( info.bytes_per_frame() );
description.mFramesPerPacket = 1;
description.mBytesPerFrame = UInt32( info.bytes_per_frame() );
description.mChannelsPerFrame = UInt32( info.num_channels() );
description.mBitsPerChannel = UInt32( info.bits_per_sample() );

if ( ExtAudioFileSetProperty( m_media, kExtAudioFileProperty_ClientDataFormat, sizeof( description ), &description )
!= noErr )
Expand Down Expand Up @@ -388,10 +389,11 @@ std::streamsize core_audio_source<Source>::read( char* dst, std::streamsize size

size = std::min( size, std::streamsize( end - m_pos ) );

AudioBufferList buffer{.mNumberBuffers = 1,
.mBuffers[0] = {.mNumberChannels = UInt32( m_info.num_channels() ),
.mDataByteSize = UInt32( size ),
.mData = static_cast<void*>( dst )}};
auto buffer = AudioBufferList{};
buffer.mNumberBuffers = 1;
buffer.mBuffers[0].mNumberChannels = UInt32( m_info.num_channels() );
buffer.mBuffers[0].mDataByteSize = UInt32( size );
buffer.mBuffers[0].mData = dst;

auto num_frames = UInt32( size / m_info.bytes_per_frame() );
if ( noErr != ExtAudioFileRead( m_media, &num_frames, &buffer ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
DEFINE_MEDIATYPE_GUID( MFAudioFormat_ALAC, 0x6C61 );
#endif

// The encoder delay and padding attributes are only declared for windows10 and higher
DEFINE_GUID( MF_SD_AUDIO_ENCODER_DELAY, 0x8e85422c, 0x73de, 0x403f, 0x9a, 0x35, 0x55, 0x0a, 0xd6, 0xe8, 0xb9, 0x51 );
DEFINE_GUID( MF_SD_AUDIO_ENCODER_PADDING, 0x529c7f2c, 0xac4b, 0x4e3f, 0xbf, 0xc3, 0x09, 0x02, 0x19, 0x49, 0x82, 0xcb );

// Flac is only defined in widows10 sdk and higher
#ifndef MFAudioFormat_FLAC
DEFINE_MEDIATYPE_GUID( MFAudioFormat_FLAC, 0xF1AC );
Expand Down
Loading
Loading