Skip to content

Commit

Permalink
Create SynchronizedAudioBufferList.h
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Jul 27, 2023
1 parent 0e695fd commit 18d08f9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Sources/CAudio/SynchronizedAudioBufferList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#import <AVFoundation/AVFoundation.h>
#import <CoreAudio/CoreAudio.h>

struct SynrchonizedAudioBufferList2 {

AVAudioPCMBuffer* pcmBuffer;

AudioBufferList* abl;

std::atomic<int> sync;

void endWriting() {
sync.fetch_add(1, std::memory_order_release);
}

void beginReading() {
sync.fetch_sub(1, std::memory_order_acquire);
}
};

0 comments on commit 18d08f9

Please sign in to comment.