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
11 changes: 11 additions & 0 deletions src/lime/_internal/backend/native/NativeAudioSource.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class NativeAudioSource

#if lime_openalsoft
private static var hasDirectChannelsExt:Null<Bool>;
private static var hasSourceSpatializeExt:Null<Bool>;
#end

private var buffers:Array<ALBuffer>;
Expand Down Expand Up @@ -150,6 +151,16 @@ class NativeAudioSource
{
AL.sourcei(handle, AL.DIRECT_CHANNELS_SOFT, AL.REMIX_UNMATCHED_SOFT);
}

if (hasSourceSpatializeExt == null)
{
hasSourceSpatializeExt = AL.isExtensionPresent("AL_SOFT_source_spatialize");
}

if (hasSourceSpatializeExt)
{
AL.sourcei(handle, AL.SOURCE_SPATIALIZE_SOFT, AL.TRUE);
}
#end

samples = Std.int((dataLength * 8.0) / (parent.buffer.channels * parent.buffer.bitsPerSample));
Expand Down
3 changes: 3 additions & 0 deletions src/lime/media/openal/AL.hx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ class AL
/* AL_SOFT_direct_channels_remix extension */
public static inline var DROP_UNMATCHED_SOFT:Int = 0x0001;
public static inline var REMIX_UNMATCHED_SOFT:Int = 0x0002;
/* AL_SOFT_source_spatialize extension */
public static inline var SOURCE_SPATIALIZE_SOFT:Int = 0x1214;
public static inline var AUTO_SOFT:Int = 0x0002;
#end

public static function removeDirectFilter(source:ALSource)
Expand Down