File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class NativeAudioSource
2828
2929 #if lime_openalsoft
3030 private static var canQueryLatency : Null <Bool >;
31+ private static var hasDirectChannelsExt : Null <Bool >;
3132 #end
3233
3334 private var buffers : Array <ALBuffer >;
@@ -140,6 +141,20 @@ class NativeAudioSource
140141 }
141142 }
142143
144+ AL .sourcei (handle , 0 , 0 );
145+
146+ #if lime_openalsoft
147+ if (hasDirectChannelsExt == null )
148+ {
149+ hasDirectChannelsExt = AL .isExtensionPresent (" AL_SOFT_direct_channels" ) && AL .isExtensionPresent (" AL_SOFT_direct_channels_remix" );
150+ }
151+
152+ if (hasDirectChannelsExt )
153+ {
154+ AL .sourcei (handle , AL .DIRECT_CHANNELS_SOFT , AL .REMIX_UNMATCHED_SOFT );
155+ }
156+ #end
157+
143158 samples = Std .int ((dataLength * 8.0 ) / (parent .buffer .channels * parent .buffer .bitsPerSample ));
144159 }
145160
Original file line number Diff line number Diff line change @@ -233,13 +233,21 @@ class AL
233233 public static inline var FILTER_LOWPASS : Int = 0x0001 ;
234234 public static inline var FILTER_HIGHPASS : Int = 0x0002 ;
235235 public static inline var FILTER_BANDPASS : Int = 0x0003 ;
236+
237+ #if lime_openalsoft
236238 /* AL_SOFT_source_latency extension */
237239 public static inline var SAMPLE_OFFSET_LATENCY_SOFT = 0x1200 ;
238240 public static inline var SEC_OFFSET_LATENCY_SOFT = 0x1201 ;
239241
240- #if lime_openalsoft
241242 /* AL_SOFT_hold_on_disconnect extension */
242243 public static inline var STOP_SOURCES_ON_DISCONNECT_SOFT : Int = 0x19AB ;
244+
245+ /* AL_SOFT_direct_channels extension */
246+ public static inline var DIRECT_CHANNELS_SOFT : Int = 0x1033 ;
247+
248+ /* AL_SOFT_direct_channels_remix extension */
249+ public static inline var DROP_UNMATCHED_SOFT : Int = 0x0001 ;
250+ public static inline var REMIX_UNMATCHED_SOFT : Int = 0x0002 ;
243251 #end
244252
245253 public static function removeDirectFilter (source : ALSource )
You can’t perform that action at this time.
0 commit comments