Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <stdio.h>
- #include <stdint.h>
- #include <stdlib.h>
- //portAudio
- static const uint16_t SAMPLE_RATE = 32768;
- static const uint16_t FRAMES_PER_BUFFER = 64;
- //ukael
- static const uint8_t DEFAULT_AMPLITUDE = 128;
- static const uint32_t BUFFER_SIZE = (2<<18); //Size of the audio buffer
- static const uint8_t MAX_CHANNELS = 1;
- //AudioData (data*, size, position)
- typedef struct {
- uint8_t* data; // Pointer to the raw audio data
- size_t size; // AudioData sample count
- size_t position; // Current position in the audio data
- } AudioData;
- //typedef
- //fraction (a, b)
- typedef struct {
- uint16_t a;
- uint16_t b;
- } Frac;
- //wave arguments (uint32_t time, frac, u8arg, u16arg)
- typedef struct{
- uint32_t time; //uint16_t time
- Frac freq; //Frac{frac.a,frac.b}
- uint8_t u8arg[4]; //uint8_t u8arg[4]
- uint16_t u16arg[4]; //uint16_t u16arg[4]
- } WaveArg;
- //wave function wrapper
- typedef uint8_t (*ukaelWave)(WaveArg *arg);
- // WaveMap (const char* id, WaveArg args)
- typedef struct {
- const char* id;
- ukaelWave waveFunc;
- } WaveMap;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement