Commit 61e90e8
committed
Expose internal device properties negotiated by the audio backend
After initialization, miniaudio's ma_device struct contains both the
requested and the actual (internal) format, channel count, and sample
rate for capture and playback. The internal values reflect what the
audio backend actually negotiated, which can differ from what the
application requested.
A common case is ALSA's dsnoop plugin, which locks the hardware at a
fixed sample rate and silently resamples. The existing SampleRate()
method returns the requested rate, hiding the mismatch. The new
CaptureInternalSampleRate() and PlaybackInternalSampleRate() methods
let callers detect this.
New methods:
- CaptureInternalSampleRate / PlaybackInternalSampleRate
- CaptureInternalFormat / PlaybackInternalFormat
- CaptureInternalChannels / PlaybackInternalChannels1 parent 856f609 commit 61e90e8
1 file changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
104 | 144 | | |
105 | 145 | | |
106 | 146 | | |
| |||
0 commit comments