Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
f560f479
Commit
f560f479
authored
Nov 02, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS: Try adding support for Bluetooth routing.
parent
07c26bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
miniaudio.h
miniaudio.h
+17
-1
No files found.
miniaudio.h
View file @
f560f479
...
@@ -1993,6 +1993,10 @@ typedef struct
...
@@ -1993,6 +1993,10 @@ typedef struct
ma_bool32 tryAutoSpawn; /* Enables autospawning of the PulseAudio daemon if necessary. */
ma_bool32 tryAutoSpawn; /* Enables autospawning of the PulseAudio daemon if necessary. */
} pulse;
} pulse;
struct
struct
{
ma_bool32 noBluetoothRouting;
} coreaudio;
struct
{
{
const char* pClientName;
const char* pClientName;
ma_bool32 tryStartServer;
ma_bool32 tryStartServer;
...
@@ -20401,9 +20405,21 @@ ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma_contex
...
@@ -20401,9 +20405,21 @@ ma_result ma_context_init__coreaudio(const ma_context_config* pConfig, ma_contex
#if defined(MA_APPLE_MOBILE)
#if defined(MA_APPLE_MOBILE)
@autoreleasepool {
@autoreleasepool {
AVAudioSession* pAudioSession = [AVAudioSession sharedInstance];
AVAudioSession* pAudioSession = [AVAudioSession sharedInstance];
AVAudioSessionCategoryOptions options = 0;
ma_assert(pAudioSession != NULL);
ma_assert(pAudioSession != NULL);
[pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord error:nil];
/*
Try enabling routing to Bluetooth devices. The AVAudioSessionCategoryOptionAllowBluetoothA2DP is only available
starting from iOS 10 so I'm doing a version check before enabling this.
*/
if (!pConfig->coreaudio.noBluetoothRouting) {
if ([[[UIDevice currentDevice] systemVersion] compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending) {
options = 0x20; /* 0x20 = AVAudioSessionCategoryOptionAllowBluetoothA2DP */
}
}
[pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord withOptions:options error:nil];
/* By default we want miniaudio to use the speakers instead of the receiver. In the future this may be customizable. */
/* By default we want miniaudio to use the speakers instead of the receiver. In the future this may be customizable. */
ma_bool32 useSpeakers = MA_TRUE;
ma_bool32 useSpeakers = MA_TRUE;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment