extension-openal icon indicating copy to clipboard operation
extension-openal copied to clipboard

It is possible for extension to not be init by script init?

Open subsoap opened this issue 5 years ago • 1 comments

2019-09-26 08_45_37-Window

function init(self)
	msg.post(".", "acquire_input_focus")
	
	local info = openal.get_info()
	print('OpenAL info:')
	print('Vendor:', info.vendor)
	print('Version:', info.version)
	print('Renderer:', info.renderer)
	print('Extensions:', info.extensions)
	openal.speed_of_sound = 3300;
end

What's weird is that the example project does work

2019-09-26 08_49_49-Window

If I add the info to on update then it shows up

2019-09-26 08_47_16-Window

But it appears if I setup any listener / source on init on scripts before extension is fully setup audio doesn't work at all?

subsoap avatar Sep 26 '19 15:09 subsoap

You have to interact with it first....


function init(self)
	msg.post(".", "acquire_input_focus")

	local res = resource.load('/assets/audio/cuties/chick/cat.wav')
	local pos = go.get_position()
	self.source = openal.new_source(res)
	
	local info = openal.get_info()
	print('OpenAL info:')
	print('Vendor:', info.vendor)
	print('Version:', info.version)
	print('Renderer:', info.renderer)
	print('Extensions:', info.extensions)
	openal.speed_of_sound = 3300;
end

2019-09-26 08_54_42-Window

subsoap avatar Sep 26 '19 15:09 subsoap