siudesu / soloudmodule Goto Github PK
View Code? Open in Web Editor NEWSolar2D Lua module to use with SoLoud plugin.
License: MIT License
Solar2D Lua module to use with SoLoud plugin.
License: MIT License
if I call audio.stop(channel)
on a channel that has not been used, it will call an eror:
m_soloud_audio.lua:718: attempt to index field '?' (a nil value)
According to the solar2d api document , audio.play should return current used channel number.
Hi, I got a weird bug when playing sound with this module
compare to the solar2d audio api
.
Here is the test example:
test_soloud_audio.zip
I tested it on MacOS-simulator-3690.
After #4 fixed, M.stop
has no effect.
filename_
should be fileName_.
function M.dispose(fileName_)
-- Solar2D API: audio.dispose( audioHandle )
-- Note: Destroying the audio will also stop the audio.
-- !Unlike the audio API, it is possible to destroy (without errors) an audio while it's already playing.
-- Destroy audio if it exists.
if cache[fileName_] then cache[fileName_].wavObj:destroy() end
-- All channels that were playing the audio will be clear.
-- clearAllChannels(filename_)
clearAllChannels(fileName_)
-- Clear cache.
cache[fileName_] = nil
end
findFreeChannel
should start with 1 in Lua when startChannel_
is nil.
function M.findFreeChannel(startChannel_)
-- Solar2D API: audio.findFreeChannel( [ startChannel ] )
-- Search will increase upwards from this channel. 0 or no parameter begins searching at the lowest possible value.
-- The search does not include reserved channels.
-- Returns 0 if no available channel found, else it returns next available channel.
-- return getNextAvailableChannel(startChannel_ or 0) or 0
return getNextAvailableChannel(startChannel_ or 1) or 0
end
Hi!
I use this code to control sound speed:
local speed = 0.5
local source = audio.getSourceFromChannel(channel)
al.Source(source, al.PITCH, speed)
Is there something similar api in plugin.soloud
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.