Skip to content

sink-agnostic api? #97

@Alloyed

Description

@Alloyed

So thanks in advance for writing this: I've thought about doing something like this myself for a while and I just happened upon this repo maybe yesterday~

I'd like to use it in the love2d engine, which we've already got an integration for (nice), but because it directly uses portaudio I'd have to run two audio engines in my game: one for 3d sound fx, and one just for music. love has introduced a new API for providing a streaming source of audio I'd like to use instead. Here's what an integration with that might look like:

-- a source is analogous to a sample, you can play/pause/apply effects to it
local source = love.audio.newQueueableSource(...)
-- this is just a chunk of memory
local data = love.audio.newSoundData(...)
function love.update(dt) -- game update, runs at 60fps
    if shouldUpdateAudio then
        -- this would do the work of update()
        modipulate.fill_buffer(data, len, samplerate, etc...)
        source:queue(data)
        source:play()
    end
end

Is modipulate in a good place for this kind of change? If I wanted to do it myself where should I start?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions