This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/util/jukebox/beep.h
falsycat 84c3a02b9a [RELEASE] u22-v03
This version is submitted to U22 breau.
2020-09-14 00:00:00 +00:00

43 lines
617 B
C

#pragma once
#include <stdatomic.h>
#include "./effect.h"
#include "./format.h"
typedef struct {
jukebox_effect_t super;
jukebox_format_t format;
atomic_bool playing;
float hz;
float amp;
float phase;
} jukebox_beep_t;
void
jukebox_beep_initialize(
jukebox_beep_t* beep,
const jukebox_format_t* format
);
void
jukebox_beep_deinitialize(
jukebox_beep_t* beep
);
/* not thread-safe function */
void
jukebox_beep_play(
jukebox_beep_t* beep,
float hz,
float amp
);
/* not thread-safe function */
void
jukebox_beep_stop(
jukebox_beep_t* beep
);