|
PebbleOS
|
#include <pbl/services/speaker/note_sequence.h>#include <pbl/services/speaker/speaker_pcm_format.h>#include <stdbool.h>#include <stdint.h>Data Structures | |
| struct | SpeakerSample |
| A raw PCM sample that can be pitch-shifted when played by a track. More... | |
| struct | SpeakerTrack |
| A single monophonic voice. More... | |
| struct SpeakerSample |
A raw PCM sample that can be pitch-shifted when played by a track.
| Data Fields | ||
|---|---|---|
| uint8_t | base_midi_note |
The MIDI note at which the sample plays unshifted (e.g. 60 = C4). Notes above/below this value are produced by resampling. |
| const void * | data | Mono signed PCM in the given format. |
| SpeakerPcmFormat | format | Sample rate + bit depth (see SpeakerPcmFormat). |
| bool | loop | If true, the sample restarts from the beginning each time it runs out, and keeps playing until the owning note's duration elapses. |
| uint32_t | num_bytes | Size of data in bytes. |
| struct SpeakerTrack |
A single monophonic voice.
Multiple tracks are mixed together by speaker_play_tracks() to produce polyphony.
| Data Fields | ||
|---|---|---|
| const SpeakerNote * | notes | Array of notes to play sequentially. |
| uint32_t | num_notes | Length of the notes array. |
| const SpeakerSample * | sample |
If non-NULL, notes are played by pitch-shifting this sample; note.waveform is ignored. If NULL, notes use their waveform field. |