Skip to content

How do we play back animation and sound together #6

@glowmouse

Description

@glowmouse

Idea 1:

Add a non-blocking/ non async update/ service call to the sound sub-system, similar to what's already there, and call it when we're animating gifs. Servicing that is just stuffing the sound pipe, which sound be fast.

Idea 2:

I feel it's more Rust like to have the sound service be an async function, and to run both the animation playback and sound playback at the same time.

One thought would be something like std::sync::mpsc::channel, which is basically a safe pipe, with the main async task on the sender end of the pipe and a sound service on the receiver.

The main pipe would send commands like "start playing sound XXXX" to the the sound service, which would run in its own async thread. It might look something like

   start_sound( ANIMATION_SOUND_ID );  // does not block, not async
   play_animation( AIMATION_GIF_ID ); // 100% async task
   stop_sound();  // does not block, not async

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions